diff --git a/README.md b/README.md index 5db294c1..39d49a07 100644 --- a/README.md +++ b/README.md @@ -19,20 +19,20 @@ If you are using Maven, add this to your pom.xml file: com.google.cloud google-cloud-functions - 2.4.0 + 2.4.1 ``` If you are using Gradle without BOM, add this to your dependencies ```Groovy -implementation 'com.google.cloud:google-cloud-functions:2.4.0' +implementation 'com.google.cloud:google-cloud-functions:2.4.1' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-functions" % "2.4.0" +libraryDependencies += "com.google.cloud" % "google-cloud-functions" % "2.4.1" ``` ## Authentication diff --git a/google-cloud-functions-bom/pom.xml b/google-cloud-functions-bom/pom.xml index deb6e0a6..d580da4a 100644 --- a/google-cloud-functions-bom/pom.xml +++ b/google-cloud-functions-bom/pom.xml @@ -63,11 +63,31 @@ grpc-google-cloud-functions-v1 2.4.2-SNAPSHOT + + com.google.api.grpc + grpc-google-cloud-functions-v2beta + 2.4.2-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-functions-v2alpha + 2.4.2-SNAPSHOT + com.google.api.grpc proto-google-cloud-functions-v1 2.4.2-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-functions-v2beta + 2.4.2-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-functions-v2alpha + 2.4.2-SNAPSHOT + diff --git a/google-cloud-functions/pom.xml b/google-cloud-functions/pom.xml index b40529a8..eb96f16e 100644 --- a/google-cloud-functions/pom.xml +++ b/google-cloud-functions/pom.xml @@ -41,7 +41,24 @@ com.google.api.grpc proto-google-common-protos + + com.google.api.grpc + grpc-google-common-protos + + + com.google.api.grpc + grpc-google-iam-v1 + + + + com.google.api.grpc + proto-google-cloud-functions-v2alpha + + + com.google.api.grpc + proto-google-cloud-functions-v2beta + com.google.api.grpc proto-google-cloud-functions-v1 @@ -58,6 +75,10 @@ com.google.api gax-grpc + + com.google.api + gax-httpjson + org.threeten threetenbp @@ -79,13 +100,35 @@ grpc-google-cloud-functions-v1 test + + com.google.api.grpc + grpc-google-cloud-functions-v2alpha + test + + + com.google.api.grpc + grpc-google-cloud-functions-v2beta + test + + + com.google.api + gax + testlib + test + com.google.api gax-grpc testlib test + + com.google.api + gax-httpjson + testlib + test + diff --git a/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/CloudFunctionsServiceClient.java b/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/CloudFunctionsServiceClient.java index e9d34b99..89cb411e 100644 --- a/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/CloudFunctionsServiceClient.java +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/CloudFunctionsServiceClient.java @@ -20,6 +20,7 @@ import com.google.api.core.ApiFutures; import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.httpjson.longrunning.OperationsClient; import com.google.api.gax.longrunning.OperationFuture; import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; @@ -36,7 +37,6 @@ import com.google.iam.v1.TestIamPermissionsRequest; import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.Operation; -import com.google.longrunning.OperationsClient; import com.google.protobuf.Empty; import java.io.IOException; import java.util.List; @@ -111,13 +111,29 @@ * CloudFunctionsServiceClient.create(cloudFunctionsServiceSettings); * } * + *

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

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

Please refer to the GitHub repository's samples for more quickstart code snippets. */ @Generated("by gapic-generator-java") public class CloudFunctionsServiceClient implements BackgroundResource { private final CloudFunctionsServiceSettings settings; private final CloudFunctionsServiceStub stub; - private final OperationsClient operationsClient; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; /** Constructs an instance of CloudFunctionsServiceClient with default settings. */ public static final CloudFunctionsServiceClient create() throws IOException { @@ -137,7 +153,6 @@ public static final CloudFunctionsServiceClient create(CloudFunctionsServiceSett * Constructs an instance of CloudFunctionsServiceClient, using the given stub for making calls. * This is for advanced usage - prefer using create(CloudFunctionsServiceSettings). */ - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final CloudFunctionsServiceClient create(CloudFunctionsServiceStub stub) { return new CloudFunctionsServiceClient(stub); } @@ -150,21 +165,23 @@ public static final CloudFunctionsServiceClient create(CloudFunctionsServiceStub protected CloudFunctionsServiceClient(CloudFunctionsServiceSettings settings) throws IOException { this.settings = settings; this.stub = ((CloudFunctionsServiceStubSettings) settings.getStubSettings()).createStub(); - this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); } - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected CloudFunctionsServiceClient(CloudFunctionsServiceStub stub) { this.settings = null; this.stub = stub; - this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); } public final CloudFunctionsServiceSettings getSettings() { return settings; } - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public CloudFunctionsServiceStub getStub() { return stub; } @@ -173,10 +190,19 @@ public CloudFunctionsServiceStub getStub() { * Returns the OperationsClient that can be used to query the status of a long-running operation * returned by another API method call. */ - public final OperationsClient getOperationsClient() { + public final com.google.longrunning.OperationsClient getOperationsClient() { return operationsClient; } + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns a list of functions that belong to the requested project. @@ -259,7 +285,7 @@ public final ListFunctionsPagedResponse listFunctions(ListFunctionsRequest reque * while (true) { * ListFunctionsResponse response = * cloudFunctionsServiceClient.listFunctionsCallable().call(request); - * for (CloudFunction element : response.getResponsesList()) { + * for (CloudFunction element : response.getFunctionsList()) { * // doThingsWith(element); * } * String nextPageToken = response.getNextPageToken(); @@ -930,7 +956,12 @@ public final UnaryCallable callFuncti * try (CloudFunctionsServiceClient cloudFunctionsServiceClient = * CloudFunctionsServiceClient.create()) { * GenerateUploadUrlRequest request = - * GenerateUploadUrlRequest.newBuilder().setParent("parent-995424086").build(); + * GenerateUploadUrlRequest.newBuilder() + * .setParent("parent-995424086") + * .setKmsKeyName( + * CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + * .toString()) + * .build(); * GenerateUploadUrlResponse response = cloudFunctionsServiceClient.generateUploadUrl(request); * } * } @@ -981,7 +1012,12 @@ public final GenerateUploadUrlResponse generateUploadUrl(GenerateUploadUrlReques * try (CloudFunctionsServiceClient cloudFunctionsServiceClient = * CloudFunctionsServiceClient.create()) { * GenerateUploadUrlRequest request = - * GenerateUploadUrlRequest.newBuilder().setParent("parent-995424086").build(); + * GenerateUploadUrlRequest.newBuilder() + * .setParent("parent-995424086") + * .setKmsKeyName( + * CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + * .toString()) + * .build(); * ApiFuture future = * cloudFunctionsServiceClient.generateUploadUrlCallable().futureCall(request); * // Do something. diff --git a/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/CloudFunctionsServiceSettings.java b/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/CloudFunctionsServiceSettings.java index 02e20d63..b7b948fe 100644 --- a/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/CloudFunctionsServiceSettings.java +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/CloudFunctionsServiceSettings.java @@ -23,6 +23,7 @@ import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; @@ -186,11 +187,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde return CloudFunctionsServiceStubSettings.defaultCredentialsProviderBuilder(); } - /** Returns a builder for the default ChannelProvider for this service. */ + /** Returns a builder for the default gRPC ChannelProvider for this service. */ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { return CloudFunctionsServiceStubSettings.defaultGrpcTransportProviderBuilder(); } + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return CloudFunctionsServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + public static TransportChannelProvider defaultTransportChannelProvider() { return CloudFunctionsServiceStubSettings.defaultTransportChannelProvider(); } @@ -200,11 +208,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil return CloudFunctionsServiceStubSettings.defaultApiClientHeaderProviderBuilder(); } - /** Returns a new builder for this class. */ + /** Returns a new gRPC builder for this class. */ public static Builder newBuilder() { return Builder.createDefault(); } + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + /** Returns a new builder for this class. */ public static Builder newBuilder(ClientContext clientContext) { return new Builder(clientContext); @@ -243,6 +257,11 @@ private static Builder createDefault() { return new Builder(CloudFunctionsServiceStubSettings.newBuilder()); } + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(CloudFunctionsServiceStubSettings.newHttpJsonBuilder()); + } + public CloudFunctionsServiceStubSettings.Builder getStubSettingsBuilder() { return ((CloudFunctionsServiceStubSettings.Builder) getStubSettings()); } diff --git a/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/package-info.java b/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/package-info.java index 7a9060ac..2f0560c1 100644 --- a/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/package-info.java +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/package-info.java @@ -15,7 +15,9 @@ */ /** - * The interfaces provided are listed below, along with usage samples. + * A client to Cloud Functions API + * + *

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

======================= CloudFunctionsServiceClient ======================= * diff --git a/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/CloudFunctionsServiceStub.java b/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/CloudFunctionsServiceStub.java index 9e279bca..5566507b 100644 --- a/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/CloudFunctionsServiceStub.java +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/CloudFunctionsServiceStub.java @@ -55,7 +55,11 @@ public abstract class CloudFunctionsServiceStub implements BackgroundResource { public OperationsStub getOperationsStub() { - throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; } public UnaryCallable diff --git a/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/CloudFunctionsServiceStubSettings.java b/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/CloudFunctionsServiceStubSettings.java index 537e8b50..b7280156 100644 --- a/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/CloudFunctionsServiceStubSettings.java +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/CloudFunctionsServiceStubSettings.java @@ -28,6 +28,9 @@ import com.google.api.gax.grpc.GrpcTransportChannel; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; import com.google.api.gax.longrunning.OperationSnapshot; import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; import com.google.api.gax.retrying.RetrySettings; @@ -271,13 +274,17 @@ public UnaryCallSettings getIamPolicySettings() { return testIamPermissionsSettings; } - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public CloudFunctionsServiceStub createStub() throws IOException { if (getTransportChannelProvider() .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcCloudFunctionsServiceStub.create(this); } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonCloudFunctionsServiceStub.create(this); + } throw new UnsupportedOperationException( String.format( "Transport not supported: %s", getTransportChannelProvider().getTransportName())); @@ -310,18 +317,25 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde .setUseJwtAccessWithScope(true); } - /** Returns a builder for the default ChannelProvider for this service. */ + /** Returns a builder for the default gRPC ChannelProvider for this service. */ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { return InstantiatingGrpcChannelProvider.newBuilder() .setMaxInboundMessageSize(Integer.MAX_VALUE); } + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + public static TransportChannelProvider defaultTransportChannelProvider() { return defaultGrpcTransportProviderBuilder().build(); } @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { return ApiClientHeaderProvider.newBuilder() .setGeneratedLibToken( "gapic", GaxProperties.getLibraryVersion(CloudFunctionsServiceStubSettings.class)) @@ -329,11 +343,30 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); } - /** Returns a new builder for this class. */ + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(CloudFunctionsServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return CloudFunctionsServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ public static Builder newBuilder() { return Builder.createDefault(); } + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + /** Returns a new builder for this class. */ public static Builder newBuilder(ClientContext clientContext) { return new Builder(clientContext); @@ -525,6 +558,19 @@ private static Builder createDefault() { return initDefaults(builder); } + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + private static Builder initDefaults(Builder builder) { builder .listFunctionsSettings() diff --git a/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/HttpJsonCloudFunctionsServiceCallableFactory.java b/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/HttpJsonCloudFunctionsServiceCallableFactory.java new file mode 100644 index 00000000..a4deb7e0 --- /dev/null +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v1/stub/HttpJsonCloudFunctionsServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the CloudFunctionsService service API. + * + *

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

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonCloudFunctionsServiceStub extends CloudFunctionsServiceStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(Empty.getDescriptor()) + .add(CloudFunction.getDescriptor()) + .add(OperationMetadataV1.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + listFunctionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.functions.v1.CloudFunctionsService/ListFunctions") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/functions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListFunctionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getFunctionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.functions.v1.CloudFunctionsService/GetFunction") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/functions/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(CloudFunction.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createFunctionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.functions.v1.CloudFunctionsService/CreateFunction") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{location=projects/*/locations/*}/functions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "location", request.getLocation()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("function", request.getFunction())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateFunctionRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updateFunctionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.functions.v1.CloudFunctionsService/UpdateFunction") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{function.name=projects/*/locations/*/functions/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "function.name", request.getFunction().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("function", request.getFunction())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdateFunctionRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deleteFunctionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.functions.v1.CloudFunctionsService/DeleteFunction") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/functions/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteFunctionRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + callFunctionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.functions.v1.CloudFunctionsService/CallFunction") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/functions/*}:call", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(CallFunctionResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + generateUploadUrlMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.functions.v1.CloudFunctionsService/GenerateUploadUrl") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/functions:generateUploadUrl", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(GenerateUploadUrlResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + generateDownloadUrlMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.functions.v1.CloudFunctionsService/GenerateDownloadUrl") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/functions/*}:generateDownloadUrl", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(GenerateDownloadUrlResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + setIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.functions.v1.CloudFunctionsService/SetIamPolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{resource=projects/*/locations/*/functions/*}:setIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.functions.v1.CloudFunctionsService/GetIamPolicy") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{resource=projects/*/locations/*/functions/*}:getIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "options", request.getOptions()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + testIamPermissionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.functions.v1.CloudFunctionsService/TestIamPermissions") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{resource=projects/*/locations/*/functions/*}:testIamPermissions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(TestIamPermissionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable listFunctionsCallable; + private final UnaryCallable + listFunctionsPagedCallable; + private final UnaryCallable getFunctionCallable; + private final UnaryCallable createFunctionCallable; + private final OperationCallable + createFunctionOperationCallable; + private final UnaryCallable updateFunctionCallable; + private final OperationCallable + updateFunctionOperationCallable; + private final UnaryCallable deleteFunctionCallable; + private final OperationCallable + deleteFunctionOperationCallable; + private final UnaryCallable callFunctionCallable; + private final UnaryCallable + generateUploadUrlCallable; + private final UnaryCallable + generateDownloadUrlCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonCloudFunctionsServiceStub create( + CloudFunctionsServiceStubSettings settings) throws IOException { + return new HttpJsonCloudFunctionsServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonCloudFunctionsServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonCloudFunctionsServiceStub( + CloudFunctionsServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonCloudFunctionsServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonCloudFunctionsServiceStub( + CloudFunctionsServiceStubSettings.newHttpJsonBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of HttpJsonCloudFunctionsServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected HttpJsonCloudFunctionsServiceStub( + CloudFunctionsServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonCloudFunctionsServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonCloudFunctionsServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected HttpJsonCloudFunctionsServiceStub( + CloudFunctionsServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry); + + HttpJsonCallSettings + listFunctionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listFunctionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getFunctionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getFunctionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings createFunctionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createFunctionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateFunctionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateFunctionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteFunctionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteFunctionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings callFunctionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(callFunctionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + generateUploadUrlTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(generateUploadUrlMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + generateDownloadUrlTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(generateDownloadUrlMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings setIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + testIamPermissionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.listFunctionsCallable = + callableFactory.createUnaryCallable( + listFunctionsTransportSettings, settings.listFunctionsSettings(), clientContext); + this.listFunctionsPagedCallable = + callableFactory.createPagedCallable( + listFunctionsTransportSettings, settings.listFunctionsSettings(), clientContext); + this.getFunctionCallable = + callableFactory.createUnaryCallable( + getFunctionTransportSettings, settings.getFunctionSettings(), clientContext); + this.createFunctionCallable = + callableFactory.createUnaryCallable( + createFunctionTransportSettings, settings.createFunctionSettings(), clientContext); + this.createFunctionOperationCallable = + callableFactory.createOperationCallable( + createFunctionTransportSettings, + settings.createFunctionOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updateFunctionCallable = + callableFactory.createUnaryCallable( + updateFunctionTransportSettings, settings.updateFunctionSettings(), clientContext); + this.updateFunctionOperationCallable = + callableFactory.createOperationCallable( + updateFunctionTransportSettings, + settings.updateFunctionOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deleteFunctionCallable = + callableFactory.createUnaryCallable( + deleteFunctionTransportSettings, settings.deleteFunctionSettings(), clientContext); + this.deleteFunctionOperationCallable = + callableFactory.createOperationCallable( + deleteFunctionTransportSettings, + settings.deleteFunctionOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.callFunctionCallable = + callableFactory.createUnaryCallable( + callFunctionTransportSettings, settings.callFunctionSettings(), clientContext); + this.generateUploadUrlCallable = + callableFactory.createUnaryCallable( + generateUploadUrlTransportSettings, + settings.generateUploadUrlSettings(), + clientContext); + this.generateDownloadUrlCallable = + callableFactory.createUnaryCallable( + generateDownloadUrlTransportSettings, + settings.generateDownloadUrlSettings(), + clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(listFunctionsMethodDescriptor); + methodDescriptors.add(getFunctionMethodDescriptor); + methodDescriptors.add(createFunctionMethodDescriptor); + methodDescriptors.add(updateFunctionMethodDescriptor); + methodDescriptors.add(deleteFunctionMethodDescriptor); + methodDescriptors.add(callFunctionMethodDescriptor); + methodDescriptors.add(generateUploadUrlMethodDescriptor); + methodDescriptors.add(generateDownloadUrlMethodDescriptor); + methodDescriptors.add(setIamPolicyMethodDescriptor); + methodDescriptors.add(getIamPolicyMethodDescriptor); + methodDescriptors.add(testIamPermissionsMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable listFunctionsCallable() { + return listFunctionsCallable; + } + + @Override + public UnaryCallable + listFunctionsPagedCallable() { + return listFunctionsPagedCallable; + } + + @Override + public UnaryCallable getFunctionCallable() { + return getFunctionCallable; + } + + @Override + public UnaryCallable createFunctionCallable() { + return createFunctionCallable; + } + + @Override + public OperationCallable + createFunctionOperationCallable() { + return createFunctionOperationCallable; + } + + @Override + public UnaryCallable updateFunctionCallable() { + return updateFunctionCallable; + } + + @Override + public OperationCallable + updateFunctionOperationCallable() { + return updateFunctionOperationCallable; + } + + @Override + public UnaryCallable deleteFunctionCallable() { + return deleteFunctionCallable; + } + + @Override + public OperationCallable + deleteFunctionOperationCallable() { + return deleteFunctionOperationCallable; + } + + @Override + public UnaryCallable callFunctionCallable() { + return callFunctionCallable; + } + + @Override + public UnaryCallable + generateUploadUrlCallable() { + return generateUploadUrlCallable; + } + + @Override + public UnaryCallable + generateDownloadUrlCallable() { + return generateDownloadUrlCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-functions/src/main/java/com/google/cloud/functions/v2alpha/FunctionServiceClient.java b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2alpha/FunctionServiceClient.java new file mode 100644 index 00000000..c4e4823a --- /dev/null +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2alpha/FunctionServiceClient.java @@ -0,0 +1,1583 @@ +/* + * 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.v2alpha; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.httpjson.longrunning.OperationsClient; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.functions.v2alpha.stub.FunctionServiceStub; +import com.google.cloud.functions.v2alpha.stub.FunctionServiceStubSettings; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Google Cloud Functions is used to deploy functions that are executed by + * Google in response to various events. Data connected with that event is passed to a function as + * the input data. + * + *

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

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

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

Note: close() needs to be called on the FunctionServiceClient object to clean up resources + * such as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

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

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

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

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

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

To customize credentials: + * + *

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

To customize the endpoint: + * + *

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

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

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

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class FunctionServiceClient implements BackgroundResource { + private final FunctionServiceSettings settings; + private final FunctionServiceStub stub; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; + + /** Constructs an instance of FunctionServiceClient with default settings. */ + public static final FunctionServiceClient create() throws IOException { + return create(FunctionServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of FunctionServiceClient, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. + */ + public static final FunctionServiceClient create(FunctionServiceSettings settings) + throws IOException { + return new FunctionServiceClient(settings); + } + + /** + * Constructs an instance of FunctionServiceClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(FunctionServiceSettings). + */ + public static final FunctionServiceClient create(FunctionServiceStub stub) { + return new FunctionServiceClient(stub); + } + + /** + * Constructs an instance of FunctionServiceClient, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected FunctionServiceClient(FunctionServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((FunctionServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + protected FunctionServiceClient(FunctionServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + public final FunctionServiceSettings getSettings() { + return settings; + } + + public FunctionServiceStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final com.google.longrunning.OperationsClient getOperationsClient() { + return operationsClient; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a function with the given name from the requested project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   FunctionName name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]");
+   *   Function response = functionServiceClient.getFunction(name);
+   * }
+   * }
+ * + * @param name Required. The name of the function which details should be obtained. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Function getFunction(FunctionName name) { + GetFunctionRequest request = + GetFunctionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getFunction(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a function with the given name from the requested project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   String name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString();
+   *   Function response = functionServiceClient.getFunction(name);
+   * }
+   * }
+ * + * @param name Required. The name of the function which details should be obtained. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Function getFunction(String name) { + GetFunctionRequest request = GetFunctionRequest.newBuilder().setName(name).build(); + return getFunction(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a function with the given name from the requested project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   GetFunctionRequest request =
+   *       GetFunctionRequest.newBuilder()
+   *           .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
+   *           .build();
+   *   Function response = functionServiceClient.getFunction(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Function getFunction(GetFunctionRequest request) { + return getFunctionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a function with the given name from the requested project. + * + *

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Function element : functionServiceClient.listFunctions(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The project and location from which the function should be listed, + * specified in the format `projects/*/locations/*` If you want to list functions in + * all locations, use "-" in place of a location. When listing functions in all locations, if + * one or more location(s) are unreachable, the response will contain functions from all + * reachable locations along with the names of any unreachable locations. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListFunctionsPagedResponse listFunctions(LocationName parent) { + ListFunctionsRequest request = + ListFunctionsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listFunctions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a list of functions that belong to the requested project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (Function element : functionServiceClient.listFunctions(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The project and location from which the function should be listed, + * specified in the format `projects/*/locations/*` If you want to list functions in + * all locations, use "-" in place of a location. When listing functions in all locations, if + * one or more location(s) are unreachable, the response will contain functions from all + * reachable locations along with the names of any unreachable locations. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListFunctionsPagedResponse listFunctions(String parent) { + ListFunctionsRequest request = ListFunctionsRequest.newBuilder().setParent(parent).build(); + return listFunctions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a list of functions that belong to the requested project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   ListFunctionsRequest request =
+   *       ListFunctionsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (Function element : functionServiceClient.listFunctions(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListFunctionsPagedResponse listFunctions(ListFunctionsRequest request) { + return listFunctionsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a list of functions that belong to the requested project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   ListFunctionsRequest request =
+   *       ListFunctionsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       functionServiceClient.listFunctionsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Function element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listFunctionsPagedCallable() { + return stub.listFunctionsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a list of functions that belong to the requested project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   ListFunctionsRequest request =
+   *       ListFunctionsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   while (true) {
+   *     ListFunctionsResponse response =
+   *         functionServiceClient.listFunctionsCallable().call(request);
+   *     for (Function element : response.getFunctionsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listFunctionsCallable() { + return stub.listFunctionsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new function. If a function with the given name already exists in the specified + * project, the long running operation will return `ALREADY_EXISTS` error. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Function function = Function.newBuilder().build();
+   *   String functionId = "functionId-62789869";
+   *   Function response =
+   *       functionServiceClient.createFunctionAsync(parent, function, functionId).get();
+   * }
+   * }
+ * + * @param parent Required. The project and location in which the function should be created, + * specified in the format `projects/*/locations/*` + * @param function Required. Function to be created. + * @param functionId The ID to use for the function, which will become the final component of the + * function's resource name. + *

This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createFunctionAsync( + LocationName parent, Function function, String functionId) { + CreateFunctionRequest request = + CreateFunctionRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setFunction(function) + .setFunctionId(functionId) + .build(); + return createFunctionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new function. If a function with the given name already exists in the specified + * project, the long running operation will return `ALREADY_EXISTS` error. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   Function function = Function.newBuilder().build();
+   *   String functionId = "functionId-62789869";
+   *   Function response =
+   *       functionServiceClient.createFunctionAsync(parent, function, functionId).get();
+   * }
+   * }
+ * + * @param parent Required. The project and location in which the function should be created, + * specified in the format `projects/*/locations/*` + * @param function Required. Function to be created. + * @param functionId The ID to use for the function, which will become the final component of the + * function's resource name. + *

This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createFunctionAsync( + String parent, Function function, String functionId) { + CreateFunctionRequest request = + CreateFunctionRequest.newBuilder() + .setParent(parent) + .setFunction(function) + .setFunctionId(functionId) + .build(); + return createFunctionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new function. If a function with the given name already exists in the specified + * project, the long running operation will return `ALREADY_EXISTS` error. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   CreateFunctionRequest request =
+   *       CreateFunctionRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setFunction(Function.newBuilder().build())
+   *           .setFunctionId("functionId-62789869")
+   *           .build();
+   *   Function response = functionServiceClient.createFunctionAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createFunctionAsync( + CreateFunctionRequest request) { + return createFunctionOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new function. If a function with the given name already exists in the specified + * project, the long running operation will return `ALREADY_EXISTS` error. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   CreateFunctionRequest request =
+   *       CreateFunctionRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setFunction(Function.newBuilder().build())
+   *           .setFunctionId("functionId-62789869")
+   *           .build();
+   *   OperationFuture future =
+   *       functionServiceClient.createFunctionOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Function response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createFunctionOperationCallable() { + return stub.createFunctionOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new function. If a function with the given name already exists in the specified + * project, the long running operation will return `ALREADY_EXISTS` error. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   CreateFunctionRequest request =
+   *       CreateFunctionRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setFunction(Function.newBuilder().build())
+   *           .setFunctionId("functionId-62789869")
+   *           .build();
+   *   ApiFuture future =
+   *       functionServiceClient.createFunctionCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createFunctionCallable() { + return stub.createFunctionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates existing function. + * + *

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   UpdateFunctionRequest request =
+   *       UpdateFunctionRequest.newBuilder()
+   *           .setFunction(Function.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Function response = functionServiceClient.updateFunctionAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateFunctionAsync( + UpdateFunctionRequest request) { + return updateFunctionOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates existing function. + * + *

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   UpdateFunctionRequest request =
+   *       UpdateFunctionRequest.newBuilder()
+   *           .setFunction(Function.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       functionServiceClient.updateFunctionCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateFunctionCallable() { + return stub.updateFunctionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a function with the given name from the specified project. If the given function is + * used by some trigger, the trigger will be updated to remove this function. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   FunctionName name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]");
+   *   functionServiceClient.deleteFunctionAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the function which should be deleted. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteFunctionAsync(FunctionName name) { + DeleteFunctionRequest request = + DeleteFunctionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteFunctionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a function with the given name from the specified project. If the given function is + * used by some trigger, the trigger will be updated to remove this function. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   String name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString();
+   *   functionServiceClient.deleteFunctionAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the function which should be deleted. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteFunctionAsync(String name) { + DeleteFunctionRequest request = DeleteFunctionRequest.newBuilder().setName(name).build(); + return deleteFunctionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a function with the given name from the specified project. If the given function is + * used by some trigger, the trigger will be updated to remove this function. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   DeleteFunctionRequest request =
+   *       DeleteFunctionRequest.newBuilder()
+   *           .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
+   *           .build();
+   *   functionServiceClient.deleteFunctionAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteFunctionAsync( + DeleteFunctionRequest request) { + return deleteFunctionOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a function with the given name from the specified project. If the given function is + * used by some trigger, the trigger will be updated to remove this function. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   DeleteFunctionRequest request =
+   *       DeleteFunctionRequest.newBuilder()
+   *           .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
+   *           .build();
+   *   OperationFuture future =
+   *       functionServiceClient.deleteFunctionOperationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteFunctionOperationCallable() { + return stub.deleteFunctionOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a function with the given name from the specified project. If the given function is + * used by some trigger, the trigger will be updated to remove this function. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   DeleteFunctionRequest request =
+   *       DeleteFunctionRequest.newBuilder()
+   *           .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       functionServiceClient.deleteFunctionCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteFunctionCallable() { + return stub.deleteFunctionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a signed URL for uploading a function source code. For more information about the + * signed URL usage see: https://cloud.google.com/storage/docs/access-control/signed-urls. Once + * the function source code upload is complete, the used signed URL should be provided in + * CreateFunction or UpdateFunction request as a reference to the function source code. + * + *

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

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

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

    + *
  • `content-type: application/zip` + *
+ * + *

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

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   GenerateUploadUrlRequest request =
+   *       GenerateUploadUrlRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .build();
+   *   GenerateUploadUrlResponse response = functionServiceClient.generateUploadUrl(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final GenerateUploadUrlResponse generateUploadUrl(GenerateUploadUrlRequest request) { + return generateUploadUrlCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a signed URL for uploading a function source code. For more information about the + * signed URL usage see: https://cloud.google.com/storage/docs/access-control/signed-urls. Once + * the function source code upload is complete, the used signed URL should be provided in + * CreateFunction or UpdateFunction request as a reference to the function source code. + * + *

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

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

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

    + *
  • `content-type: application/zip` + *
+ * + *

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

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   GenerateUploadUrlRequest request =
+   *       GenerateUploadUrlRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       functionServiceClient.generateUploadUrlCallable().futureCall(request);
+   *   // Do something.
+   *   GenerateUploadUrlResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + generateUploadUrlCallable() { + return stub.generateUploadUrlCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a signed URL for downloading deployed function source code. The URL is only valid for a + * limited period and should be used within 30 minutes of generation. For more information about + * the signed URL usage see: https://cloud.google.com/storage/docs/access-control/signed-urls + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   GenerateDownloadUrlRequest request =
+   *       GenerateDownloadUrlRequest.newBuilder()
+   *           .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
+   *           .build();
+   *   GenerateDownloadUrlResponse response = functionServiceClient.generateDownloadUrl(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final GenerateDownloadUrlResponse generateDownloadUrl(GenerateDownloadUrlRequest request) { + return generateDownloadUrlCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a signed URL for downloading deployed function source code. The URL is only valid for a + * limited period and should be used within 30 minutes of generation. For more information about + * the signed URL usage see: https://cloud.google.com/storage/docs/access-control/signed-urls + * + *

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   ListRuntimesRequest request =
+   *       ListRuntimesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   ListRuntimesResponse response = functionServiceClient.listRuntimes(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListRuntimesResponse listRuntimes(ListRuntimesRequest request) { + return listRuntimesCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a list of runtimes that are supported for the requested project. + * + *

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : functionServiceClient.listLocations(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

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

Sample code: + * + *

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

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Policy response = functionServiceClient.setIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replacesany existing policy. + * + *

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

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   Policy response = functionServiceClient.getIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policyif the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *

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

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   TestIamPermissionsResponse response = functionServiceClient.testIamPermissions(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If theresource does not exist, + * this will return an empty set ofpermissions, not a `NOT_FOUND` error. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       functionServiceClient.testIamPermissionsCallable().futureCall(request);
+   *   // Do something.
+   *   TestIamPermissionsResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListFunctionsPagedResponse + extends AbstractPagedListResponse< + ListFunctionsRequest, + ListFunctionsResponse, + Function, + ListFunctionsPage, + ListFunctionsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListFunctionsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListFunctionsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListFunctionsPagedResponse(ListFunctionsPage page) { + super(page, ListFunctionsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListFunctionsPage + extends AbstractPage< + ListFunctionsRequest, ListFunctionsResponse, Function, ListFunctionsPage> { + + private ListFunctionsPage( + PageContext context, + ListFunctionsResponse response) { + super(context, response); + } + + private static ListFunctionsPage createEmptyPage() { + return new ListFunctionsPage(null, null); + } + + @Override + protected ListFunctionsPage createPage( + PageContext context, + ListFunctionsResponse response) { + return new ListFunctionsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListFunctionsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListFunctionsRequest, + ListFunctionsResponse, + Function, + ListFunctionsPage, + ListFunctionsFixedSizeCollection> { + + private ListFunctionsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListFunctionsFixedSizeCollection createEmptyCollection() { + return new ListFunctionsFixedSizeCollection(null, 0); + } + + @Override + protected ListFunctionsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListFunctionsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-functions/src/main/java/com/google/cloud/functions/v2alpha/FunctionServiceSettings.java b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2alpha/FunctionServiceSettings.java new file mode 100644 index 00000000..e7cb6d98 --- /dev/null +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2alpha/FunctionServiceSettings.java @@ -0,0 +1,377 @@ +/* + * 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.v2alpha; + +import static com.google.cloud.functions.v2alpha.FunctionServiceClient.ListFunctionsPagedResponse; +import static com.google.cloud.functions.v2alpha.FunctionServiceClient.ListLocationsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.functions.v2alpha.stub.FunctionServiceStubSettings; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link FunctionServiceClient}. + * + *

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

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

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

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

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * FunctionServiceSettings.Builder functionServiceSettingsBuilder =
+ *     FunctionServiceSettings.newBuilder();
+ * functionServiceSettingsBuilder
+ *     .getFunctionSettings()
+ *     .setRetrySettings(
+ *         functionServiceSettingsBuilder
+ *             .getFunctionSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * FunctionServiceSettings functionServiceSettings = functionServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class FunctionServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to getFunction. */ + public UnaryCallSettings getFunctionSettings() { + return ((FunctionServiceStubSettings) getStubSettings()).getFunctionSettings(); + } + + /** Returns the object with the settings used for calls to listFunctions. */ + public PagedCallSettings + listFunctionsSettings() { + return ((FunctionServiceStubSettings) getStubSettings()).listFunctionsSettings(); + } + + /** Returns the object with the settings used for calls to createFunction. */ + public UnaryCallSettings createFunctionSettings() { + return ((FunctionServiceStubSettings) getStubSettings()).createFunctionSettings(); + } + + /** Returns the object with the settings used for calls to createFunction. */ + public OperationCallSettings + createFunctionOperationSettings() { + return ((FunctionServiceStubSettings) getStubSettings()).createFunctionOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateFunction. */ + public UnaryCallSettings updateFunctionSettings() { + return ((FunctionServiceStubSettings) getStubSettings()).updateFunctionSettings(); + } + + /** Returns the object with the settings used for calls to updateFunction. */ + public OperationCallSettings + updateFunctionOperationSettings() { + return ((FunctionServiceStubSettings) getStubSettings()).updateFunctionOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteFunction. */ + public UnaryCallSettings deleteFunctionSettings() { + return ((FunctionServiceStubSettings) getStubSettings()).deleteFunctionSettings(); + } + + /** Returns the object with the settings used for calls to deleteFunction. */ + public OperationCallSettings + deleteFunctionOperationSettings() { + return ((FunctionServiceStubSettings) getStubSettings()).deleteFunctionOperationSettings(); + } + + /** Returns the object with the settings used for calls to generateUploadUrl. */ + public UnaryCallSettings + generateUploadUrlSettings() { + return ((FunctionServiceStubSettings) getStubSettings()).generateUploadUrlSettings(); + } + + /** Returns the object with the settings used for calls to generateDownloadUrl. */ + public UnaryCallSettings + generateDownloadUrlSettings() { + return ((FunctionServiceStubSettings) getStubSettings()).generateDownloadUrlSettings(); + } + + /** Returns the object with the settings used for calls to listRuntimes. */ + public UnaryCallSettings listRuntimesSettings() { + return ((FunctionServiceStubSettings) getStubSettings()).listRuntimesSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((FunctionServiceStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((FunctionServiceStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((FunctionServiceStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((FunctionServiceStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + public static final FunctionServiceSettings create(FunctionServiceStubSettings stub) + throws IOException { + return new FunctionServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return FunctionServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return FunctionServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return FunctionServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return FunctionServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return FunctionServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return FunctionServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return FunctionServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return FunctionServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected FunctionServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for FunctionServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(FunctionServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(FunctionServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(FunctionServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(FunctionServiceStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(FunctionServiceStubSettings.newHttpJsonBuilder()); + } + + public FunctionServiceStubSettings.Builder getStubSettingsBuilder() { + return ((FunctionServiceStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to getFunction. */ + public UnaryCallSettings.Builder getFunctionSettings() { + return getStubSettingsBuilder().getFunctionSettings(); + } + + /** Returns the builder for the settings used for calls to listFunctions. */ + public PagedCallSettings.Builder< + ListFunctionsRequest, ListFunctionsResponse, ListFunctionsPagedResponse> + listFunctionsSettings() { + return getStubSettingsBuilder().listFunctionsSettings(); + } + + /** Returns the builder for the settings used for calls to createFunction. */ + public UnaryCallSettings.Builder createFunctionSettings() { + return getStubSettingsBuilder().createFunctionSettings(); + } + + /** Returns the builder for the settings used for calls to createFunction. */ + public OperationCallSettings.Builder + createFunctionOperationSettings() { + return getStubSettingsBuilder().createFunctionOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateFunction. */ + public UnaryCallSettings.Builder updateFunctionSettings() { + return getStubSettingsBuilder().updateFunctionSettings(); + } + + /** Returns the builder for the settings used for calls to updateFunction. */ + public OperationCallSettings.Builder + updateFunctionOperationSettings() { + return getStubSettingsBuilder().updateFunctionOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteFunction. */ + public UnaryCallSettings.Builder deleteFunctionSettings() { + return getStubSettingsBuilder().deleteFunctionSettings(); + } + + /** Returns the builder for the settings used for calls to deleteFunction. */ + public OperationCallSettings.Builder + deleteFunctionOperationSettings() { + return getStubSettingsBuilder().deleteFunctionOperationSettings(); + } + + /** Returns the builder for the settings used for calls to generateUploadUrl. */ + public UnaryCallSettings.Builder + generateUploadUrlSettings() { + return getStubSettingsBuilder().generateUploadUrlSettings(); + } + + /** Returns the builder for the settings used for calls to generateDownloadUrl. */ + public UnaryCallSettings.Builder + generateDownloadUrlSettings() { + return getStubSettingsBuilder().generateDownloadUrlSettings(); + } + + /** Returns the builder for the settings used for calls to listRuntimes. */ + public UnaryCallSettings.Builder + listRuntimesSettings() { + return getStubSettingsBuilder().listRuntimesSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + @Override + public FunctionServiceSettings build() throws IOException { + return new FunctionServiceSettings(this); + } + } +} diff --git a/google-cloud-functions/src/main/java/com/google/cloud/functions/v2alpha/gapic_metadata.json b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2alpha/gapic_metadata.json new file mode 100644 index 00000000..aa308e37 --- /dev/null +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2alpha/gapic_metadata.json @@ -0,0 +1,54 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.functions.v2alpha", + "libraryPackage": "com.google.cloud.functions.v2alpha", + "services": { + "FunctionService": { + "clients": { + "grpc": { + "libraryClient": "FunctionServiceClient", + "rpcs": { + "CreateFunction": { + "methods": ["createFunctionAsync", "createFunctionAsync", "createFunctionAsync", "createFunctionOperationCallable", "createFunctionCallable"] + }, + "DeleteFunction": { + "methods": ["deleteFunctionAsync", "deleteFunctionAsync", "deleteFunctionAsync", "deleteFunctionOperationCallable", "deleteFunctionCallable"] + }, + "GenerateDownloadUrl": { + "methods": ["generateDownloadUrl", "generateDownloadUrlCallable"] + }, + "GenerateUploadUrl": { + "methods": ["generateUploadUrl", "generateUploadUrlCallable"] + }, + "GetFunction": { + "methods": ["getFunction", "getFunction", "getFunction", "getFunctionCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicyCallable"] + }, + "ListFunctions": { + "methods": ["listFunctions", "listFunctions", "listFunctions", "listFunctionsPagedCallable", "listFunctionsCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "ListRuntimes": { + "methods": ["listRuntimes", "listRuntimes", "listRuntimes", "listRuntimesCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] + }, + "UpdateFunction": { + "methods": ["updateFunctionAsync", "updateFunctionAsync", "updateFunctionOperationCallable", "updateFunctionCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/google-cloud-functions/src/main/java/com/google/cloud/functions/v2alpha/package-info.java b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2alpha/package-info.java new file mode 100644 index 00000000..212cdf5b --- /dev/null +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2alpha/package-info.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * A client to Cloud Functions API + * + *

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

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

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

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

Sample for FunctionServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+ *   FunctionName name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]");
+ *   Function response = functionServiceClient.getFunction(name);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.functions.v2alpha; + +import javax.annotation.Generated; diff --git a/google-cloud-functions/src/main/java/com/google/cloud/functions/v2alpha/stub/FunctionServiceStub.java b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2alpha/stub/FunctionServiceStub.java new file mode 100644 index 00000000..db2b4284 --- /dev/null +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2alpha/stub/FunctionServiceStub.java @@ -0,0 +1,148 @@ +/* + * 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.v2alpha.stub; + +import static com.google.cloud.functions.v2alpha.FunctionServiceClient.ListFunctionsPagedResponse; +import static com.google.cloud.functions.v2alpha.FunctionServiceClient.ListLocationsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.functions.v2alpha.CreateFunctionRequest; +import com.google.cloud.functions.v2alpha.DeleteFunctionRequest; +import com.google.cloud.functions.v2alpha.Function; +import com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest; +import com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse; +import com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest; +import com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse; +import com.google.cloud.functions.v2alpha.GetFunctionRequest; +import com.google.cloud.functions.v2alpha.ListFunctionsRequest; +import com.google.cloud.functions.v2alpha.ListFunctionsResponse; +import com.google.cloud.functions.v2alpha.ListRuntimesRequest; +import com.google.cloud.functions.v2alpha.ListRuntimesResponse; +import com.google.cloud.functions.v2alpha.OperationMetadata; +import com.google.cloud.functions.v2alpha.UpdateFunctionRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the FunctionService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class FunctionServiceStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; + } + + public UnaryCallable getFunctionCallable() { + throw new UnsupportedOperationException("Not implemented: getFunctionCallable()"); + } + + public UnaryCallable + listFunctionsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listFunctionsPagedCallable()"); + } + + public UnaryCallable listFunctionsCallable() { + throw new UnsupportedOperationException("Not implemented: listFunctionsCallable()"); + } + + public OperationCallable + createFunctionOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createFunctionOperationCallable()"); + } + + public UnaryCallable createFunctionCallable() { + throw new UnsupportedOperationException("Not implemented: createFunctionCallable()"); + } + + public OperationCallable + updateFunctionOperationCallable() { + throw new UnsupportedOperationException("Not implemented: updateFunctionOperationCallable()"); + } + + public UnaryCallable updateFunctionCallable() { + throw new UnsupportedOperationException("Not implemented: updateFunctionCallable()"); + } + + public OperationCallable + deleteFunctionOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteFunctionOperationCallable()"); + } + + public UnaryCallable deleteFunctionCallable() { + throw new UnsupportedOperationException("Not implemented: deleteFunctionCallable()"); + } + + public UnaryCallable + generateUploadUrlCallable() { + throw new UnsupportedOperationException("Not implemented: generateUploadUrlCallable()"); + } + + public UnaryCallable + generateDownloadUrlCallable() { + throw new UnsupportedOperationException("Not implemented: generateDownloadUrlCallable()"); + } + + public UnaryCallable listRuntimesCallable() { + throw new UnsupportedOperationException("Not implemented: listRuntimesCallable()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-functions/src/main/java/com/google/cloud/functions/v2alpha/stub/FunctionServiceStubSettings.java b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2alpha/stub/FunctionServiceStubSettings.java new file mode 100644 index 00000000..55f82c08 --- /dev/null +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2alpha/stub/FunctionServiceStubSettings.java @@ -0,0 +1,865 @@ +/* + * 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.v2alpha.stub; + +import static com.google.cloud.functions.v2alpha.FunctionServiceClient.ListFunctionsPagedResponse; +import static com.google.cloud.functions.v2alpha.FunctionServiceClient.ListLocationsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.functions.v2alpha.CreateFunctionRequest; +import com.google.cloud.functions.v2alpha.DeleteFunctionRequest; +import com.google.cloud.functions.v2alpha.Function; +import com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest; +import com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse; +import com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest; +import com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse; +import com.google.cloud.functions.v2alpha.GetFunctionRequest; +import com.google.cloud.functions.v2alpha.ListFunctionsRequest; +import com.google.cloud.functions.v2alpha.ListFunctionsResponse; +import com.google.cloud.functions.v2alpha.ListRuntimesRequest; +import com.google.cloud.functions.v2alpha.ListRuntimesResponse; +import com.google.cloud.functions.v2alpha.OperationMetadata; +import com.google.cloud.functions.v2alpha.UpdateFunctionRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link FunctionServiceStub}. + * + *

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

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

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

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

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * FunctionServiceStubSettings.Builder functionServiceSettingsBuilder =
+ *     FunctionServiceStubSettings.newBuilder();
+ * functionServiceSettingsBuilder
+ *     .getFunctionSettings()
+ *     .setRetrySettings(
+ *         functionServiceSettingsBuilder
+ *             .getFunctionSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * FunctionServiceStubSettings functionServiceSettings = functionServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class FunctionServiceStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final UnaryCallSettings getFunctionSettings; + private final PagedCallSettings< + ListFunctionsRequest, ListFunctionsResponse, ListFunctionsPagedResponse> + listFunctionsSettings; + private final UnaryCallSettings createFunctionSettings; + private final OperationCallSettings + createFunctionOperationSettings; + private final UnaryCallSettings updateFunctionSettings; + private final OperationCallSettings + updateFunctionOperationSettings; + private final UnaryCallSettings deleteFunctionSettings; + private final OperationCallSettings + deleteFunctionOperationSettings; + private final UnaryCallSettings + generateUploadUrlSettings; + private final UnaryCallSettings + generateDownloadUrlSettings; + private final UnaryCallSettings listRuntimesSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + private static final PagedListDescriptor + LIST_FUNCTIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListFunctionsRequest injectToken(ListFunctionsRequest payload, String token) { + return ListFunctionsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListFunctionsRequest injectPageSize(ListFunctionsRequest payload, int pageSize) { + return ListFunctionsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListFunctionsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListFunctionsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListFunctionsResponse payload) { + return payload.getFunctionsList() == null + ? ImmutableList.of() + : payload.getFunctionsList(); + } + }; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList() == null + ? ImmutableList.of() + : payload.getLocationsList(); + } + }; + + private static final PagedListResponseFactory< + ListFunctionsRequest, ListFunctionsResponse, ListFunctionsPagedResponse> + LIST_FUNCTIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListFunctionsRequest, ListFunctionsResponse, ListFunctionsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListFunctionsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_FUNCTIONS_PAGE_STR_DESC, request, context); + return ListFunctionsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to getFunction. */ + public UnaryCallSettings getFunctionSettings() { + return getFunctionSettings; + } + + /** Returns the object with the settings used for calls to listFunctions. */ + public PagedCallSettings + listFunctionsSettings() { + return listFunctionsSettings; + } + + /** Returns the object with the settings used for calls to createFunction. */ + public UnaryCallSettings createFunctionSettings() { + return createFunctionSettings; + } + + /** Returns the object with the settings used for calls to createFunction. */ + public OperationCallSettings + createFunctionOperationSettings() { + return createFunctionOperationSettings; + } + + /** Returns the object with the settings used for calls to updateFunction. */ + public UnaryCallSettings updateFunctionSettings() { + return updateFunctionSettings; + } + + /** Returns the object with the settings used for calls to updateFunction. */ + public OperationCallSettings + updateFunctionOperationSettings() { + return updateFunctionOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteFunction. */ + public UnaryCallSettings deleteFunctionSettings() { + return deleteFunctionSettings; + } + + /** Returns the object with the settings used for calls to deleteFunction. */ + public OperationCallSettings + deleteFunctionOperationSettings() { + return deleteFunctionOperationSettings; + } + + /** Returns the object with the settings used for calls to generateUploadUrl. */ + public UnaryCallSettings + generateUploadUrlSettings() { + return generateUploadUrlSettings; + } + + /** Returns the object with the settings used for calls to generateDownloadUrl. */ + public UnaryCallSettings + generateDownloadUrlSettings() { + return generateDownloadUrlSettings; + } + + /** Returns the object with the settings used for calls to listRuntimes. */ + public UnaryCallSettings listRuntimesSettings() { + return listRuntimesSettings; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + public FunctionServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcFunctionServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonFunctionServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "cloudfunctions.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "cloudfunctions.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(FunctionServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(FunctionServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return FunctionServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected FunctionServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + getFunctionSettings = settingsBuilder.getFunctionSettings().build(); + listFunctionsSettings = settingsBuilder.listFunctionsSettings().build(); + createFunctionSettings = settingsBuilder.createFunctionSettings().build(); + createFunctionOperationSettings = settingsBuilder.createFunctionOperationSettings().build(); + updateFunctionSettings = settingsBuilder.updateFunctionSettings().build(); + updateFunctionOperationSettings = settingsBuilder.updateFunctionOperationSettings().build(); + deleteFunctionSettings = settingsBuilder.deleteFunctionSettings().build(); + deleteFunctionOperationSettings = settingsBuilder.deleteFunctionOperationSettings().build(); + generateUploadUrlSettings = settingsBuilder.generateUploadUrlSettings().build(); + generateDownloadUrlSettings = settingsBuilder.generateDownloadUrlSettings().build(); + listRuntimesSettings = settingsBuilder.listRuntimesSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + } + + /** Builder for FunctionServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder getFunctionSettings; + private final PagedCallSettings.Builder< + ListFunctionsRequest, ListFunctionsResponse, ListFunctionsPagedResponse> + listFunctionsSettings; + private final UnaryCallSettings.Builder + createFunctionSettings; + private final OperationCallSettings.Builder + createFunctionOperationSettings; + private final UnaryCallSettings.Builder + updateFunctionSettings; + private final OperationCallSettings.Builder + updateFunctionOperationSettings; + private final UnaryCallSettings.Builder + deleteFunctionSettings; + private final OperationCallSettings.Builder + deleteFunctionOperationSettings; + private final UnaryCallSettings.Builder + generateUploadUrlSettings; + private final UnaryCallSettings.Builder + generateDownloadUrlSettings; + private final UnaryCallSettings.Builder + listRuntimesSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + getFunctionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listFunctionsSettings = PagedCallSettings.newBuilder(LIST_FUNCTIONS_PAGE_STR_FACT); + createFunctionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createFunctionOperationSettings = OperationCallSettings.newBuilder(); + updateFunctionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateFunctionOperationSettings = OperationCallSettings.newBuilder(); + deleteFunctionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteFunctionOperationSettings = OperationCallSettings.newBuilder(); + generateUploadUrlSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + generateDownloadUrlSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listRuntimesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getFunctionSettings, + listFunctionsSettings, + createFunctionSettings, + updateFunctionSettings, + deleteFunctionSettings, + generateUploadUrlSettings, + generateDownloadUrlSettings, + listRuntimesSettings, + listLocationsSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + initDefaults(this); + } + + protected Builder(FunctionServiceStubSettings settings) { + super(settings); + + getFunctionSettings = settings.getFunctionSettings.toBuilder(); + listFunctionsSettings = settings.listFunctionsSettings.toBuilder(); + createFunctionSettings = settings.createFunctionSettings.toBuilder(); + createFunctionOperationSettings = settings.createFunctionOperationSettings.toBuilder(); + updateFunctionSettings = settings.updateFunctionSettings.toBuilder(); + updateFunctionOperationSettings = settings.updateFunctionOperationSettings.toBuilder(); + deleteFunctionSettings = settings.deleteFunctionSettings.toBuilder(); + deleteFunctionOperationSettings = settings.deleteFunctionOperationSettings.toBuilder(); + generateUploadUrlSettings = settings.generateUploadUrlSettings.toBuilder(); + generateDownloadUrlSettings = settings.generateDownloadUrlSettings.toBuilder(); + listRuntimesSettings = settings.listRuntimesSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getFunctionSettings, + listFunctionsSettings, + createFunctionSettings, + updateFunctionSettings, + deleteFunctionSettings, + generateUploadUrlSettings, + generateDownloadUrlSettings, + listRuntimesSettings, + listLocationsSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .getFunctionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listFunctionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .createFunctionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .updateFunctionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteFunctionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .generateUploadUrlSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .generateDownloadUrlSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listRuntimesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .createFunctionOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Function.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .updateFunctionOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Function.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .deleteFunctionOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to getFunction. */ + public UnaryCallSettings.Builder getFunctionSettings() { + return getFunctionSettings; + } + + /** Returns the builder for the settings used for calls to listFunctions. */ + public PagedCallSettings.Builder< + ListFunctionsRequest, ListFunctionsResponse, ListFunctionsPagedResponse> + listFunctionsSettings() { + return listFunctionsSettings; + } + + /** Returns the builder for the settings used for calls to createFunction. */ + public UnaryCallSettings.Builder createFunctionSettings() { + return createFunctionSettings; + } + + /** Returns the builder for the settings used for calls to createFunction. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createFunctionOperationSettings() { + return createFunctionOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateFunction. */ + public UnaryCallSettings.Builder updateFunctionSettings() { + return updateFunctionSettings; + } + + /** Returns the builder for the settings used for calls to updateFunction. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateFunctionOperationSettings() { + return updateFunctionOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteFunction. */ + public UnaryCallSettings.Builder deleteFunctionSettings() { + return deleteFunctionSettings; + } + + /** Returns the builder for the settings used for calls to deleteFunction. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteFunctionOperationSettings() { + return deleteFunctionOperationSettings; + } + + /** Returns the builder for the settings used for calls to generateUploadUrl. */ + public UnaryCallSettings.Builder + generateUploadUrlSettings() { + return generateUploadUrlSettings; + } + + /** Returns the builder for the settings used for calls to generateDownloadUrl. */ + public UnaryCallSettings.Builder + generateDownloadUrlSettings() { + return generateDownloadUrlSettings; + } + + /** Returns the builder for the settings used for calls to listRuntimes. */ + public UnaryCallSettings.Builder + listRuntimesSettings() { + return listRuntimesSettings; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @Override + public FunctionServiceStubSettings build() throws IOException { + return new FunctionServiceStubSettings(this); + } + } +} diff --git a/google-cloud-functions/src/main/java/com/google/cloud/functions/v2alpha/stub/GrpcFunctionServiceCallableFactory.java b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2alpha/stub/GrpcFunctionServiceCallableFactory.java new file mode 100644 index 00000000..179cdd98 --- /dev/null +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2alpha/stub/GrpcFunctionServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * 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.v2alpha.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the FunctionService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcFunctionServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/google-cloud-functions/src/main/java/com/google/cloud/functions/v2alpha/stub/GrpcFunctionServiceStub.java b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2alpha/stub/GrpcFunctionServiceStub.java new file mode 100644 index 00000000..c8d33c6d --- /dev/null +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2alpha/stub/GrpcFunctionServiceStub.java @@ -0,0 +1,587 @@ +/* + * 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.v2alpha.stub; + +import static com.google.cloud.functions.v2alpha.FunctionServiceClient.ListFunctionsPagedResponse; +import static com.google.cloud.functions.v2alpha.FunctionServiceClient.ListLocationsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.functions.v2alpha.CreateFunctionRequest; +import com.google.cloud.functions.v2alpha.DeleteFunctionRequest; +import com.google.cloud.functions.v2alpha.Function; +import com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest; +import com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse; +import com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest; +import com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse; +import com.google.cloud.functions.v2alpha.GetFunctionRequest; +import com.google.cloud.functions.v2alpha.ListFunctionsRequest; +import com.google.cloud.functions.v2alpha.ListFunctionsResponse; +import com.google.cloud.functions.v2alpha.ListRuntimesRequest; +import com.google.cloud.functions.v2alpha.ListRuntimesResponse; +import com.google.cloud.functions.v2alpha.OperationMetadata; +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; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the FunctionService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcFunctionServiceStub extends FunctionServiceStub { + private static final MethodDescriptor getFunctionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.functions.v2alpha.FunctionService/GetFunction") + .setRequestMarshaller(ProtoUtils.marshaller(GetFunctionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Function.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listFunctionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.functions.v2alpha.FunctionService/ListFunctions") + .setRequestMarshaller( + ProtoUtils.marshaller(ListFunctionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListFunctionsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createFunctionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.functions.v2alpha.FunctionService/CreateFunction") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateFunctionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateFunctionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.functions.v2alpha.FunctionService/UpdateFunction") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateFunctionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteFunctionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.functions.v2alpha.FunctionService/DeleteFunction") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteFunctionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + generateUploadUrlMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.functions.v2alpha.FunctionService/GenerateUploadUrl") + .setRequestMarshaller( + ProtoUtils.marshaller(GenerateUploadUrlRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(GenerateUploadUrlResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + generateDownloadUrlMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.functions.v2alpha.FunctionService/GenerateDownloadUrl") + .setRequestMarshaller( + ProtoUtils.marshaller(GenerateDownloadUrlRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(GenerateDownloadUrlResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listRuntimesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.functions.v2alpha.FunctionService/ListRuntimes") + .setRequestMarshaller(ProtoUtils.marshaller(ListRuntimesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListRuntimesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable getFunctionCallable; + private final UnaryCallable listFunctionsCallable; + private final UnaryCallable + listFunctionsPagedCallable; + private final UnaryCallable createFunctionCallable; + private final OperationCallable + createFunctionOperationCallable; + private final UnaryCallable updateFunctionCallable; + private final OperationCallable + updateFunctionOperationCallable; + private final UnaryCallable deleteFunctionCallable; + private final OperationCallable + deleteFunctionOperationCallable; + private final UnaryCallable + generateUploadUrlCallable; + private final UnaryCallable + generateDownloadUrlCallable; + private final UnaryCallable listRuntimesCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcFunctionServiceStub create(FunctionServiceStubSettings settings) + throws IOException { + return new GrpcFunctionServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcFunctionServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcFunctionServiceStub( + FunctionServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcFunctionServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcFunctionServiceStub( + FunctionServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcFunctionServiceStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcFunctionServiceStub( + FunctionServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcFunctionServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcFunctionServiceStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcFunctionServiceStub( + FunctionServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings getFunctionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getFunctionMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings listFunctionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listFunctionsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings createFunctionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createFunctionMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings updateFunctionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateFunctionMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("function.name", String.valueOf(request.getFunction().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteFunctionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteFunctionMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + generateUploadUrlTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(generateUploadUrlMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings + generateDownloadUrlTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(generateDownloadUrlMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings listRuntimesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listRuntimesMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); + + this.getFunctionCallable = + callableFactory.createUnaryCallable( + getFunctionTransportSettings, settings.getFunctionSettings(), clientContext); + this.listFunctionsCallable = + callableFactory.createUnaryCallable( + listFunctionsTransportSettings, settings.listFunctionsSettings(), clientContext); + this.listFunctionsPagedCallable = + callableFactory.createPagedCallable( + listFunctionsTransportSettings, settings.listFunctionsSettings(), clientContext); + this.createFunctionCallable = + callableFactory.createUnaryCallable( + createFunctionTransportSettings, settings.createFunctionSettings(), clientContext); + this.createFunctionOperationCallable = + callableFactory.createOperationCallable( + createFunctionTransportSettings, + settings.createFunctionOperationSettings(), + clientContext, + operationsStub); + this.updateFunctionCallable = + callableFactory.createUnaryCallable( + updateFunctionTransportSettings, settings.updateFunctionSettings(), clientContext); + this.updateFunctionOperationCallable = + callableFactory.createOperationCallable( + updateFunctionTransportSettings, + settings.updateFunctionOperationSettings(), + clientContext, + operationsStub); + this.deleteFunctionCallable = + callableFactory.createUnaryCallable( + deleteFunctionTransportSettings, settings.deleteFunctionSettings(), clientContext); + this.deleteFunctionOperationCallable = + callableFactory.createOperationCallable( + deleteFunctionTransportSettings, + settings.deleteFunctionOperationSettings(), + clientContext, + operationsStub); + this.generateUploadUrlCallable = + callableFactory.createUnaryCallable( + generateUploadUrlTransportSettings, + settings.generateUploadUrlSettings(), + clientContext); + this.generateDownloadUrlCallable = + callableFactory.createUnaryCallable( + generateDownloadUrlTransportSettings, + settings.generateDownloadUrlSettings(), + clientContext); + this.listRuntimesCallable = + callableFactory.createUnaryCallable( + listRuntimesTransportSettings, settings.listRuntimesSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable getFunctionCallable() { + return getFunctionCallable; + } + + @Override + public UnaryCallable listFunctionsCallable() { + return listFunctionsCallable; + } + + @Override + public UnaryCallable + listFunctionsPagedCallable() { + return listFunctionsPagedCallable; + } + + @Override + public UnaryCallable createFunctionCallable() { + return createFunctionCallable; + } + + @Override + public OperationCallable + createFunctionOperationCallable() { + return createFunctionOperationCallable; + } + + @Override + public UnaryCallable updateFunctionCallable() { + return updateFunctionCallable; + } + + @Override + public OperationCallable + updateFunctionOperationCallable() { + return updateFunctionOperationCallable; + } + + @Override + public UnaryCallable deleteFunctionCallable() { + return deleteFunctionCallable; + } + + @Override + public OperationCallable + deleteFunctionOperationCallable() { + return deleteFunctionOperationCallable; + } + + @Override + public UnaryCallable + generateUploadUrlCallable() { + return generateUploadUrlCallable; + } + + @Override + public UnaryCallable + generateDownloadUrlCallable() { + return generateDownloadUrlCallable; + } + + @Override + public UnaryCallable listRuntimesCallable() { + return listRuntimesCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-functions/src/main/java/com/google/cloud/functions/v2alpha/stub/HttpJsonFunctionServiceCallableFactory.java b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2alpha/stub/HttpJsonFunctionServiceCallableFactory.java new file mode 100644 index 00000000..808627c5 --- /dev/null +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2alpha/stub/HttpJsonFunctionServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v2alpha.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the FunctionService service API. + * + *

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

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonFunctionServiceStub extends FunctionServiceStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(Empty.getDescriptor()) + .add(Function.getDescriptor()) + .add(OperationMetadata.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + getFunctionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.functions.v2alpha.FunctionService/GetFunction") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2alpha/{name=projects/*/locations/*/functions/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Function.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listFunctionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.functions.v2alpha.FunctionService/ListFunctions") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2alpha/{parent=projects/*/locations/*}/functions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListFunctionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createFunctionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.functions.v2alpha.FunctionService/CreateFunction") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2alpha/{parent=projects/*/locations/*}/functions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "functionId", request.getFunctionId()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("function", request.getFunction())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateFunctionRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updateFunctionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.functions.v2alpha.FunctionService/UpdateFunction") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2alpha/{function.name=projects/*/locations/*/functions/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "function.name", request.getFunction().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("function", request.getFunction())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdateFunctionRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deleteFunctionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.functions.v2alpha.FunctionService/DeleteFunction") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2alpha/{name=projects/*/locations/*/functions/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteFunctionRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + generateUploadUrlMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.functions.v2alpha.FunctionService/GenerateUploadUrl") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2alpha/{parent=projects/*/locations/*}/functions:generateUploadUrl", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(GenerateUploadUrlResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + generateDownloadUrlMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.functions.v2alpha.FunctionService/GenerateDownloadUrl") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2alpha/{name=projects/*/locations/*/functions/*}:generateDownloadUrl", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(GenerateDownloadUrlResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listRuntimesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.functions.v2alpha.FunctionService/ListRuntimes") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2alpha/{parent=projects/*/locations/*}/runtimes", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListRuntimesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2alpha/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + setIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2alpha/{resource=projects/*/locations/*/functions/*}:setIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2alpha/{resource=projects/*/locations/*/functions/*}:getIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + testIamPermissionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2alpha/{resource=projects/*/locations/*/functions/*}:testIamPermissions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(TestIamPermissionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable getFunctionCallable; + private final UnaryCallable listFunctionsCallable; + private final UnaryCallable + listFunctionsPagedCallable; + private final UnaryCallable createFunctionCallable; + private final OperationCallable + createFunctionOperationCallable; + private final UnaryCallable updateFunctionCallable; + private final OperationCallable + updateFunctionOperationCallable; + private final UnaryCallable deleteFunctionCallable; + private final OperationCallable + deleteFunctionOperationCallable; + private final UnaryCallable + generateUploadUrlCallable; + private final UnaryCallable + generateDownloadUrlCallable; + private final UnaryCallable listRuntimesCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonFunctionServiceStub create(FunctionServiceStubSettings settings) + throws IOException { + return new HttpJsonFunctionServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonFunctionServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonFunctionServiceStub( + FunctionServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonFunctionServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonFunctionServiceStub( + FunctionServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonFunctionServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected HttpJsonFunctionServiceStub( + FunctionServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonFunctionServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonFunctionServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected HttpJsonFunctionServiceStub( + FunctionServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry); + + HttpJsonCallSettings getFunctionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getFunctionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listFunctionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listFunctionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings createFunctionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createFunctionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateFunctionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateFunctionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteFunctionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteFunctionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + generateUploadUrlTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(generateUploadUrlMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + generateDownloadUrlTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(generateDownloadUrlMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings listRuntimesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listRuntimesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings setIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + testIamPermissionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.getFunctionCallable = + callableFactory.createUnaryCallable( + getFunctionTransportSettings, settings.getFunctionSettings(), clientContext); + this.listFunctionsCallable = + callableFactory.createUnaryCallable( + listFunctionsTransportSettings, settings.listFunctionsSettings(), clientContext); + this.listFunctionsPagedCallable = + callableFactory.createPagedCallable( + listFunctionsTransportSettings, settings.listFunctionsSettings(), clientContext); + this.createFunctionCallable = + callableFactory.createUnaryCallable( + createFunctionTransportSettings, settings.createFunctionSettings(), clientContext); + this.createFunctionOperationCallable = + callableFactory.createOperationCallable( + createFunctionTransportSettings, + settings.createFunctionOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updateFunctionCallable = + callableFactory.createUnaryCallable( + updateFunctionTransportSettings, settings.updateFunctionSettings(), clientContext); + this.updateFunctionOperationCallable = + callableFactory.createOperationCallable( + updateFunctionTransportSettings, + settings.updateFunctionOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deleteFunctionCallable = + callableFactory.createUnaryCallable( + deleteFunctionTransportSettings, settings.deleteFunctionSettings(), clientContext); + this.deleteFunctionOperationCallable = + callableFactory.createOperationCallable( + deleteFunctionTransportSettings, + settings.deleteFunctionOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.generateUploadUrlCallable = + callableFactory.createUnaryCallable( + generateUploadUrlTransportSettings, + settings.generateUploadUrlSettings(), + clientContext); + this.generateDownloadUrlCallable = + callableFactory.createUnaryCallable( + generateDownloadUrlTransportSettings, + settings.generateDownloadUrlSettings(), + clientContext); + this.listRuntimesCallable = + callableFactory.createUnaryCallable( + listRuntimesTransportSettings, settings.listRuntimesSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(getFunctionMethodDescriptor); + methodDescriptors.add(listFunctionsMethodDescriptor); + methodDescriptors.add(createFunctionMethodDescriptor); + methodDescriptors.add(updateFunctionMethodDescriptor); + methodDescriptors.add(deleteFunctionMethodDescriptor); + methodDescriptors.add(generateUploadUrlMethodDescriptor); + methodDescriptors.add(generateDownloadUrlMethodDescriptor); + methodDescriptors.add(listRuntimesMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(setIamPolicyMethodDescriptor); + methodDescriptors.add(getIamPolicyMethodDescriptor); + methodDescriptors.add(testIamPermissionsMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable getFunctionCallable() { + return getFunctionCallable; + } + + @Override + public UnaryCallable listFunctionsCallable() { + return listFunctionsCallable; + } + + @Override + public UnaryCallable + listFunctionsPagedCallable() { + return listFunctionsPagedCallable; + } + + @Override + public UnaryCallable createFunctionCallable() { + return createFunctionCallable; + } + + @Override + public OperationCallable + createFunctionOperationCallable() { + return createFunctionOperationCallable; + } + + @Override + public UnaryCallable updateFunctionCallable() { + return updateFunctionCallable; + } + + @Override + public OperationCallable + updateFunctionOperationCallable() { + return updateFunctionOperationCallable; + } + + @Override + public UnaryCallable deleteFunctionCallable() { + return deleteFunctionCallable; + } + + @Override + public OperationCallable + deleteFunctionOperationCallable() { + return deleteFunctionOperationCallable; + } + + @Override + public UnaryCallable + generateUploadUrlCallable() { + return generateUploadUrlCallable; + } + + @Override + public UnaryCallable + generateDownloadUrlCallable() { + return generateDownloadUrlCallable; + } + + @Override + public UnaryCallable listRuntimesCallable() { + return listRuntimesCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-functions/src/main/java/com/google/cloud/functions/v2beta/FunctionServiceClient.java b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2beta/FunctionServiceClient.java new file mode 100644 index 00000000..dc8cc17d --- /dev/null +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2beta/FunctionServiceClient.java @@ -0,0 +1,1583 @@ +/* + * 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.v2beta; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.httpjson.longrunning.OperationsClient; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.functions.v2beta.stub.FunctionServiceStub; +import com.google.cloud.functions.v2beta.stub.FunctionServiceStubSettings; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Google Cloud Functions is used to deploy functions that are executed by + * Google in response to various events. Data connected with that event is passed to a function as + * the input data. + * + *

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

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

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

Note: close() needs to be called on the FunctionServiceClient object to clean up resources + * such as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

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

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

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

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

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

To customize credentials: + * + *

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

To customize the endpoint: + * + *

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

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

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

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class FunctionServiceClient implements BackgroundResource { + private final FunctionServiceSettings settings; + private final FunctionServiceStub stub; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; + + /** Constructs an instance of FunctionServiceClient with default settings. */ + public static final FunctionServiceClient create() throws IOException { + return create(FunctionServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of FunctionServiceClient, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. + */ + public static final FunctionServiceClient create(FunctionServiceSettings settings) + throws IOException { + return new FunctionServiceClient(settings); + } + + /** + * Constructs an instance of FunctionServiceClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(FunctionServiceSettings). + */ + public static final FunctionServiceClient create(FunctionServiceStub stub) { + return new FunctionServiceClient(stub); + } + + /** + * Constructs an instance of FunctionServiceClient, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected FunctionServiceClient(FunctionServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((FunctionServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + protected FunctionServiceClient(FunctionServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + public final FunctionServiceSettings getSettings() { + return settings; + } + + public FunctionServiceStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final com.google.longrunning.OperationsClient getOperationsClient() { + return operationsClient; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a function with the given name from the requested project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   FunctionName name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]");
+   *   Function response = functionServiceClient.getFunction(name);
+   * }
+   * }
+ * + * @param name Required. The name of the function which details should be obtained. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Function getFunction(FunctionName name) { + GetFunctionRequest request = + GetFunctionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getFunction(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a function with the given name from the requested project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   String name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString();
+   *   Function response = functionServiceClient.getFunction(name);
+   * }
+   * }
+ * + * @param name Required. The name of the function which details should be obtained. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Function getFunction(String name) { + GetFunctionRequest request = GetFunctionRequest.newBuilder().setName(name).build(); + return getFunction(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a function with the given name from the requested project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   GetFunctionRequest request =
+   *       GetFunctionRequest.newBuilder()
+   *           .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
+   *           .build();
+   *   Function response = functionServiceClient.getFunction(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Function getFunction(GetFunctionRequest request) { + return getFunctionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a function with the given name from the requested project. + * + *

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Function element : functionServiceClient.listFunctions(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The project and location from which the function should be listed, + * specified in the format `projects/*/locations/*` If you want to list functions in + * all locations, use "-" in place of a location. When listing functions in all locations, if + * one or more location(s) are unreachable, the response will contain functions from all + * reachable locations along with the names of any unreachable locations. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListFunctionsPagedResponse listFunctions(LocationName parent) { + ListFunctionsRequest request = + ListFunctionsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listFunctions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a list of functions that belong to the requested project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (Function element : functionServiceClient.listFunctions(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The project and location from which the function should be listed, + * specified in the format `projects/*/locations/*` If you want to list functions in + * all locations, use "-" in place of a location. When listing functions in all locations, if + * one or more location(s) are unreachable, the response will contain functions from all + * reachable locations along with the names of any unreachable locations. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListFunctionsPagedResponse listFunctions(String parent) { + ListFunctionsRequest request = ListFunctionsRequest.newBuilder().setParent(parent).build(); + return listFunctions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a list of functions that belong to the requested project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   ListFunctionsRequest request =
+   *       ListFunctionsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (Function element : functionServiceClient.listFunctions(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListFunctionsPagedResponse listFunctions(ListFunctionsRequest request) { + return listFunctionsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a list of functions that belong to the requested project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   ListFunctionsRequest request =
+   *       ListFunctionsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       functionServiceClient.listFunctionsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Function element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listFunctionsPagedCallable() { + return stub.listFunctionsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a list of functions that belong to the requested project. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   ListFunctionsRequest request =
+   *       ListFunctionsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   while (true) {
+   *     ListFunctionsResponse response =
+   *         functionServiceClient.listFunctionsCallable().call(request);
+   *     for (Function element : response.getFunctionsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listFunctionsCallable() { + return stub.listFunctionsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new function. If a function with the given name already exists in the specified + * project, the long running operation will return `ALREADY_EXISTS` error. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Function function = Function.newBuilder().build();
+   *   String functionId = "functionId-62789869";
+   *   Function response =
+   *       functionServiceClient.createFunctionAsync(parent, function, functionId).get();
+   * }
+   * }
+ * + * @param parent Required. The project and location in which the function should be created, + * specified in the format `projects/*/locations/*` + * @param function Required. Function to be created. + * @param functionId The ID to use for the function, which will become the final component of the + * function's resource name. + *

This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createFunctionAsync( + LocationName parent, Function function, String functionId) { + CreateFunctionRequest request = + CreateFunctionRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setFunction(function) + .setFunctionId(functionId) + .build(); + return createFunctionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new function. If a function with the given name already exists in the specified + * project, the long running operation will return `ALREADY_EXISTS` error. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   Function function = Function.newBuilder().build();
+   *   String functionId = "functionId-62789869";
+   *   Function response =
+   *       functionServiceClient.createFunctionAsync(parent, function, functionId).get();
+   * }
+   * }
+ * + * @param parent Required. The project and location in which the function should be created, + * specified in the format `projects/*/locations/*` + * @param function Required. Function to be created. + * @param functionId The ID to use for the function, which will become the final component of the + * function's resource name. + *

This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createFunctionAsync( + String parent, Function function, String functionId) { + CreateFunctionRequest request = + CreateFunctionRequest.newBuilder() + .setParent(parent) + .setFunction(function) + .setFunctionId(functionId) + .build(); + return createFunctionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new function. If a function with the given name already exists in the specified + * project, the long running operation will return `ALREADY_EXISTS` error. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   CreateFunctionRequest request =
+   *       CreateFunctionRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setFunction(Function.newBuilder().build())
+   *           .setFunctionId("functionId-62789869")
+   *           .build();
+   *   Function response = functionServiceClient.createFunctionAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createFunctionAsync( + CreateFunctionRequest request) { + return createFunctionOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new function. If a function with the given name already exists in the specified + * project, the long running operation will return `ALREADY_EXISTS` error. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   CreateFunctionRequest request =
+   *       CreateFunctionRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setFunction(Function.newBuilder().build())
+   *           .setFunctionId("functionId-62789869")
+   *           .build();
+   *   OperationFuture future =
+   *       functionServiceClient.createFunctionOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Function response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createFunctionOperationCallable() { + return stub.createFunctionOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new function. If a function with the given name already exists in the specified + * project, the long running operation will return `ALREADY_EXISTS` error. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   CreateFunctionRequest request =
+   *       CreateFunctionRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setFunction(Function.newBuilder().build())
+   *           .setFunctionId("functionId-62789869")
+   *           .build();
+   *   ApiFuture future =
+   *       functionServiceClient.createFunctionCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createFunctionCallable() { + return stub.createFunctionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates existing function. + * + *

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   UpdateFunctionRequest request =
+   *       UpdateFunctionRequest.newBuilder()
+   *           .setFunction(Function.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Function response = functionServiceClient.updateFunctionAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateFunctionAsync( + UpdateFunctionRequest request) { + return updateFunctionOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates existing function. + * + *

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   UpdateFunctionRequest request =
+   *       UpdateFunctionRequest.newBuilder()
+   *           .setFunction(Function.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       functionServiceClient.updateFunctionCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateFunctionCallable() { + return stub.updateFunctionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a function with the given name from the specified project. If the given function is + * used by some trigger, the trigger will be updated to remove this function. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   FunctionName name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]");
+   *   functionServiceClient.deleteFunctionAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the function which should be deleted. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteFunctionAsync(FunctionName name) { + DeleteFunctionRequest request = + DeleteFunctionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteFunctionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a function with the given name from the specified project. If the given function is + * used by some trigger, the trigger will be updated to remove this function. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   String name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString();
+   *   functionServiceClient.deleteFunctionAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the function which should be deleted. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteFunctionAsync(String name) { + DeleteFunctionRequest request = DeleteFunctionRequest.newBuilder().setName(name).build(); + return deleteFunctionAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a function with the given name from the specified project. If the given function is + * used by some trigger, the trigger will be updated to remove this function. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   DeleteFunctionRequest request =
+   *       DeleteFunctionRequest.newBuilder()
+   *           .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
+   *           .build();
+   *   functionServiceClient.deleteFunctionAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteFunctionAsync( + DeleteFunctionRequest request) { + return deleteFunctionOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a function with the given name from the specified project. If the given function is + * used by some trigger, the trigger will be updated to remove this function. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   DeleteFunctionRequest request =
+   *       DeleteFunctionRequest.newBuilder()
+   *           .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
+   *           .build();
+   *   OperationFuture future =
+   *       functionServiceClient.deleteFunctionOperationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteFunctionOperationCallable() { + return stub.deleteFunctionOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a function with the given name from the specified project. If the given function is + * used by some trigger, the trigger will be updated to remove this function. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   DeleteFunctionRequest request =
+   *       DeleteFunctionRequest.newBuilder()
+   *           .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       functionServiceClient.deleteFunctionCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteFunctionCallable() { + return stub.deleteFunctionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a signed URL for uploading a function source code. For more information about the + * signed URL usage see: https://cloud.google.com/storage/docs/access-control/signed-urls. Once + * the function source code upload is complete, the used signed URL should be provided in + * CreateFunction or UpdateFunction request as a reference to the function source code. + * + *

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

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

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

    + *
  • `content-type: application/zip` + *
+ * + *

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

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   GenerateUploadUrlRequest request =
+   *       GenerateUploadUrlRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .build();
+   *   GenerateUploadUrlResponse response = functionServiceClient.generateUploadUrl(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final GenerateUploadUrlResponse generateUploadUrl(GenerateUploadUrlRequest request) { + return generateUploadUrlCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a signed URL for uploading a function source code. For more information about the + * signed URL usage see: https://cloud.google.com/storage/docs/access-control/signed-urls. Once + * the function source code upload is complete, the used signed URL should be provided in + * CreateFunction or UpdateFunction request as a reference to the function source code. + * + *

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

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

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

    + *
  • `content-type: application/zip` + *
+ * + *

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

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   GenerateUploadUrlRequest request =
+   *       GenerateUploadUrlRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       functionServiceClient.generateUploadUrlCallable().futureCall(request);
+   *   // Do something.
+   *   GenerateUploadUrlResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + generateUploadUrlCallable() { + return stub.generateUploadUrlCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a signed URL for downloading deployed function source code. The URL is only valid for a + * limited period and should be used within 30 minutes of generation. For more information about + * the signed URL usage see: https://cloud.google.com/storage/docs/access-control/signed-urls + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   GenerateDownloadUrlRequest request =
+   *       GenerateDownloadUrlRequest.newBuilder()
+   *           .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
+   *           .build();
+   *   GenerateDownloadUrlResponse response = functionServiceClient.generateDownloadUrl(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final GenerateDownloadUrlResponse generateDownloadUrl(GenerateDownloadUrlRequest request) { + return generateDownloadUrlCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a signed URL for downloading deployed function source code. The URL is only valid for a + * limited period and should be used within 30 minutes of generation. For more information about + * the signed URL usage see: https://cloud.google.com/storage/docs/access-control/signed-urls + * + *

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   ListRuntimesRequest request =
+   *       ListRuntimesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   ListRuntimesResponse response = functionServiceClient.listRuntimes(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListRuntimesResponse listRuntimes(ListRuntimesRequest request) { + return listRuntimesCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a list of runtimes that are supported for the requested project. + * + *

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : functionServiceClient.listLocations(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

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

Sample code: + * + *

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

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Policy response = functionServiceClient.setIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replacesany existing policy. + * + *

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

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   Policy response = functionServiceClient.getIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policyif the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *

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

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   TestIamPermissionsResponse response = functionServiceClient.testIamPermissions(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If theresource does not exist, + * this will return an empty set ofpermissions, not a `NOT_FOUND` error. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       functionServiceClient.testIamPermissionsCallable().futureCall(request);
+   *   // Do something.
+   *   TestIamPermissionsResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListFunctionsPagedResponse + extends AbstractPagedListResponse< + ListFunctionsRequest, + ListFunctionsResponse, + Function, + ListFunctionsPage, + ListFunctionsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListFunctionsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListFunctionsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListFunctionsPagedResponse(ListFunctionsPage page) { + super(page, ListFunctionsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListFunctionsPage + extends AbstractPage< + ListFunctionsRequest, ListFunctionsResponse, Function, ListFunctionsPage> { + + private ListFunctionsPage( + PageContext context, + ListFunctionsResponse response) { + super(context, response); + } + + private static ListFunctionsPage createEmptyPage() { + return new ListFunctionsPage(null, null); + } + + @Override + protected ListFunctionsPage createPage( + PageContext context, + ListFunctionsResponse response) { + return new ListFunctionsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListFunctionsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListFunctionsRequest, + ListFunctionsResponse, + Function, + ListFunctionsPage, + ListFunctionsFixedSizeCollection> { + + private ListFunctionsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListFunctionsFixedSizeCollection createEmptyCollection() { + return new ListFunctionsFixedSizeCollection(null, 0); + } + + @Override + protected ListFunctionsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListFunctionsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-functions/src/main/java/com/google/cloud/functions/v2beta/FunctionServiceSettings.java b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2beta/FunctionServiceSettings.java new file mode 100644 index 00000000..0a20e92f --- /dev/null +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2beta/FunctionServiceSettings.java @@ -0,0 +1,377 @@ +/* + * 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.v2beta; + +import static com.google.cloud.functions.v2beta.FunctionServiceClient.ListFunctionsPagedResponse; +import static com.google.cloud.functions.v2beta.FunctionServiceClient.ListLocationsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.functions.v2beta.stub.FunctionServiceStubSettings; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link FunctionServiceClient}. + * + *

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

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

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

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

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * FunctionServiceSettings.Builder functionServiceSettingsBuilder =
+ *     FunctionServiceSettings.newBuilder();
+ * functionServiceSettingsBuilder
+ *     .getFunctionSettings()
+ *     .setRetrySettings(
+ *         functionServiceSettingsBuilder
+ *             .getFunctionSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * FunctionServiceSettings functionServiceSettings = functionServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class FunctionServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to getFunction. */ + public UnaryCallSettings getFunctionSettings() { + return ((FunctionServiceStubSettings) getStubSettings()).getFunctionSettings(); + } + + /** Returns the object with the settings used for calls to listFunctions. */ + public PagedCallSettings + listFunctionsSettings() { + return ((FunctionServiceStubSettings) getStubSettings()).listFunctionsSettings(); + } + + /** Returns the object with the settings used for calls to createFunction. */ + public UnaryCallSettings createFunctionSettings() { + return ((FunctionServiceStubSettings) getStubSettings()).createFunctionSettings(); + } + + /** Returns the object with the settings used for calls to createFunction. */ + public OperationCallSettings + createFunctionOperationSettings() { + return ((FunctionServiceStubSettings) getStubSettings()).createFunctionOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateFunction. */ + public UnaryCallSettings updateFunctionSettings() { + return ((FunctionServiceStubSettings) getStubSettings()).updateFunctionSettings(); + } + + /** Returns the object with the settings used for calls to updateFunction. */ + public OperationCallSettings + updateFunctionOperationSettings() { + return ((FunctionServiceStubSettings) getStubSettings()).updateFunctionOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteFunction. */ + public UnaryCallSettings deleteFunctionSettings() { + return ((FunctionServiceStubSettings) getStubSettings()).deleteFunctionSettings(); + } + + /** Returns the object with the settings used for calls to deleteFunction. */ + public OperationCallSettings + deleteFunctionOperationSettings() { + return ((FunctionServiceStubSettings) getStubSettings()).deleteFunctionOperationSettings(); + } + + /** Returns the object with the settings used for calls to generateUploadUrl. */ + public UnaryCallSettings + generateUploadUrlSettings() { + return ((FunctionServiceStubSettings) getStubSettings()).generateUploadUrlSettings(); + } + + /** Returns the object with the settings used for calls to generateDownloadUrl. */ + public UnaryCallSettings + generateDownloadUrlSettings() { + return ((FunctionServiceStubSettings) getStubSettings()).generateDownloadUrlSettings(); + } + + /** Returns the object with the settings used for calls to listRuntimes. */ + public UnaryCallSettings listRuntimesSettings() { + return ((FunctionServiceStubSettings) getStubSettings()).listRuntimesSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((FunctionServiceStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((FunctionServiceStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((FunctionServiceStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((FunctionServiceStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + public static final FunctionServiceSettings create(FunctionServiceStubSettings stub) + throws IOException { + return new FunctionServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return FunctionServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return FunctionServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return FunctionServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return FunctionServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return FunctionServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return FunctionServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return FunctionServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return FunctionServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected FunctionServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for FunctionServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(FunctionServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(FunctionServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(FunctionServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(FunctionServiceStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(FunctionServiceStubSettings.newHttpJsonBuilder()); + } + + public FunctionServiceStubSettings.Builder getStubSettingsBuilder() { + return ((FunctionServiceStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to getFunction. */ + public UnaryCallSettings.Builder getFunctionSettings() { + return getStubSettingsBuilder().getFunctionSettings(); + } + + /** Returns the builder for the settings used for calls to listFunctions. */ + public PagedCallSettings.Builder< + ListFunctionsRequest, ListFunctionsResponse, ListFunctionsPagedResponse> + listFunctionsSettings() { + return getStubSettingsBuilder().listFunctionsSettings(); + } + + /** Returns the builder for the settings used for calls to createFunction. */ + public UnaryCallSettings.Builder createFunctionSettings() { + return getStubSettingsBuilder().createFunctionSettings(); + } + + /** Returns the builder for the settings used for calls to createFunction. */ + public OperationCallSettings.Builder + createFunctionOperationSettings() { + return getStubSettingsBuilder().createFunctionOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateFunction. */ + public UnaryCallSettings.Builder updateFunctionSettings() { + return getStubSettingsBuilder().updateFunctionSettings(); + } + + /** Returns the builder for the settings used for calls to updateFunction. */ + public OperationCallSettings.Builder + updateFunctionOperationSettings() { + return getStubSettingsBuilder().updateFunctionOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteFunction. */ + public UnaryCallSettings.Builder deleteFunctionSettings() { + return getStubSettingsBuilder().deleteFunctionSettings(); + } + + /** Returns the builder for the settings used for calls to deleteFunction. */ + public OperationCallSettings.Builder + deleteFunctionOperationSettings() { + return getStubSettingsBuilder().deleteFunctionOperationSettings(); + } + + /** Returns the builder for the settings used for calls to generateUploadUrl. */ + public UnaryCallSettings.Builder + generateUploadUrlSettings() { + return getStubSettingsBuilder().generateUploadUrlSettings(); + } + + /** Returns the builder for the settings used for calls to generateDownloadUrl. */ + public UnaryCallSettings.Builder + generateDownloadUrlSettings() { + return getStubSettingsBuilder().generateDownloadUrlSettings(); + } + + /** Returns the builder for the settings used for calls to listRuntimes. */ + public UnaryCallSettings.Builder + listRuntimesSettings() { + return getStubSettingsBuilder().listRuntimesSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + @Override + public FunctionServiceSettings build() throws IOException { + return new FunctionServiceSettings(this); + } + } +} diff --git a/google-cloud-functions/src/main/java/com/google/cloud/functions/v2beta/gapic_metadata.json b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2beta/gapic_metadata.json new file mode 100644 index 00000000..1dd3c3aa --- /dev/null +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2beta/gapic_metadata.json @@ -0,0 +1,54 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.functions.v2beta", + "libraryPackage": "com.google.cloud.functions.v2beta", + "services": { + "FunctionService": { + "clients": { + "grpc": { + "libraryClient": "FunctionServiceClient", + "rpcs": { + "CreateFunction": { + "methods": ["createFunctionAsync", "createFunctionAsync", "createFunctionAsync", "createFunctionOperationCallable", "createFunctionCallable"] + }, + "DeleteFunction": { + "methods": ["deleteFunctionAsync", "deleteFunctionAsync", "deleteFunctionAsync", "deleteFunctionOperationCallable", "deleteFunctionCallable"] + }, + "GenerateDownloadUrl": { + "methods": ["generateDownloadUrl", "generateDownloadUrlCallable"] + }, + "GenerateUploadUrl": { + "methods": ["generateUploadUrl", "generateUploadUrlCallable"] + }, + "GetFunction": { + "methods": ["getFunction", "getFunction", "getFunction", "getFunctionCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicyCallable"] + }, + "ListFunctions": { + "methods": ["listFunctions", "listFunctions", "listFunctions", "listFunctionsPagedCallable", "listFunctionsCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "ListRuntimes": { + "methods": ["listRuntimes", "listRuntimes", "listRuntimes", "listRuntimesCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] + }, + "UpdateFunction": { + "methods": ["updateFunctionAsync", "updateFunctionAsync", "updateFunctionOperationCallable", "updateFunctionCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/google-cloud-functions/src/main/java/com/google/cloud/functions/v2beta/package-info.java b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2beta/package-info.java new file mode 100644 index 00000000..0513e119 --- /dev/null +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2beta/package-info.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * A client to Cloud Functions API + * + *

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

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

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

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

Sample for FunctionServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (FunctionServiceClient functionServiceClient = FunctionServiceClient.create()) {
+ *   FunctionName name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]");
+ *   Function response = functionServiceClient.getFunction(name);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.functions.v2beta; + +import javax.annotation.Generated; diff --git a/google-cloud-functions/src/main/java/com/google/cloud/functions/v2beta/stub/FunctionServiceStub.java b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2beta/stub/FunctionServiceStub.java new file mode 100644 index 00000000..bc517415 --- /dev/null +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2beta/stub/FunctionServiceStub.java @@ -0,0 +1,148 @@ +/* + * 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.v2beta.stub; + +import static com.google.cloud.functions.v2beta.FunctionServiceClient.ListFunctionsPagedResponse; +import static com.google.cloud.functions.v2beta.FunctionServiceClient.ListLocationsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.functions.v2beta.CreateFunctionRequest; +import com.google.cloud.functions.v2beta.DeleteFunctionRequest; +import com.google.cloud.functions.v2beta.Function; +import com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest; +import com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse; +import com.google.cloud.functions.v2beta.GenerateUploadUrlRequest; +import com.google.cloud.functions.v2beta.GenerateUploadUrlResponse; +import com.google.cloud.functions.v2beta.GetFunctionRequest; +import com.google.cloud.functions.v2beta.ListFunctionsRequest; +import com.google.cloud.functions.v2beta.ListFunctionsResponse; +import com.google.cloud.functions.v2beta.ListRuntimesRequest; +import com.google.cloud.functions.v2beta.ListRuntimesResponse; +import com.google.cloud.functions.v2beta.OperationMetadata; +import com.google.cloud.functions.v2beta.UpdateFunctionRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the FunctionService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class FunctionServiceStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; + } + + public UnaryCallable getFunctionCallable() { + throw new UnsupportedOperationException("Not implemented: getFunctionCallable()"); + } + + public UnaryCallable + listFunctionsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listFunctionsPagedCallable()"); + } + + public UnaryCallable listFunctionsCallable() { + throw new UnsupportedOperationException("Not implemented: listFunctionsCallable()"); + } + + public OperationCallable + createFunctionOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createFunctionOperationCallable()"); + } + + public UnaryCallable createFunctionCallable() { + throw new UnsupportedOperationException("Not implemented: createFunctionCallable()"); + } + + public OperationCallable + updateFunctionOperationCallable() { + throw new UnsupportedOperationException("Not implemented: updateFunctionOperationCallable()"); + } + + public UnaryCallable updateFunctionCallable() { + throw new UnsupportedOperationException("Not implemented: updateFunctionCallable()"); + } + + public OperationCallable + deleteFunctionOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteFunctionOperationCallable()"); + } + + public UnaryCallable deleteFunctionCallable() { + throw new UnsupportedOperationException("Not implemented: deleteFunctionCallable()"); + } + + public UnaryCallable + generateUploadUrlCallable() { + throw new UnsupportedOperationException("Not implemented: generateUploadUrlCallable()"); + } + + public UnaryCallable + generateDownloadUrlCallable() { + throw new UnsupportedOperationException("Not implemented: generateDownloadUrlCallable()"); + } + + public UnaryCallable listRuntimesCallable() { + throw new UnsupportedOperationException("Not implemented: listRuntimesCallable()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-functions/src/main/java/com/google/cloud/functions/v2beta/stub/FunctionServiceStubSettings.java b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2beta/stub/FunctionServiceStubSettings.java new file mode 100644 index 00000000..838580f6 --- /dev/null +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2beta/stub/FunctionServiceStubSettings.java @@ -0,0 +1,865 @@ +/* + * 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.v2beta.stub; + +import static com.google.cloud.functions.v2beta.FunctionServiceClient.ListFunctionsPagedResponse; +import static com.google.cloud.functions.v2beta.FunctionServiceClient.ListLocationsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.functions.v2beta.CreateFunctionRequest; +import com.google.cloud.functions.v2beta.DeleteFunctionRequest; +import com.google.cloud.functions.v2beta.Function; +import com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest; +import com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse; +import com.google.cloud.functions.v2beta.GenerateUploadUrlRequest; +import com.google.cloud.functions.v2beta.GenerateUploadUrlResponse; +import com.google.cloud.functions.v2beta.GetFunctionRequest; +import com.google.cloud.functions.v2beta.ListFunctionsRequest; +import com.google.cloud.functions.v2beta.ListFunctionsResponse; +import com.google.cloud.functions.v2beta.ListRuntimesRequest; +import com.google.cloud.functions.v2beta.ListRuntimesResponse; +import com.google.cloud.functions.v2beta.OperationMetadata; +import com.google.cloud.functions.v2beta.UpdateFunctionRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link FunctionServiceStub}. + * + *

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

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

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

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

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * FunctionServiceStubSettings.Builder functionServiceSettingsBuilder =
+ *     FunctionServiceStubSettings.newBuilder();
+ * functionServiceSettingsBuilder
+ *     .getFunctionSettings()
+ *     .setRetrySettings(
+ *         functionServiceSettingsBuilder
+ *             .getFunctionSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * FunctionServiceStubSettings functionServiceSettings = functionServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class FunctionServiceStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final UnaryCallSettings getFunctionSettings; + private final PagedCallSettings< + ListFunctionsRequest, ListFunctionsResponse, ListFunctionsPagedResponse> + listFunctionsSettings; + private final UnaryCallSettings createFunctionSettings; + private final OperationCallSettings + createFunctionOperationSettings; + private final UnaryCallSettings updateFunctionSettings; + private final OperationCallSettings + updateFunctionOperationSettings; + private final UnaryCallSettings deleteFunctionSettings; + private final OperationCallSettings + deleteFunctionOperationSettings; + private final UnaryCallSettings + generateUploadUrlSettings; + private final UnaryCallSettings + generateDownloadUrlSettings; + private final UnaryCallSettings listRuntimesSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + private static final PagedListDescriptor + LIST_FUNCTIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListFunctionsRequest injectToken(ListFunctionsRequest payload, String token) { + return ListFunctionsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListFunctionsRequest injectPageSize(ListFunctionsRequest payload, int pageSize) { + return ListFunctionsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListFunctionsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListFunctionsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListFunctionsResponse payload) { + return payload.getFunctionsList() == null + ? ImmutableList.of() + : payload.getFunctionsList(); + } + }; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList() == null + ? ImmutableList.of() + : payload.getLocationsList(); + } + }; + + private static final PagedListResponseFactory< + ListFunctionsRequest, ListFunctionsResponse, ListFunctionsPagedResponse> + LIST_FUNCTIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListFunctionsRequest, ListFunctionsResponse, ListFunctionsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListFunctionsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_FUNCTIONS_PAGE_STR_DESC, request, context); + return ListFunctionsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to getFunction. */ + public UnaryCallSettings getFunctionSettings() { + return getFunctionSettings; + } + + /** Returns the object with the settings used for calls to listFunctions. */ + public PagedCallSettings + listFunctionsSettings() { + return listFunctionsSettings; + } + + /** Returns the object with the settings used for calls to createFunction. */ + public UnaryCallSettings createFunctionSettings() { + return createFunctionSettings; + } + + /** Returns the object with the settings used for calls to createFunction. */ + public OperationCallSettings + createFunctionOperationSettings() { + return createFunctionOperationSettings; + } + + /** Returns the object with the settings used for calls to updateFunction. */ + public UnaryCallSettings updateFunctionSettings() { + return updateFunctionSettings; + } + + /** Returns the object with the settings used for calls to updateFunction. */ + public OperationCallSettings + updateFunctionOperationSettings() { + return updateFunctionOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteFunction. */ + public UnaryCallSettings deleteFunctionSettings() { + return deleteFunctionSettings; + } + + /** Returns the object with the settings used for calls to deleteFunction. */ + public OperationCallSettings + deleteFunctionOperationSettings() { + return deleteFunctionOperationSettings; + } + + /** Returns the object with the settings used for calls to generateUploadUrl. */ + public UnaryCallSettings + generateUploadUrlSettings() { + return generateUploadUrlSettings; + } + + /** Returns the object with the settings used for calls to generateDownloadUrl. */ + public UnaryCallSettings + generateDownloadUrlSettings() { + return generateDownloadUrlSettings; + } + + /** Returns the object with the settings used for calls to listRuntimes. */ + public UnaryCallSettings listRuntimesSettings() { + return listRuntimesSettings; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + public FunctionServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcFunctionServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonFunctionServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "cloudfunctions.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "cloudfunctions.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(FunctionServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(FunctionServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return FunctionServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected FunctionServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + getFunctionSettings = settingsBuilder.getFunctionSettings().build(); + listFunctionsSettings = settingsBuilder.listFunctionsSettings().build(); + createFunctionSettings = settingsBuilder.createFunctionSettings().build(); + createFunctionOperationSettings = settingsBuilder.createFunctionOperationSettings().build(); + updateFunctionSettings = settingsBuilder.updateFunctionSettings().build(); + updateFunctionOperationSettings = settingsBuilder.updateFunctionOperationSettings().build(); + deleteFunctionSettings = settingsBuilder.deleteFunctionSettings().build(); + deleteFunctionOperationSettings = settingsBuilder.deleteFunctionOperationSettings().build(); + generateUploadUrlSettings = settingsBuilder.generateUploadUrlSettings().build(); + generateDownloadUrlSettings = settingsBuilder.generateDownloadUrlSettings().build(); + listRuntimesSettings = settingsBuilder.listRuntimesSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + } + + /** Builder for FunctionServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder getFunctionSettings; + private final PagedCallSettings.Builder< + ListFunctionsRequest, ListFunctionsResponse, ListFunctionsPagedResponse> + listFunctionsSettings; + private final UnaryCallSettings.Builder + createFunctionSettings; + private final OperationCallSettings.Builder + createFunctionOperationSettings; + private final UnaryCallSettings.Builder + updateFunctionSettings; + private final OperationCallSettings.Builder + updateFunctionOperationSettings; + private final UnaryCallSettings.Builder + deleteFunctionSettings; + private final OperationCallSettings.Builder + deleteFunctionOperationSettings; + private final UnaryCallSettings.Builder + generateUploadUrlSettings; + private final UnaryCallSettings.Builder + generateDownloadUrlSettings; + private final UnaryCallSettings.Builder + listRuntimesSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + getFunctionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listFunctionsSettings = PagedCallSettings.newBuilder(LIST_FUNCTIONS_PAGE_STR_FACT); + createFunctionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createFunctionOperationSettings = OperationCallSettings.newBuilder(); + updateFunctionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateFunctionOperationSettings = OperationCallSettings.newBuilder(); + deleteFunctionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteFunctionOperationSettings = OperationCallSettings.newBuilder(); + generateUploadUrlSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + generateDownloadUrlSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listRuntimesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getFunctionSettings, + listFunctionsSettings, + createFunctionSettings, + updateFunctionSettings, + deleteFunctionSettings, + generateUploadUrlSettings, + generateDownloadUrlSettings, + listRuntimesSettings, + listLocationsSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + initDefaults(this); + } + + protected Builder(FunctionServiceStubSettings settings) { + super(settings); + + getFunctionSettings = settings.getFunctionSettings.toBuilder(); + listFunctionsSettings = settings.listFunctionsSettings.toBuilder(); + createFunctionSettings = settings.createFunctionSettings.toBuilder(); + createFunctionOperationSettings = settings.createFunctionOperationSettings.toBuilder(); + updateFunctionSettings = settings.updateFunctionSettings.toBuilder(); + updateFunctionOperationSettings = settings.updateFunctionOperationSettings.toBuilder(); + deleteFunctionSettings = settings.deleteFunctionSettings.toBuilder(); + deleteFunctionOperationSettings = settings.deleteFunctionOperationSettings.toBuilder(); + generateUploadUrlSettings = settings.generateUploadUrlSettings.toBuilder(); + generateDownloadUrlSettings = settings.generateDownloadUrlSettings.toBuilder(); + listRuntimesSettings = settings.listRuntimesSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getFunctionSettings, + listFunctionsSettings, + createFunctionSettings, + updateFunctionSettings, + deleteFunctionSettings, + generateUploadUrlSettings, + generateDownloadUrlSettings, + listRuntimesSettings, + listLocationsSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .getFunctionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listFunctionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .createFunctionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .updateFunctionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteFunctionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .generateUploadUrlSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .generateDownloadUrlSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listRuntimesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .createFunctionOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Function.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .updateFunctionOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Function.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + builder + .deleteFunctionOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to getFunction. */ + public UnaryCallSettings.Builder getFunctionSettings() { + return getFunctionSettings; + } + + /** Returns the builder for the settings used for calls to listFunctions. */ + public PagedCallSettings.Builder< + ListFunctionsRequest, ListFunctionsResponse, ListFunctionsPagedResponse> + listFunctionsSettings() { + return listFunctionsSettings; + } + + /** Returns the builder for the settings used for calls to createFunction. */ + public UnaryCallSettings.Builder createFunctionSettings() { + return createFunctionSettings; + } + + /** Returns the builder for the settings used for calls to createFunction. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createFunctionOperationSettings() { + return createFunctionOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateFunction. */ + public UnaryCallSettings.Builder updateFunctionSettings() { + return updateFunctionSettings; + } + + /** Returns the builder for the settings used for calls to updateFunction. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateFunctionOperationSettings() { + return updateFunctionOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteFunction. */ + public UnaryCallSettings.Builder deleteFunctionSettings() { + return deleteFunctionSettings; + } + + /** Returns the builder for the settings used for calls to deleteFunction. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteFunctionOperationSettings() { + return deleteFunctionOperationSettings; + } + + /** Returns the builder for the settings used for calls to generateUploadUrl. */ + public UnaryCallSettings.Builder + generateUploadUrlSettings() { + return generateUploadUrlSettings; + } + + /** Returns the builder for the settings used for calls to generateDownloadUrl. */ + public UnaryCallSettings.Builder + generateDownloadUrlSettings() { + return generateDownloadUrlSettings; + } + + /** Returns the builder for the settings used for calls to listRuntimes. */ + public UnaryCallSettings.Builder + listRuntimesSettings() { + return listRuntimesSettings; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @Override + public FunctionServiceStubSettings build() throws IOException { + return new FunctionServiceStubSettings(this); + } + } +} diff --git a/google-cloud-functions/src/main/java/com/google/cloud/functions/v2beta/stub/GrpcFunctionServiceCallableFactory.java b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2beta/stub/GrpcFunctionServiceCallableFactory.java new file mode 100644 index 00000000..0fc17112 --- /dev/null +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2beta/stub/GrpcFunctionServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * 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.v2beta.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the FunctionService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcFunctionServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/google-cloud-functions/src/main/java/com/google/cloud/functions/v2beta/stub/GrpcFunctionServiceStub.java b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2beta/stub/GrpcFunctionServiceStub.java new file mode 100644 index 00000000..8346fe77 --- /dev/null +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2beta/stub/GrpcFunctionServiceStub.java @@ -0,0 +1,587 @@ +/* + * 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.v2beta.stub; + +import static com.google.cloud.functions.v2beta.FunctionServiceClient.ListFunctionsPagedResponse; +import static com.google.cloud.functions.v2beta.FunctionServiceClient.ListLocationsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.functions.v2beta.CreateFunctionRequest; +import com.google.cloud.functions.v2beta.DeleteFunctionRequest; +import com.google.cloud.functions.v2beta.Function; +import com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest; +import com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse; +import com.google.cloud.functions.v2beta.GenerateUploadUrlRequest; +import com.google.cloud.functions.v2beta.GenerateUploadUrlResponse; +import com.google.cloud.functions.v2beta.GetFunctionRequest; +import com.google.cloud.functions.v2beta.ListFunctionsRequest; +import com.google.cloud.functions.v2beta.ListFunctionsResponse; +import com.google.cloud.functions.v2beta.ListRuntimesRequest; +import com.google.cloud.functions.v2beta.ListRuntimesResponse; +import com.google.cloud.functions.v2beta.OperationMetadata; +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; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the FunctionService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcFunctionServiceStub extends FunctionServiceStub { + private static final MethodDescriptor getFunctionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.functions.v2beta.FunctionService/GetFunction") + .setRequestMarshaller(ProtoUtils.marshaller(GetFunctionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Function.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listFunctionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.functions.v2beta.FunctionService/ListFunctions") + .setRequestMarshaller( + ProtoUtils.marshaller(ListFunctionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListFunctionsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createFunctionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.functions.v2beta.FunctionService/CreateFunction") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateFunctionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateFunctionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.functions.v2beta.FunctionService/UpdateFunction") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateFunctionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + deleteFunctionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.functions.v2beta.FunctionService/DeleteFunction") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteFunctionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + generateUploadUrlMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.functions.v2beta.FunctionService/GenerateUploadUrl") + .setRequestMarshaller( + ProtoUtils.marshaller(GenerateUploadUrlRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(GenerateUploadUrlResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + generateDownloadUrlMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.functions.v2beta.FunctionService/GenerateDownloadUrl") + .setRequestMarshaller( + ProtoUtils.marshaller(GenerateDownloadUrlRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(GenerateDownloadUrlResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listRuntimesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.functions.v2beta.FunctionService/ListRuntimes") + .setRequestMarshaller(ProtoUtils.marshaller(ListRuntimesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListRuntimesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable getFunctionCallable; + private final UnaryCallable listFunctionsCallable; + private final UnaryCallable + listFunctionsPagedCallable; + private final UnaryCallable createFunctionCallable; + private final OperationCallable + createFunctionOperationCallable; + private final UnaryCallable updateFunctionCallable; + private final OperationCallable + updateFunctionOperationCallable; + private final UnaryCallable deleteFunctionCallable; + private final OperationCallable + deleteFunctionOperationCallable; + private final UnaryCallable + generateUploadUrlCallable; + private final UnaryCallable + generateDownloadUrlCallable; + private final UnaryCallable listRuntimesCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcFunctionServiceStub create(FunctionServiceStubSettings settings) + throws IOException { + return new GrpcFunctionServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcFunctionServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcFunctionServiceStub( + FunctionServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcFunctionServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcFunctionServiceStub( + FunctionServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcFunctionServiceStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcFunctionServiceStub( + FunctionServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcFunctionServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcFunctionServiceStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcFunctionServiceStub( + FunctionServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings getFunctionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getFunctionMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings listFunctionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listFunctionsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings createFunctionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createFunctionMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings updateFunctionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateFunctionMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("function.name", String.valueOf(request.getFunction().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteFunctionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteFunctionMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + generateUploadUrlTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(generateUploadUrlMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings + generateDownloadUrlTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(generateDownloadUrlMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings listRuntimesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listRuntimesMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + }) + .build(); + + this.getFunctionCallable = + callableFactory.createUnaryCallable( + getFunctionTransportSettings, settings.getFunctionSettings(), clientContext); + this.listFunctionsCallable = + callableFactory.createUnaryCallable( + listFunctionsTransportSettings, settings.listFunctionsSettings(), clientContext); + this.listFunctionsPagedCallable = + callableFactory.createPagedCallable( + listFunctionsTransportSettings, settings.listFunctionsSettings(), clientContext); + this.createFunctionCallable = + callableFactory.createUnaryCallable( + createFunctionTransportSettings, settings.createFunctionSettings(), clientContext); + this.createFunctionOperationCallable = + callableFactory.createOperationCallable( + createFunctionTransportSettings, + settings.createFunctionOperationSettings(), + clientContext, + operationsStub); + this.updateFunctionCallable = + callableFactory.createUnaryCallable( + updateFunctionTransportSettings, settings.updateFunctionSettings(), clientContext); + this.updateFunctionOperationCallable = + callableFactory.createOperationCallable( + updateFunctionTransportSettings, + settings.updateFunctionOperationSettings(), + clientContext, + operationsStub); + this.deleteFunctionCallable = + callableFactory.createUnaryCallable( + deleteFunctionTransportSettings, settings.deleteFunctionSettings(), clientContext); + this.deleteFunctionOperationCallable = + callableFactory.createOperationCallable( + deleteFunctionTransportSettings, + settings.deleteFunctionOperationSettings(), + clientContext, + operationsStub); + this.generateUploadUrlCallable = + callableFactory.createUnaryCallable( + generateUploadUrlTransportSettings, + settings.generateUploadUrlSettings(), + clientContext); + this.generateDownloadUrlCallable = + callableFactory.createUnaryCallable( + generateDownloadUrlTransportSettings, + settings.generateDownloadUrlSettings(), + clientContext); + this.listRuntimesCallable = + callableFactory.createUnaryCallable( + listRuntimesTransportSettings, settings.listRuntimesSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable getFunctionCallable() { + return getFunctionCallable; + } + + @Override + public UnaryCallable listFunctionsCallable() { + return listFunctionsCallable; + } + + @Override + public UnaryCallable + listFunctionsPagedCallable() { + return listFunctionsPagedCallable; + } + + @Override + public UnaryCallable createFunctionCallable() { + return createFunctionCallable; + } + + @Override + public OperationCallable + createFunctionOperationCallable() { + return createFunctionOperationCallable; + } + + @Override + public UnaryCallable updateFunctionCallable() { + return updateFunctionCallable; + } + + @Override + public OperationCallable + updateFunctionOperationCallable() { + return updateFunctionOperationCallable; + } + + @Override + public UnaryCallable deleteFunctionCallable() { + return deleteFunctionCallable; + } + + @Override + public OperationCallable + deleteFunctionOperationCallable() { + return deleteFunctionOperationCallable; + } + + @Override + public UnaryCallable + generateUploadUrlCallable() { + return generateUploadUrlCallable; + } + + @Override + public UnaryCallable + generateDownloadUrlCallable() { + return generateDownloadUrlCallable; + } + + @Override + public UnaryCallable listRuntimesCallable() { + return listRuntimesCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-functions/src/main/java/com/google/cloud/functions/v2beta/stub/HttpJsonFunctionServiceCallableFactory.java b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2beta/stub/HttpJsonFunctionServiceCallableFactory.java new file mode 100644 index 00000000..a5872d2b --- /dev/null +++ b/google-cloud-functions/src/main/java/com/google/cloud/functions/v2beta/stub/HttpJsonFunctionServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v2beta.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the FunctionService service API. + * + *

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

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonFunctionServiceStub extends FunctionServiceStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(Empty.getDescriptor()) + .add(Function.getDescriptor()) + .add(OperationMetadata.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + getFunctionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.functions.v2beta.FunctionService/GetFunction") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2beta/{name=projects/*/locations/*/functions/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Function.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listFunctionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.functions.v2beta.FunctionService/ListFunctions") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2beta/{parent=projects/*/locations/*}/functions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListFunctionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createFunctionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.functions.v2beta.FunctionService/CreateFunction") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2beta/{parent=projects/*/locations/*}/functions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "functionId", request.getFunctionId()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("function", request.getFunction())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateFunctionRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updateFunctionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.functions.v2beta.FunctionService/UpdateFunction") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2beta/{function.name=projects/*/locations/*/functions/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "function.name", request.getFunction().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("function", request.getFunction())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdateFunctionRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deleteFunctionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.functions.v2beta.FunctionService/DeleteFunction") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2beta/{name=projects/*/locations/*/functions/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteFunctionRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + generateUploadUrlMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.functions.v2beta.FunctionService/GenerateUploadUrl") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2beta/{parent=projects/*/locations/*}/functions:generateUploadUrl", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(GenerateUploadUrlResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + generateDownloadUrlMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.functions.v2beta.FunctionService/GenerateDownloadUrl") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2beta/{name=projects/*/locations/*/functions/*}:generateDownloadUrl", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(GenerateDownloadUrlResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listRuntimesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.functions.v2beta.FunctionService/ListRuntimes") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2beta/{parent=projects/*/locations/*}/runtimes", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListRuntimesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2beta/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + setIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2beta/{resource=projects/*/locations/*/functions/*}:setIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2beta/{resource=projects/*/locations/*/functions/*}:getIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + testIamPermissionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2beta/{resource=projects/*/locations/*/functions/*}:testIamPermissions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(TestIamPermissionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable getFunctionCallable; + private final UnaryCallable listFunctionsCallable; + private final UnaryCallable + listFunctionsPagedCallable; + private final UnaryCallable createFunctionCallable; + private final OperationCallable + createFunctionOperationCallable; + private final UnaryCallable updateFunctionCallable; + private final OperationCallable + updateFunctionOperationCallable; + private final UnaryCallable deleteFunctionCallable; + private final OperationCallable + deleteFunctionOperationCallable; + private final UnaryCallable + generateUploadUrlCallable; + private final UnaryCallable + generateDownloadUrlCallable; + private final UnaryCallable listRuntimesCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonFunctionServiceStub create(FunctionServiceStubSettings settings) + throws IOException { + return new HttpJsonFunctionServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonFunctionServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonFunctionServiceStub( + FunctionServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonFunctionServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonFunctionServiceStub( + FunctionServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonFunctionServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected HttpJsonFunctionServiceStub( + FunctionServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonFunctionServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonFunctionServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected HttpJsonFunctionServiceStub( + FunctionServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry); + + HttpJsonCallSettings getFunctionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getFunctionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listFunctionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listFunctionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings createFunctionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createFunctionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateFunctionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateFunctionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteFunctionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteFunctionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + generateUploadUrlTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(generateUploadUrlMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + generateDownloadUrlTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(generateDownloadUrlMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings listRuntimesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listRuntimesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings setIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + testIamPermissionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.getFunctionCallable = + callableFactory.createUnaryCallable( + getFunctionTransportSettings, settings.getFunctionSettings(), clientContext); + this.listFunctionsCallable = + callableFactory.createUnaryCallable( + listFunctionsTransportSettings, settings.listFunctionsSettings(), clientContext); + this.listFunctionsPagedCallable = + callableFactory.createPagedCallable( + listFunctionsTransportSettings, settings.listFunctionsSettings(), clientContext); + this.createFunctionCallable = + callableFactory.createUnaryCallable( + createFunctionTransportSettings, settings.createFunctionSettings(), clientContext); + this.createFunctionOperationCallable = + callableFactory.createOperationCallable( + createFunctionTransportSettings, + settings.createFunctionOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updateFunctionCallable = + callableFactory.createUnaryCallable( + updateFunctionTransportSettings, settings.updateFunctionSettings(), clientContext); + this.updateFunctionOperationCallable = + callableFactory.createOperationCallable( + updateFunctionTransportSettings, + settings.updateFunctionOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deleteFunctionCallable = + callableFactory.createUnaryCallable( + deleteFunctionTransportSettings, settings.deleteFunctionSettings(), clientContext); + this.deleteFunctionOperationCallable = + callableFactory.createOperationCallable( + deleteFunctionTransportSettings, + settings.deleteFunctionOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.generateUploadUrlCallable = + callableFactory.createUnaryCallable( + generateUploadUrlTransportSettings, + settings.generateUploadUrlSettings(), + clientContext); + this.generateDownloadUrlCallable = + callableFactory.createUnaryCallable( + generateDownloadUrlTransportSettings, + settings.generateDownloadUrlSettings(), + clientContext); + this.listRuntimesCallable = + callableFactory.createUnaryCallable( + listRuntimesTransportSettings, settings.listRuntimesSettings(), clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(getFunctionMethodDescriptor); + methodDescriptors.add(listFunctionsMethodDescriptor); + methodDescriptors.add(createFunctionMethodDescriptor); + methodDescriptors.add(updateFunctionMethodDescriptor); + methodDescriptors.add(deleteFunctionMethodDescriptor); + methodDescriptors.add(generateUploadUrlMethodDescriptor); + methodDescriptors.add(generateDownloadUrlMethodDescriptor); + methodDescriptors.add(listRuntimesMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(setIamPolicyMethodDescriptor); + methodDescriptors.add(getIamPolicyMethodDescriptor); + methodDescriptors.add(testIamPermissionsMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable getFunctionCallable() { + return getFunctionCallable; + } + + @Override + public UnaryCallable listFunctionsCallable() { + return listFunctionsCallable; + } + + @Override + public UnaryCallable + listFunctionsPagedCallable() { + return listFunctionsPagedCallable; + } + + @Override + public UnaryCallable createFunctionCallable() { + return createFunctionCallable; + } + + @Override + public OperationCallable + createFunctionOperationCallable() { + return createFunctionOperationCallable; + } + + @Override + public UnaryCallable updateFunctionCallable() { + return updateFunctionCallable; + } + + @Override + public OperationCallable + updateFunctionOperationCallable() { + return updateFunctionOperationCallable; + } + + @Override + public UnaryCallable deleteFunctionCallable() { + return deleteFunctionCallable; + } + + @Override + public OperationCallable + deleteFunctionOperationCallable() { + return deleteFunctionOperationCallable; + } + + @Override + public UnaryCallable + generateUploadUrlCallable() { + return generateUploadUrlCallable; + } + + @Override + public UnaryCallable + generateDownloadUrlCallable() { + return generateDownloadUrlCallable; + } + + @Override + public UnaryCallable listRuntimesCallable() { + return listRuntimesCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-functions/src/test/java/com/google/cloud/functions/v1/CloudFunctionsServiceClientHttpJsonTest.java b/google-cloud-functions/src/test/java/com/google/cloud/functions/v1/CloudFunctionsServiceClientHttpJsonTest.java new file mode 100644 index 00000000..f7c80cad --- /dev/null +++ b/google-cloud-functions/src/test/java/com/google/cloud/functions/v1/CloudFunctionsServiceClientHttpJsonTest.java @@ -0,0 +1,1034 @@ +/* + * 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.v1; + +import static com.google.cloud.functions.v1.CloudFunctionsServiceClient.ListFunctionsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.functions.v1.stub.HttpJsonCloudFunctionsServiceStub; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Duration; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class CloudFunctionsServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static CloudFunctionsServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonCloudFunctionsServiceStub.getMethodDescriptors(), + CloudFunctionsServiceSettings.getDefaultEndpoint()); + CloudFunctionsServiceSettings settings = + CloudFunctionsServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + CloudFunctionsServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = CloudFunctionsServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void listFunctionsTest() throws Exception { + CloudFunction responsesElement = CloudFunction.newBuilder().build(); + ListFunctionsResponse expectedResponse = + ListFunctionsResponse.newBuilder() + .setNextPageToken("") + .addAllFunctions(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListFunctionsRequest request = + ListFunctionsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListFunctionsPagedResponse pagedListResponse = client.listFunctions(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getFunctionsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listFunctionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListFunctionsRequest request = + ListFunctionsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listFunctions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getFunctionTest() throws Exception { + CloudFunction expectedResponse = + CloudFunction.newBuilder() + .setName(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setDescription("description-1724546052") + .setStatus(CloudFunctionStatus.forNumber(0)) + .setEntryPoint("entryPoint-1979329474") + .setRuntime("runtime1550962648") + .setTimeout(Duration.newBuilder().build()) + .setAvailableMemoryMb(1964533661) + .setServiceAccountEmail("serviceAccountEmail1825953988") + .setUpdateTime(Timestamp.newBuilder().build()) + .setVersionId(-670497310) + .putAllLabels(new HashMap()) + .putAllEnvironmentVariables(new HashMap()) + .putAllBuildEnvironmentVariables(new HashMap()) + .setNetwork("network1843485230") + .setMaxInstances(-330682013) + .setMinInstances(1491624145) + .setVpcConnector("vpcConnector2101559652") + .setKmsKeyName( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .setBuildWorkerPool("buildWorkerPool1011442120") + .setBuildId("buildId230943785") + .setBuildName("buildName-1401172455") + .addAllSecretEnvironmentVariables(new ArrayList()) + .addAllSecretVolumes(new ArrayList()) + .setSourceToken("sourceToken-94946658") + .setDockerRepository("dockerRepository1588395402") + .build(); + mockService.addResponse(expectedResponse); + + CloudFunctionName name = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + + CloudFunction actualResponse = client.getFunction(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getFunctionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + CloudFunctionName name = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + client.getFunction(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getFunctionTest2() throws Exception { + CloudFunction expectedResponse = + CloudFunction.newBuilder() + .setName(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setDescription("description-1724546052") + .setStatus(CloudFunctionStatus.forNumber(0)) + .setEntryPoint("entryPoint-1979329474") + .setRuntime("runtime1550962648") + .setTimeout(Duration.newBuilder().build()) + .setAvailableMemoryMb(1964533661) + .setServiceAccountEmail("serviceAccountEmail1825953988") + .setUpdateTime(Timestamp.newBuilder().build()) + .setVersionId(-670497310) + .putAllLabels(new HashMap()) + .putAllEnvironmentVariables(new HashMap()) + .putAllBuildEnvironmentVariables(new HashMap()) + .setNetwork("network1843485230") + .setMaxInstances(-330682013) + .setMinInstances(1491624145) + .setVpcConnector("vpcConnector2101559652") + .setKmsKeyName( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .setBuildWorkerPool("buildWorkerPool1011442120") + .setBuildId("buildId230943785") + .setBuildName("buildName-1401172455") + .addAllSecretEnvironmentVariables(new ArrayList()) + .addAllSecretVolumes(new ArrayList()) + .setSourceToken("sourceToken-94946658") + .setDockerRepository("dockerRepository1588395402") + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-129/locations/location-129/functions/function-129"; + + CloudFunction actualResponse = client.getFunction(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getFunctionExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-129/locations/location-129/functions/function-129"; + client.getFunction(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createFunctionTest() throws Exception { + CloudFunction expectedResponse = + CloudFunction.newBuilder() + .setName(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setDescription("description-1724546052") + .setStatus(CloudFunctionStatus.forNumber(0)) + .setEntryPoint("entryPoint-1979329474") + .setRuntime("runtime1550962648") + .setTimeout(Duration.newBuilder().build()) + .setAvailableMemoryMb(1964533661) + .setServiceAccountEmail("serviceAccountEmail1825953988") + .setUpdateTime(Timestamp.newBuilder().build()) + .setVersionId(-670497310) + .putAllLabels(new HashMap()) + .putAllEnvironmentVariables(new HashMap()) + .putAllBuildEnvironmentVariables(new HashMap()) + .setNetwork("network1843485230") + .setMaxInstances(-330682013) + .setMinInstances(1491624145) + .setVpcConnector("vpcConnector2101559652") + .setKmsKeyName( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .setBuildWorkerPool("buildWorkerPool1011442120") + .setBuildId("buildId230943785") + .setBuildName("buildName-1401172455") + .addAllSecretEnvironmentVariables(new ArrayList()) + .addAllSecretVolumes(new ArrayList()) + .setSourceToken("sourceToken-94946658") + .setDockerRepository("dockerRepository1588395402") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createFunctionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + LocationName location = LocationName.of("[PROJECT]", "[LOCATION]"); + CloudFunction function = CloudFunction.newBuilder().build(); + + CloudFunction actualResponse = client.createFunctionAsync(location, function).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createFunctionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName location = LocationName.of("[PROJECT]", "[LOCATION]"); + CloudFunction function = CloudFunction.newBuilder().build(); + client.createFunctionAsync(location, function).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createFunctionTest2() throws Exception { + CloudFunction expectedResponse = + CloudFunction.newBuilder() + .setName(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setDescription("description-1724546052") + .setStatus(CloudFunctionStatus.forNumber(0)) + .setEntryPoint("entryPoint-1979329474") + .setRuntime("runtime1550962648") + .setTimeout(Duration.newBuilder().build()) + .setAvailableMemoryMb(1964533661) + .setServiceAccountEmail("serviceAccountEmail1825953988") + .setUpdateTime(Timestamp.newBuilder().build()) + .setVersionId(-670497310) + .putAllLabels(new HashMap()) + .putAllEnvironmentVariables(new HashMap()) + .putAllBuildEnvironmentVariables(new HashMap()) + .setNetwork("network1843485230") + .setMaxInstances(-330682013) + .setMinInstances(1491624145) + .setVpcConnector("vpcConnector2101559652") + .setKmsKeyName( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .setBuildWorkerPool("buildWorkerPool1011442120") + .setBuildId("buildId230943785") + .setBuildName("buildName-1401172455") + .addAllSecretEnvironmentVariables(new ArrayList()) + .addAllSecretVolumes(new ArrayList()) + .setSourceToken("sourceToken-94946658") + .setDockerRepository("dockerRepository1588395402") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createFunctionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String location = "projects/project-7132/locations/location-7132"; + CloudFunction function = CloudFunction.newBuilder().build(); + + CloudFunction actualResponse = client.createFunctionAsync(location, function).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createFunctionExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String location = "projects/project-7132/locations/location-7132"; + CloudFunction function = CloudFunction.newBuilder().build(); + client.createFunctionAsync(location, function).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void updateFunctionTest() throws Exception { + CloudFunction expectedResponse = + CloudFunction.newBuilder() + .setName(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setDescription("description-1724546052") + .setStatus(CloudFunctionStatus.forNumber(0)) + .setEntryPoint("entryPoint-1979329474") + .setRuntime("runtime1550962648") + .setTimeout(Duration.newBuilder().build()) + .setAvailableMemoryMb(1964533661) + .setServiceAccountEmail("serviceAccountEmail1825953988") + .setUpdateTime(Timestamp.newBuilder().build()) + .setVersionId(-670497310) + .putAllLabels(new HashMap()) + .putAllEnvironmentVariables(new HashMap()) + .putAllBuildEnvironmentVariables(new HashMap()) + .setNetwork("network1843485230") + .setMaxInstances(-330682013) + .setMinInstances(1491624145) + .setVpcConnector("vpcConnector2101559652") + .setKmsKeyName( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .setBuildWorkerPool("buildWorkerPool1011442120") + .setBuildId("buildId230943785") + .setBuildName("buildName-1401172455") + .addAllSecretEnvironmentVariables(new ArrayList()) + .addAllSecretVolumes(new ArrayList()) + .setSourceToken("sourceToken-94946658") + .setDockerRepository("dockerRepository1588395402") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateFunctionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + CloudFunction function = + CloudFunction.newBuilder() + .setName(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setDescription("description-1724546052") + .setStatus(CloudFunctionStatus.forNumber(0)) + .setEntryPoint("entryPoint-1979329474") + .setRuntime("runtime1550962648") + .setTimeout(Duration.newBuilder().build()) + .setAvailableMemoryMb(1964533661) + .setServiceAccountEmail("serviceAccountEmail1825953988") + .setUpdateTime(Timestamp.newBuilder().build()) + .setVersionId(-670497310) + .putAllLabels(new HashMap()) + .putAllEnvironmentVariables(new HashMap()) + .putAllBuildEnvironmentVariables(new HashMap()) + .setNetwork("network1843485230") + .setMaxInstances(-330682013) + .setMinInstances(1491624145) + .setVpcConnector("vpcConnector2101559652") + .setKmsKeyName( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .setBuildWorkerPool("buildWorkerPool1011442120") + .setBuildId("buildId230943785") + .setBuildName("buildName-1401172455") + .addAllSecretEnvironmentVariables(new ArrayList()) + .addAllSecretVolumes(new ArrayList()) + .setSourceToken("sourceToken-94946658") + .setDockerRepository("dockerRepository1588395402") + .build(); + + CloudFunction actualResponse = client.updateFunctionAsync(function).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateFunctionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + CloudFunction function = + CloudFunction.newBuilder() + .setName(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setDescription("description-1724546052") + .setStatus(CloudFunctionStatus.forNumber(0)) + .setEntryPoint("entryPoint-1979329474") + .setRuntime("runtime1550962648") + .setTimeout(Duration.newBuilder().build()) + .setAvailableMemoryMb(1964533661) + .setServiceAccountEmail("serviceAccountEmail1825953988") + .setUpdateTime(Timestamp.newBuilder().build()) + .setVersionId(-670497310) + .putAllLabels(new HashMap()) + .putAllEnvironmentVariables(new HashMap()) + .putAllBuildEnvironmentVariables(new HashMap()) + .setNetwork("network1843485230") + .setMaxInstances(-330682013) + .setMinInstances(1491624145) + .setVpcConnector("vpcConnector2101559652") + .setKmsKeyName( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .setBuildWorkerPool("buildWorkerPool1011442120") + .setBuildId("buildId230943785") + .setBuildName("buildName-1401172455") + .addAllSecretEnvironmentVariables(new ArrayList()) + .addAllSecretVolumes(new ArrayList()) + .setSourceToken("sourceToken-94946658") + .setDockerRepository("dockerRepository1588395402") + .build(); + client.updateFunctionAsync(function).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteFunctionTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteFunctionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + CloudFunctionName name = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + + client.deleteFunctionAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteFunctionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + CloudFunctionName name = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + client.deleteFunctionAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteFunctionTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteFunctionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-129/locations/location-129/functions/function-129"; + + client.deleteFunctionAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteFunctionExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-129/locations/location-129/functions/function-129"; + client.deleteFunctionAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void callFunctionTest() throws Exception { + CallFunctionResponse expectedResponse = + CallFunctionResponse.newBuilder() + .setExecutionId("executionId-454906285") + .setResult("result-934426595") + .setError("error96784904") + .build(); + mockService.addResponse(expectedResponse); + + CloudFunctionName name = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + String data = "data3076010"; + + CallFunctionResponse actualResponse = client.callFunction(name, data); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void callFunctionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + CloudFunctionName name = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + String data = "data3076010"; + client.callFunction(name, data); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void callFunctionTest2() throws Exception { + CallFunctionResponse expectedResponse = + CallFunctionResponse.newBuilder() + .setExecutionId("executionId-454906285") + .setResult("result-934426595") + .setError("error96784904") + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-129/locations/location-129/functions/function-129"; + String data = "data3076010"; + + CallFunctionResponse actualResponse = client.callFunction(name, data); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void callFunctionExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-129/locations/location-129/functions/function-129"; + String data = "data3076010"; + client.callFunction(name, data); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void generateUploadUrlTest() throws Exception { + GenerateUploadUrlResponse expectedResponse = + GenerateUploadUrlResponse.newBuilder().setUploadUrl("uploadUrl1239085998").build(); + mockService.addResponse(expectedResponse); + + GenerateUploadUrlRequest request = + GenerateUploadUrlRequest.newBuilder() + .setParent("projects/project-5833/locations/location-5833") + .setKmsKeyName( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .build(); + + GenerateUploadUrlResponse actualResponse = client.generateUploadUrl(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void generateUploadUrlExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GenerateUploadUrlRequest request = + GenerateUploadUrlRequest.newBuilder() + .setParent("projects/project-5833/locations/location-5833") + .setKmsKeyName( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .build(); + client.generateUploadUrl(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void generateDownloadUrlTest() throws Exception { + GenerateDownloadUrlResponse expectedResponse = + GenerateDownloadUrlResponse.newBuilder().setDownloadUrl("downloadUrl-1211148345").build(); + mockService.addResponse(expectedResponse); + + GenerateDownloadUrlRequest request = + GenerateDownloadUrlRequest.newBuilder() + .setName("projects/project-129/locations/location-129/functions/function-129") + .setVersionId(-670497310) + .build(); + + GenerateDownloadUrlResponse actualResponse = client.generateDownloadUrl(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void generateDownloadUrlExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GenerateDownloadUrlRequest request = + GenerateDownloadUrlRequest.newBuilder() + .setName("projects/project-129/locations/location-129/functions/function-129") + .setVersionId(-670497310) + .build(); + client.generateDownloadUrl(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockService.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/google-cloud-functions/src/test/java/com/google/cloud/functions/v1/CloudFunctionsServiceClientTest.java b/google-cloud-functions/src/test/java/com/google/cloud/functions/v1/CloudFunctionsServiceClientTest.java index ad2915e9..9d1dc411 100644 --- a/google-cloud-functions/src/test/java/com/google/cloud/functions/v1/CloudFunctionsServiceClientTest.java +++ b/google-cloud-functions/src/test/java/com/google/cloud/functions/v1/CloudFunctionsServiceClientTest.java @@ -175,7 +175,9 @@ public void getFunctionTest() throws Exception { .setMaxInstances(-330682013) .setMinInstances(1491624145) .setVpcConnector("vpcConnector2101559652") - .setKmsKeyName("kmsKeyName412586233") + .setKmsKeyName( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) .setBuildWorkerPool("buildWorkerPool1011442120") .setBuildId("buildId230943785") .setBuildName("buildName-1401172455") @@ -237,7 +239,9 @@ public void getFunctionTest2() throws Exception { .setMaxInstances(-330682013) .setMinInstances(1491624145) .setVpcConnector("vpcConnector2101559652") - .setKmsKeyName("kmsKeyName412586233") + .setKmsKeyName( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) .setBuildWorkerPool("buildWorkerPool1011442120") .setBuildId("buildId230943785") .setBuildName("buildName-1401172455") @@ -299,7 +303,9 @@ public void createFunctionTest() throws Exception { .setMaxInstances(-330682013) .setMinInstances(1491624145) .setVpcConnector("vpcConnector2101559652") - .setKmsKeyName("kmsKeyName412586233") + .setKmsKeyName( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) .setBuildWorkerPool("buildWorkerPool1011442120") .setBuildId("buildId230943785") .setBuildName("buildName-1401172455") @@ -372,7 +378,9 @@ public void createFunctionTest2() throws Exception { .setMaxInstances(-330682013) .setMinInstances(1491624145) .setVpcConnector("vpcConnector2101559652") - .setKmsKeyName("kmsKeyName412586233") + .setKmsKeyName( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) .setBuildWorkerPool("buildWorkerPool1011442120") .setBuildId("buildId230943785") .setBuildName("buildName-1401172455") @@ -445,7 +453,9 @@ public void updateFunctionTest() throws Exception { .setMaxInstances(-330682013) .setMinInstances(1491624145) .setVpcConnector("vpcConnector2101559652") - .setKmsKeyName("kmsKeyName412586233") + .setKmsKeyName( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) .setBuildWorkerPool("buildWorkerPool1011442120") .setBuildId("buildId230943785") .setBuildName("buildName-1401172455") @@ -671,7 +681,12 @@ public void generateUploadUrlTest() throws Exception { mockCloudFunctionsService.addResponse(expectedResponse); GenerateUploadUrlRequest request = - GenerateUploadUrlRequest.newBuilder().setParent("parent-995424086").build(); + GenerateUploadUrlRequest.newBuilder() + .setParent("parent-995424086") + .setKmsKeyName( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .build(); GenerateUploadUrlResponse actualResponse = client.generateUploadUrl(request); Assert.assertEquals(expectedResponse, actualResponse); @@ -681,6 +696,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(), @@ -694,7 +710,12 @@ public void generateUploadUrlExceptionTest() throws Exception { try { GenerateUploadUrlRequest request = - GenerateUploadUrlRequest.newBuilder().setParent("parent-995424086").build(); + GenerateUploadUrlRequest.newBuilder() + .setParent("parent-995424086") + .setKmsKeyName( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .build(); client.generateUploadUrl(request); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { diff --git a/google-cloud-functions/src/test/java/com/google/cloud/functions/v2alpha/FunctionServiceClientHttpJsonTest.java b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2alpha/FunctionServiceClientHttpJsonTest.java new file mode 100644 index 00000000..4c7f5209 --- /dev/null +++ b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2alpha/FunctionServiceClientHttpJsonTest.java @@ -0,0 +1,1006 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v2alpha; + +import static com.google.cloud.functions.v2alpha.FunctionServiceClient.ListFunctionsPagedResponse; +import static com.google.cloud.functions.v2alpha.FunctionServiceClient.ListLocationsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.functions.v2alpha.stub.HttpJsonFunctionServiceStub; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class FunctionServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static FunctionServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonFunctionServiceStub.getMethodDescriptors(), + FunctionServiceSettings.getDefaultEndpoint()); + FunctionServiceSettings settings = + FunctionServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + FunctionServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = FunctionServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void getFunctionTest() throws Exception { + Function expectedResponse = + Function.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setEnvironment(Environment.forNumber(0)) + .setDescription("description-1724546052") + .setBuildConfig(BuildConfig.newBuilder().build()) + .setServiceConfig(ServiceConfig.newBuilder().build()) + .setEventTrigger(EventTrigger.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllStateMessages(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + FunctionName name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + + Function actualResponse = client.getFunction(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getFunctionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + FunctionName name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + client.getFunction(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getFunctionTest2() throws Exception { + Function expectedResponse = + Function.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setEnvironment(Environment.forNumber(0)) + .setDescription("description-1724546052") + .setBuildConfig(BuildConfig.newBuilder().build()) + .setServiceConfig(ServiceConfig.newBuilder().build()) + .setEventTrigger(EventTrigger.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllStateMessages(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-129/locations/location-129/functions/function-129"; + + Function actualResponse = client.getFunction(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getFunctionExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-129/locations/location-129/functions/function-129"; + client.getFunction(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listFunctionsTest() throws Exception { + Function responsesElement = Function.newBuilder().build(); + ListFunctionsResponse expectedResponse = + ListFunctionsResponse.newBuilder() + .setNextPageToken("") + .addAllFunctions(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListFunctionsPagedResponse pagedListResponse = client.listFunctions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getFunctionsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listFunctionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listFunctions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listFunctionsTest2() throws Exception { + Function responsesElement = Function.newBuilder().build(); + ListFunctionsResponse expectedResponse = + ListFunctionsResponse.newBuilder() + .setNextPageToken("") + .addAllFunctions(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListFunctionsPagedResponse pagedListResponse = client.listFunctions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getFunctionsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listFunctionsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listFunctions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createFunctionTest() throws Exception { + Function expectedResponse = + Function.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setEnvironment(Environment.forNumber(0)) + .setDescription("description-1724546052") + .setBuildConfig(BuildConfig.newBuilder().build()) + .setServiceConfig(ServiceConfig.newBuilder().build()) + .setEventTrigger(EventTrigger.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllStateMessages(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createFunctionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Function function = Function.newBuilder().build(); + String functionId = "functionId-62789869"; + + Function actualResponse = client.createFunctionAsync(parent, function, functionId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createFunctionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Function function = Function.newBuilder().build(); + String functionId = "functionId-62789869"; + client.createFunctionAsync(parent, function, functionId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createFunctionTest2() throws Exception { + Function expectedResponse = + Function.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setEnvironment(Environment.forNumber(0)) + .setDescription("description-1724546052") + .setBuildConfig(BuildConfig.newBuilder().build()) + .setServiceConfig(ServiceConfig.newBuilder().build()) + .setEventTrigger(EventTrigger.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllStateMessages(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createFunctionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-5833/locations/location-5833"; + Function function = Function.newBuilder().build(); + String functionId = "functionId-62789869"; + + Function actualResponse = client.createFunctionAsync(parent, function, functionId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createFunctionExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + Function function = Function.newBuilder().build(); + String functionId = "functionId-62789869"; + client.createFunctionAsync(parent, function, functionId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void updateFunctionTest() throws Exception { + Function expectedResponse = + Function.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setEnvironment(Environment.forNumber(0)) + .setDescription("description-1724546052") + .setBuildConfig(BuildConfig.newBuilder().build()) + .setServiceConfig(ServiceConfig.newBuilder().build()) + .setEventTrigger(EventTrigger.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllStateMessages(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateFunctionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + Function function = + Function.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setEnvironment(Environment.forNumber(0)) + .setDescription("description-1724546052") + .setBuildConfig(BuildConfig.newBuilder().build()) + .setServiceConfig(ServiceConfig.newBuilder().build()) + .setEventTrigger(EventTrigger.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllStateMessages(new ArrayList()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Function actualResponse = client.updateFunctionAsync(function, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateFunctionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Function function = + Function.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setEnvironment(Environment.forNumber(0)) + .setDescription("description-1724546052") + .setBuildConfig(BuildConfig.newBuilder().build()) + .setServiceConfig(ServiceConfig.newBuilder().build()) + .setEventTrigger(EventTrigger.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllStateMessages(new ArrayList()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateFunctionAsync(function, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteFunctionTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteFunctionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + FunctionName name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + + client.deleteFunctionAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteFunctionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + FunctionName name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + client.deleteFunctionAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteFunctionTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteFunctionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-129/locations/location-129/functions/function-129"; + + client.deleteFunctionAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteFunctionExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-129/locations/location-129/functions/function-129"; + client.deleteFunctionAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void generateUploadUrlTest() throws Exception { + GenerateUploadUrlResponse expectedResponse = + GenerateUploadUrlResponse.newBuilder() + .setUploadUrl("uploadUrl1239085998") + .setStorageSource(StorageSource.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GenerateUploadUrlRequest request = + GenerateUploadUrlRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .build(); + + GenerateUploadUrlResponse actualResponse = client.generateUploadUrl(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void generateUploadUrlExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GenerateUploadUrlRequest request = + GenerateUploadUrlRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .build(); + client.generateUploadUrl(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void generateDownloadUrlTest() throws Exception { + GenerateDownloadUrlResponse expectedResponse = + GenerateDownloadUrlResponse.newBuilder().setDownloadUrl("downloadUrl-1211148345").build(); + mockService.addResponse(expectedResponse); + + GenerateDownloadUrlRequest request = + GenerateDownloadUrlRequest.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .build(); + + GenerateDownloadUrlResponse actualResponse = client.generateDownloadUrl(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void generateDownloadUrlExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GenerateDownloadUrlRequest request = + GenerateDownloadUrlRequest.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .build(); + client.generateDownloadUrl(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listRuntimesTest() throws Exception { + ListRuntimesResponse expectedResponse = + ListRuntimesResponse.newBuilder() + .addAllRuntimes(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListRuntimesResponse actualResponse = client.listRuntimes(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listRuntimesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listRuntimes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listRuntimesTest2() throws Exception { + ListRuntimesResponse expectedResponse = + ListRuntimesResponse.newBuilder() + .addAllRuntimes(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListRuntimesResponse actualResponse = client.listRuntimes(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listRuntimesExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listRuntimes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockService.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/google-cloud-functions/src/test/java/com/google/cloud/functions/v2alpha/FunctionServiceClientTest.java b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2alpha/FunctionServiceClientTest.java new file mode 100644 index 00000000..c6125e04 --- /dev/null +++ b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2alpha/FunctionServiceClientTest.java @@ -0,0 +1,918 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v2alpha; + +import static com.google.cloud.functions.v2alpha.FunctionServiceClient.ListFunctionsPagedResponse; +import static com.google.cloud.functions.v2alpha.FunctionServiceClient.ListLocationsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class FunctionServiceClientTest { + private static MockFunctionService mockFunctionService; + private static MockIAMPolicy mockIAMPolicy; + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private FunctionServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockFunctionService = new MockFunctionService(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockFunctionService, mockLocations, mockIAMPolicy)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + FunctionServiceSettings settings = + FunctionServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = FunctionServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void getFunctionTest() throws Exception { + Function expectedResponse = + Function.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setEnvironment(Environment.forNumber(0)) + .setDescription("description-1724546052") + .setBuildConfig(BuildConfig.newBuilder().build()) + .setServiceConfig(ServiceConfig.newBuilder().build()) + .setEventTrigger(EventTrigger.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllStateMessages(new ArrayList()) + .build(); + mockFunctionService.addResponse(expectedResponse); + + FunctionName name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + + Function actualResponse = client.getFunction(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFunctionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetFunctionRequest actualRequest = ((GetFunctionRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getFunctionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFunctionService.addException(exception); + + try { + FunctionName name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + client.getFunction(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getFunctionTest2() throws Exception { + Function expectedResponse = + Function.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setEnvironment(Environment.forNumber(0)) + .setDescription("description-1724546052") + .setBuildConfig(BuildConfig.newBuilder().build()) + .setServiceConfig(ServiceConfig.newBuilder().build()) + .setEventTrigger(EventTrigger.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllStateMessages(new ArrayList()) + .build(); + mockFunctionService.addResponse(expectedResponse); + + String name = "name3373707"; + + Function actualResponse = client.getFunction(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFunctionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetFunctionRequest actualRequest = ((GetFunctionRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getFunctionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFunctionService.addException(exception); + + try { + String name = "name3373707"; + client.getFunction(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listFunctionsTest() throws Exception { + Function responsesElement = Function.newBuilder().build(); + ListFunctionsResponse expectedResponse = + ListFunctionsResponse.newBuilder() + .setNextPageToken("") + .addAllFunctions(Arrays.asList(responsesElement)) + .build(); + mockFunctionService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListFunctionsPagedResponse pagedListResponse = client.listFunctions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getFunctionsList().get(0), resources.get(0)); + + List actualRequests = mockFunctionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListFunctionsRequest actualRequest = ((ListFunctionsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listFunctionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFunctionService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listFunctions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listFunctionsTest2() throws Exception { + Function responsesElement = Function.newBuilder().build(); + ListFunctionsResponse expectedResponse = + ListFunctionsResponse.newBuilder() + .setNextPageToken("") + .addAllFunctions(Arrays.asList(responsesElement)) + .build(); + mockFunctionService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListFunctionsPagedResponse pagedListResponse = client.listFunctions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getFunctionsList().get(0), resources.get(0)); + + List actualRequests = mockFunctionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListFunctionsRequest actualRequest = ((ListFunctionsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listFunctionsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFunctionService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listFunctions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createFunctionTest() throws Exception { + Function expectedResponse = + Function.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setEnvironment(Environment.forNumber(0)) + .setDescription("description-1724546052") + .setBuildConfig(BuildConfig.newBuilder().build()) + .setServiceConfig(ServiceConfig.newBuilder().build()) + .setEventTrigger(EventTrigger.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllStateMessages(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createFunctionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockFunctionService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Function function = Function.newBuilder().build(); + String functionId = "functionId-62789869"; + + Function actualResponse = client.createFunctionAsync(parent, function, functionId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFunctionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateFunctionRequest actualRequest = ((CreateFunctionRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(function, actualRequest.getFunction()); + Assert.assertEquals(functionId, actualRequest.getFunctionId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createFunctionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFunctionService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Function function = Function.newBuilder().build(); + String functionId = "functionId-62789869"; + client.createFunctionAsync(parent, function, functionId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createFunctionTest2() throws Exception { + Function expectedResponse = + Function.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setEnvironment(Environment.forNumber(0)) + .setDescription("description-1724546052") + .setBuildConfig(BuildConfig.newBuilder().build()) + .setServiceConfig(ServiceConfig.newBuilder().build()) + .setEventTrigger(EventTrigger.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllStateMessages(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createFunctionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockFunctionService.addResponse(resultOperation); + + String parent = "parent-995424086"; + Function function = Function.newBuilder().build(); + String functionId = "functionId-62789869"; + + Function actualResponse = client.createFunctionAsync(parent, function, functionId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFunctionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateFunctionRequest actualRequest = ((CreateFunctionRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(function, actualRequest.getFunction()); + Assert.assertEquals(functionId, actualRequest.getFunctionId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createFunctionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFunctionService.addException(exception); + + try { + String parent = "parent-995424086"; + Function function = Function.newBuilder().build(); + String functionId = "functionId-62789869"; + client.createFunctionAsync(parent, function, functionId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void updateFunctionTest() throws Exception { + Function expectedResponse = + Function.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setEnvironment(Environment.forNumber(0)) + .setDescription("description-1724546052") + .setBuildConfig(BuildConfig.newBuilder().build()) + .setServiceConfig(ServiceConfig.newBuilder().build()) + .setEventTrigger(EventTrigger.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllStateMessages(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateFunctionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockFunctionService.addResponse(resultOperation); + + Function function = Function.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Function actualResponse = client.updateFunctionAsync(function, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFunctionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateFunctionRequest actualRequest = ((UpdateFunctionRequest) actualRequests.get(0)); + + Assert.assertEquals(function, actualRequest.getFunction()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateFunctionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFunctionService.addException(exception); + + try { + Function function = Function.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateFunctionAsync(function, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteFunctionTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteFunctionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockFunctionService.addResponse(resultOperation); + + FunctionName name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + + client.deleteFunctionAsync(name).get(); + + List actualRequests = mockFunctionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteFunctionRequest actualRequest = ((DeleteFunctionRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteFunctionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFunctionService.addException(exception); + + try { + FunctionName name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + client.deleteFunctionAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteFunctionTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteFunctionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockFunctionService.addResponse(resultOperation); + + String name = "name3373707"; + + client.deleteFunctionAsync(name).get(); + + List actualRequests = mockFunctionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteFunctionRequest actualRequest = ((DeleteFunctionRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteFunctionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFunctionService.addException(exception); + + try { + String name = "name3373707"; + client.deleteFunctionAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void generateUploadUrlTest() throws Exception { + GenerateUploadUrlResponse expectedResponse = + GenerateUploadUrlResponse.newBuilder() + .setUploadUrl("uploadUrl1239085998") + .setStorageSource(StorageSource.newBuilder().build()) + .build(); + mockFunctionService.addResponse(expectedResponse); + + GenerateUploadUrlRequest request = + GenerateUploadUrlRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .build(); + + GenerateUploadUrlResponse actualResponse = client.generateUploadUrl(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFunctionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GenerateUploadUrlRequest actualRequest = ((GenerateUploadUrlRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void generateUploadUrlExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFunctionService.addException(exception); + + try { + GenerateUploadUrlRequest request = + GenerateUploadUrlRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .build(); + client.generateUploadUrl(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void generateDownloadUrlTest() throws Exception { + GenerateDownloadUrlResponse expectedResponse = + GenerateDownloadUrlResponse.newBuilder().setDownloadUrl("downloadUrl-1211148345").build(); + mockFunctionService.addResponse(expectedResponse); + + GenerateDownloadUrlRequest request = + GenerateDownloadUrlRequest.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .build(); + + GenerateDownloadUrlResponse actualResponse = client.generateDownloadUrl(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFunctionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GenerateDownloadUrlRequest actualRequest = ((GenerateDownloadUrlRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void generateDownloadUrlExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFunctionService.addException(exception); + + try { + GenerateDownloadUrlRequest request = + GenerateDownloadUrlRequest.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .build(); + client.generateDownloadUrl(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listRuntimesTest() throws Exception { + ListRuntimesResponse expectedResponse = + ListRuntimesResponse.newBuilder() + .addAllRuntimes(new ArrayList()) + .build(); + mockFunctionService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListRuntimesResponse actualResponse = client.listRuntimes(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFunctionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListRuntimesRequest actualRequest = ((ListRuntimesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listRuntimesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFunctionService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listRuntimes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listRuntimesTest2() throws Exception { + ListRuntimesResponse expectedResponse = + ListRuntimesResponse.newBuilder() + .addAllRuntimes(new ArrayList()) + .build(); + mockFunctionService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListRuntimesResponse actualResponse = client.listRuntimes(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFunctionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListRuntimesRequest actualRequest = ((ListRuntimesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listRuntimesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFunctionService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listRuntimes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockIAMPolicy.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/google-cloud-functions/src/test/java/com/google/cloud/functions/v2alpha/MockFunctionService.java b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2alpha/MockFunctionService.java new file mode 100644 index 00000000..79a9d502 --- /dev/null +++ b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2alpha/MockFunctionService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v2alpha; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockFunctionService implements MockGrpcService { + private final MockFunctionServiceImpl serviceImpl; + + public MockFunctionService() { + serviceImpl = new MockFunctionServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-functions/src/test/java/com/google/cloud/functions/v2alpha/MockFunctionServiceImpl.java b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2alpha/MockFunctionServiceImpl.java new file mode 100644 index 00000000..cc908f7e --- /dev/null +++ b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2alpha/MockFunctionServiceImpl.java @@ -0,0 +1,230 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v2alpha; + +import com.google.api.core.BetaApi; +import com.google.cloud.functions.v2alpha.FunctionServiceGrpc.FunctionServiceImplBase; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockFunctionServiceImpl extends FunctionServiceImplBase { + private List requests; + private Queue responses; + + public MockFunctionServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void getFunction(GetFunctionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Function) { + requests.add(request); + responseObserver.onNext(((Function) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetFunction, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Function.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listFunctions( + ListFunctionsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListFunctionsResponse) { + requests.add(request); + responseObserver.onNext(((ListFunctionsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListFunctions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListFunctionsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createFunction( + CreateFunctionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateFunction, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateFunction( + UpdateFunctionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateFunction, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteFunction( + DeleteFunctionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteFunction, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void generateUploadUrl( + GenerateUploadUrlRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof GenerateUploadUrlResponse) { + requests.add(request); + responseObserver.onNext(((GenerateUploadUrlResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GenerateUploadUrl, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + GenerateUploadUrlResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void generateDownloadUrl( + GenerateDownloadUrlRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof GenerateDownloadUrlResponse) { + requests.add(request); + responseObserver.onNext(((GenerateDownloadUrlResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GenerateDownloadUrl, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + GenerateDownloadUrlResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listRuntimes( + ListRuntimesRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListRuntimesResponse) { + requests.add(request); + responseObserver.onNext(((ListRuntimesResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListRuntimes, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListRuntimesResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/google-cloud-functions/src/test/java/com/google/cloud/functions/v2alpha/MockIAMPolicy.java b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2alpha/MockIAMPolicy.java new file mode 100644 index 00000000..675fdcc3 --- /dev/null +++ b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2alpha/MockIAMPolicy.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v2alpha; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockIAMPolicy implements MockGrpcService { + private final MockIAMPolicyImpl serviceImpl; + + public MockIAMPolicy() { + serviceImpl = new MockIAMPolicyImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-functions/src/test/java/com/google/cloud/functions/v2alpha/MockIAMPolicyImpl.java b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2alpha/MockIAMPolicyImpl.java new file mode 100644 index 00000000..ce337831 --- /dev/null +++ b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2alpha/MockIAMPolicyImpl.java @@ -0,0 +1,127 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v2alpha; + +import com.google.api.core.BetaApi; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.IAMPolicyGrpc.IAMPolicyImplBase; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockIAMPolicyImpl extends IAMPolicyImplBase { + private List requests; + private Queue responses; + + public MockIAMPolicyImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void testIamPermissions( + TestIamPermissionsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof TestIamPermissionsResponse) { + requests.add(request); + responseObserver.onNext(((TestIamPermissionsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method TestIamPermissions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + TestIamPermissionsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void setIamPolicy(SetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getIamPolicy(GetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/google-cloud-functions/src/test/java/com/google/cloud/functions/v2alpha/MockLocations.java b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2alpha/MockLocations.java new file mode 100644 index 00000000..07579d2c --- /dev/null +++ b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2alpha/MockLocations.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v2alpha; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocations implements MockGrpcService { + private final MockLocationsImpl serviceImpl; + + public MockLocations() { + serviceImpl = new MockLocationsImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-functions/src/test/java/com/google/cloud/functions/v2alpha/MockLocationsImpl.java b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2alpha/MockLocationsImpl.java new file mode 100644 index 00000000..99d15840 --- /dev/null +++ b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2alpha/MockLocationsImpl.java @@ -0,0 +1,83 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v2alpha; + +import com.google.api.core.BetaApi; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.LocationsGrpc.LocationsImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocationsImpl extends LocationsImplBase { + private List requests; + private Queue responses; + + public MockLocationsImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void listLocations( + ListLocationsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListLocationsResponse) { + requests.add(request); + responseObserver.onNext(((ListLocationsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListLocations, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListLocationsResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/google-cloud-functions/src/test/java/com/google/cloud/functions/v2beta/FunctionServiceClientHttpJsonTest.java b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2beta/FunctionServiceClientHttpJsonTest.java new file mode 100644 index 00000000..96189787 --- /dev/null +++ b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2beta/FunctionServiceClientHttpJsonTest.java @@ -0,0 +1,1006 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v2beta; + +import static com.google.cloud.functions.v2beta.FunctionServiceClient.ListFunctionsPagedResponse; +import static com.google.cloud.functions.v2beta.FunctionServiceClient.ListLocationsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.functions.v2beta.stub.HttpJsonFunctionServiceStub; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class FunctionServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static FunctionServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonFunctionServiceStub.getMethodDescriptors(), + FunctionServiceSettings.getDefaultEndpoint()); + FunctionServiceSettings settings = + FunctionServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + FunctionServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = FunctionServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void getFunctionTest() throws Exception { + Function expectedResponse = + Function.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setEnvironment(Environment.forNumber(0)) + .setDescription("description-1724546052") + .setBuildConfig(BuildConfig.newBuilder().build()) + .setServiceConfig(ServiceConfig.newBuilder().build()) + .setEventTrigger(EventTrigger.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllStateMessages(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + FunctionName name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + + Function actualResponse = client.getFunction(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getFunctionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + FunctionName name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + client.getFunction(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getFunctionTest2() throws Exception { + Function expectedResponse = + Function.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setEnvironment(Environment.forNumber(0)) + .setDescription("description-1724546052") + .setBuildConfig(BuildConfig.newBuilder().build()) + .setServiceConfig(ServiceConfig.newBuilder().build()) + .setEventTrigger(EventTrigger.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllStateMessages(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-129/locations/location-129/functions/function-129"; + + Function actualResponse = client.getFunction(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getFunctionExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-129/locations/location-129/functions/function-129"; + client.getFunction(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listFunctionsTest() throws Exception { + Function responsesElement = Function.newBuilder().build(); + ListFunctionsResponse expectedResponse = + ListFunctionsResponse.newBuilder() + .setNextPageToken("") + .addAllFunctions(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListFunctionsPagedResponse pagedListResponse = client.listFunctions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getFunctionsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listFunctionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listFunctions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listFunctionsTest2() throws Exception { + Function responsesElement = Function.newBuilder().build(); + ListFunctionsResponse expectedResponse = + ListFunctionsResponse.newBuilder() + .setNextPageToken("") + .addAllFunctions(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListFunctionsPagedResponse pagedListResponse = client.listFunctions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getFunctionsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listFunctionsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listFunctions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createFunctionTest() throws Exception { + Function expectedResponse = + Function.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setEnvironment(Environment.forNumber(0)) + .setDescription("description-1724546052") + .setBuildConfig(BuildConfig.newBuilder().build()) + .setServiceConfig(ServiceConfig.newBuilder().build()) + .setEventTrigger(EventTrigger.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllStateMessages(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createFunctionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Function function = Function.newBuilder().build(); + String functionId = "functionId-62789869"; + + Function actualResponse = client.createFunctionAsync(parent, function, functionId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createFunctionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Function function = Function.newBuilder().build(); + String functionId = "functionId-62789869"; + client.createFunctionAsync(parent, function, functionId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createFunctionTest2() throws Exception { + Function expectedResponse = + Function.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setEnvironment(Environment.forNumber(0)) + .setDescription("description-1724546052") + .setBuildConfig(BuildConfig.newBuilder().build()) + .setServiceConfig(ServiceConfig.newBuilder().build()) + .setEventTrigger(EventTrigger.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllStateMessages(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createFunctionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-5833/locations/location-5833"; + Function function = Function.newBuilder().build(); + String functionId = "functionId-62789869"; + + Function actualResponse = client.createFunctionAsync(parent, function, functionId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createFunctionExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + Function function = Function.newBuilder().build(); + String functionId = "functionId-62789869"; + client.createFunctionAsync(parent, function, functionId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void updateFunctionTest() throws Exception { + Function expectedResponse = + Function.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setEnvironment(Environment.forNumber(0)) + .setDescription("description-1724546052") + .setBuildConfig(BuildConfig.newBuilder().build()) + .setServiceConfig(ServiceConfig.newBuilder().build()) + .setEventTrigger(EventTrigger.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllStateMessages(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateFunctionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + Function function = + Function.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setEnvironment(Environment.forNumber(0)) + .setDescription("description-1724546052") + .setBuildConfig(BuildConfig.newBuilder().build()) + .setServiceConfig(ServiceConfig.newBuilder().build()) + .setEventTrigger(EventTrigger.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllStateMessages(new ArrayList()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Function actualResponse = client.updateFunctionAsync(function, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateFunctionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Function function = + Function.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setEnvironment(Environment.forNumber(0)) + .setDescription("description-1724546052") + .setBuildConfig(BuildConfig.newBuilder().build()) + .setServiceConfig(ServiceConfig.newBuilder().build()) + .setEventTrigger(EventTrigger.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllStateMessages(new ArrayList()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateFunctionAsync(function, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteFunctionTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteFunctionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + FunctionName name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + + client.deleteFunctionAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteFunctionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + FunctionName name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + client.deleteFunctionAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteFunctionTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteFunctionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-129/locations/location-129/functions/function-129"; + + client.deleteFunctionAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteFunctionExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-129/locations/location-129/functions/function-129"; + client.deleteFunctionAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void generateUploadUrlTest() throws Exception { + GenerateUploadUrlResponse expectedResponse = + GenerateUploadUrlResponse.newBuilder() + .setUploadUrl("uploadUrl1239085998") + .setStorageSource(StorageSource.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GenerateUploadUrlRequest request = + GenerateUploadUrlRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .build(); + + GenerateUploadUrlResponse actualResponse = client.generateUploadUrl(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void generateUploadUrlExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GenerateUploadUrlRequest request = + GenerateUploadUrlRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .build(); + client.generateUploadUrl(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void generateDownloadUrlTest() throws Exception { + GenerateDownloadUrlResponse expectedResponse = + GenerateDownloadUrlResponse.newBuilder().setDownloadUrl("downloadUrl-1211148345").build(); + mockService.addResponse(expectedResponse); + + GenerateDownloadUrlRequest request = + GenerateDownloadUrlRequest.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .build(); + + GenerateDownloadUrlResponse actualResponse = client.generateDownloadUrl(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void generateDownloadUrlExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GenerateDownloadUrlRequest request = + GenerateDownloadUrlRequest.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .build(); + client.generateDownloadUrl(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listRuntimesTest() throws Exception { + ListRuntimesResponse expectedResponse = + ListRuntimesResponse.newBuilder() + .addAllRuntimes(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListRuntimesResponse actualResponse = client.listRuntimes(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listRuntimesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listRuntimes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listRuntimesTest2() throws Exception { + ListRuntimesResponse expectedResponse = + ListRuntimesResponse.newBuilder() + .addAllRuntimes(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListRuntimesResponse actualResponse = client.listRuntimes(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listRuntimesExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listRuntimes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockService.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/google-cloud-functions/src/test/java/com/google/cloud/functions/v2beta/FunctionServiceClientTest.java b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2beta/FunctionServiceClientTest.java new file mode 100644 index 00000000..77aa215e --- /dev/null +++ b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2beta/FunctionServiceClientTest.java @@ -0,0 +1,918 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v2beta; + +import static com.google.cloud.functions.v2beta.FunctionServiceClient.ListFunctionsPagedResponse; +import static com.google.cloud.functions.v2beta.FunctionServiceClient.ListLocationsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class FunctionServiceClientTest { + private static MockFunctionService mockFunctionService; + private static MockIAMPolicy mockIAMPolicy; + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private FunctionServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockFunctionService = new MockFunctionService(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockFunctionService, mockLocations, mockIAMPolicy)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + FunctionServiceSettings settings = + FunctionServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = FunctionServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void getFunctionTest() throws Exception { + Function expectedResponse = + Function.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setEnvironment(Environment.forNumber(0)) + .setDescription("description-1724546052") + .setBuildConfig(BuildConfig.newBuilder().build()) + .setServiceConfig(ServiceConfig.newBuilder().build()) + .setEventTrigger(EventTrigger.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllStateMessages(new ArrayList()) + .build(); + mockFunctionService.addResponse(expectedResponse); + + FunctionName name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + + Function actualResponse = client.getFunction(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFunctionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetFunctionRequest actualRequest = ((GetFunctionRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getFunctionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFunctionService.addException(exception); + + try { + FunctionName name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + client.getFunction(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getFunctionTest2() throws Exception { + Function expectedResponse = + Function.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setEnvironment(Environment.forNumber(0)) + .setDescription("description-1724546052") + .setBuildConfig(BuildConfig.newBuilder().build()) + .setServiceConfig(ServiceConfig.newBuilder().build()) + .setEventTrigger(EventTrigger.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllStateMessages(new ArrayList()) + .build(); + mockFunctionService.addResponse(expectedResponse); + + String name = "name3373707"; + + Function actualResponse = client.getFunction(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFunctionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetFunctionRequest actualRequest = ((GetFunctionRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getFunctionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFunctionService.addException(exception); + + try { + String name = "name3373707"; + client.getFunction(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listFunctionsTest() throws Exception { + Function responsesElement = Function.newBuilder().build(); + ListFunctionsResponse expectedResponse = + ListFunctionsResponse.newBuilder() + .setNextPageToken("") + .addAllFunctions(Arrays.asList(responsesElement)) + .build(); + mockFunctionService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListFunctionsPagedResponse pagedListResponse = client.listFunctions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getFunctionsList().get(0), resources.get(0)); + + List actualRequests = mockFunctionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListFunctionsRequest actualRequest = ((ListFunctionsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listFunctionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFunctionService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listFunctions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listFunctionsTest2() throws Exception { + Function responsesElement = Function.newBuilder().build(); + ListFunctionsResponse expectedResponse = + ListFunctionsResponse.newBuilder() + .setNextPageToken("") + .addAllFunctions(Arrays.asList(responsesElement)) + .build(); + mockFunctionService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListFunctionsPagedResponse pagedListResponse = client.listFunctions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getFunctionsList().get(0), resources.get(0)); + + List actualRequests = mockFunctionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListFunctionsRequest actualRequest = ((ListFunctionsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listFunctionsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFunctionService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listFunctions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createFunctionTest() throws Exception { + Function expectedResponse = + Function.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setEnvironment(Environment.forNumber(0)) + .setDescription("description-1724546052") + .setBuildConfig(BuildConfig.newBuilder().build()) + .setServiceConfig(ServiceConfig.newBuilder().build()) + .setEventTrigger(EventTrigger.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllStateMessages(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createFunctionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockFunctionService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Function function = Function.newBuilder().build(); + String functionId = "functionId-62789869"; + + Function actualResponse = client.createFunctionAsync(parent, function, functionId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFunctionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateFunctionRequest actualRequest = ((CreateFunctionRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(function, actualRequest.getFunction()); + Assert.assertEquals(functionId, actualRequest.getFunctionId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createFunctionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFunctionService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Function function = Function.newBuilder().build(); + String functionId = "functionId-62789869"; + client.createFunctionAsync(parent, function, functionId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createFunctionTest2() throws Exception { + Function expectedResponse = + Function.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setEnvironment(Environment.forNumber(0)) + .setDescription("description-1724546052") + .setBuildConfig(BuildConfig.newBuilder().build()) + .setServiceConfig(ServiceConfig.newBuilder().build()) + .setEventTrigger(EventTrigger.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllStateMessages(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createFunctionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockFunctionService.addResponse(resultOperation); + + String parent = "parent-995424086"; + Function function = Function.newBuilder().build(); + String functionId = "functionId-62789869"; + + Function actualResponse = client.createFunctionAsync(parent, function, functionId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFunctionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateFunctionRequest actualRequest = ((CreateFunctionRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(function, actualRequest.getFunction()); + Assert.assertEquals(functionId, actualRequest.getFunctionId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createFunctionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFunctionService.addException(exception); + + try { + String parent = "parent-995424086"; + Function function = Function.newBuilder().build(); + String functionId = "functionId-62789869"; + client.createFunctionAsync(parent, function, functionId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void updateFunctionTest() throws Exception { + Function expectedResponse = + Function.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setEnvironment(Environment.forNumber(0)) + .setDescription("description-1724546052") + .setBuildConfig(BuildConfig.newBuilder().build()) + .setServiceConfig(ServiceConfig.newBuilder().build()) + .setEventTrigger(EventTrigger.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllStateMessages(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateFunctionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockFunctionService.addResponse(resultOperation); + + Function function = Function.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Function actualResponse = client.updateFunctionAsync(function, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFunctionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateFunctionRequest actualRequest = ((UpdateFunctionRequest) actualRequests.get(0)); + + Assert.assertEquals(function, actualRequest.getFunction()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateFunctionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFunctionService.addException(exception); + + try { + Function function = Function.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateFunctionAsync(function, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteFunctionTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteFunctionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockFunctionService.addResponse(resultOperation); + + FunctionName name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + + client.deleteFunctionAsync(name).get(); + + List actualRequests = mockFunctionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteFunctionRequest actualRequest = ((DeleteFunctionRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteFunctionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFunctionService.addException(exception); + + try { + FunctionName name = FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + client.deleteFunctionAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteFunctionTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteFunctionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockFunctionService.addResponse(resultOperation); + + String name = "name3373707"; + + client.deleteFunctionAsync(name).get(); + + List actualRequests = mockFunctionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteFunctionRequest actualRequest = ((DeleteFunctionRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteFunctionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFunctionService.addException(exception); + + try { + String name = "name3373707"; + client.deleteFunctionAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void generateUploadUrlTest() throws Exception { + GenerateUploadUrlResponse expectedResponse = + GenerateUploadUrlResponse.newBuilder() + .setUploadUrl("uploadUrl1239085998") + .setStorageSource(StorageSource.newBuilder().build()) + .build(); + mockFunctionService.addResponse(expectedResponse); + + GenerateUploadUrlRequest request = + GenerateUploadUrlRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .build(); + + GenerateUploadUrlResponse actualResponse = client.generateUploadUrl(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFunctionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GenerateUploadUrlRequest actualRequest = ((GenerateUploadUrlRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void generateUploadUrlExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFunctionService.addException(exception); + + try { + GenerateUploadUrlRequest request = + GenerateUploadUrlRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .build(); + client.generateUploadUrl(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void generateDownloadUrlTest() throws Exception { + GenerateDownloadUrlResponse expectedResponse = + GenerateDownloadUrlResponse.newBuilder().setDownloadUrl("downloadUrl-1211148345").build(); + mockFunctionService.addResponse(expectedResponse); + + GenerateDownloadUrlRequest request = + GenerateDownloadUrlRequest.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .build(); + + GenerateDownloadUrlResponse actualResponse = client.generateDownloadUrl(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFunctionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GenerateDownloadUrlRequest actualRequest = ((GenerateDownloadUrlRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void generateDownloadUrlExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFunctionService.addException(exception); + + try { + GenerateDownloadUrlRequest request = + GenerateDownloadUrlRequest.newBuilder() + .setName(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .build(); + client.generateDownloadUrl(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listRuntimesTest() throws Exception { + ListRuntimesResponse expectedResponse = + ListRuntimesResponse.newBuilder() + .addAllRuntimes(new ArrayList()) + .build(); + mockFunctionService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListRuntimesResponse actualResponse = client.listRuntimes(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFunctionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListRuntimesRequest actualRequest = ((ListRuntimesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listRuntimesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFunctionService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listRuntimes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listRuntimesTest2() throws Exception { + ListRuntimesResponse expectedResponse = + ListRuntimesResponse.newBuilder() + .addAllRuntimes(new ArrayList()) + .build(); + mockFunctionService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListRuntimesResponse actualResponse = client.listRuntimes(parent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFunctionService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListRuntimesRequest actualRequest = ((ListRuntimesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listRuntimesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFunctionService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listRuntimes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockIAMPolicy.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(FunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/google-cloud-functions/src/test/java/com/google/cloud/functions/v2beta/MockFunctionService.java b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2beta/MockFunctionService.java new file mode 100644 index 00000000..b2ff383c --- /dev/null +++ b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2beta/MockFunctionService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v2beta; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockFunctionService implements MockGrpcService { + private final MockFunctionServiceImpl serviceImpl; + + public MockFunctionService() { + serviceImpl = new MockFunctionServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-functions/src/test/java/com/google/cloud/functions/v2beta/MockFunctionServiceImpl.java b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2beta/MockFunctionServiceImpl.java new file mode 100644 index 00000000..35e435a2 --- /dev/null +++ b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2beta/MockFunctionServiceImpl.java @@ -0,0 +1,230 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v2beta; + +import com.google.api.core.BetaApi; +import com.google.cloud.functions.v2beta.FunctionServiceGrpc.FunctionServiceImplBase; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockFunctionServiceImpl extends FunctionServiceImplBase { + private List requests; + private Queue responses; + + public MockFunctionServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void getFunction(GetFunctionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Function) { + requests.add(request); + responseObserver.onNext(((Function) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetFunction, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Function.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listFunctions( + ListFunctionsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListFunctionsResponse) { + requests.add(request); + responseObserver.onNext(((ListFunctionsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListFunctions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListFunctionsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createFunction( + CreateFunctionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateFunction, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateFunction( + UpdateFunctionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateFunction, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteFunction( + DeleteFunctionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteFunction, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void generateUploadUrl( + GenerateUploadUrlRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof GenerateUploadUrlResponse) { + requests.add(request); + responseObserver.onNext(((GenerateUploadUrlResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GenerateUploadUrl, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + GenerateUploadUrlResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void generateDownloadUrl( + GenerateDownloadUrlRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof GenerateDownloadUrlResponse) { + requests.add(request); + responseObserver.onNext(((GenerateDownloadUrlResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GenerateDownloadUrl, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + GenerateDownloadUrlResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listRuntimes( + ListRuntimesRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListRuntimesResponse) { + requests.add(request); + responseObserver.onNext(((ListRuntimesResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListRuntimes, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListRuntimesResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/google-cloud-functions/src/test/java/com/google/cloud/functions/v2beta/MockIAMPolicy.java b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2beta/MockIAMPolicy.java new file mode 100644 index 00000000..7b119ea7 --- /dev/null +++ b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2beta/MockIAMPolicy.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v2beta; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockIAMPolicy implements MockGrpcService { + private final MockIAMPolicyImpl serviceImpl; + + public MockIAMPolicy() { + serviceImpl = new MockIAMPolicyImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-functions/src/test/java/com/google/cloud/functions/v2beta/MockIAMPolicyImpl.java b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2beta/MockIAMPolicyImpl.java new file mode 100644 index 00000000..f7d2331c --- /dev/null +++ b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2beta/MockIAMPolicyImpl.java @@ -0,0 +1,127 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v2beta; + +import com.google.api.core.BetaApi; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.IAMPolicyGrpc.IAMPolicyImplBase; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockIAMPolicyImpl extends IAMPolicyImplBase { + private List requests; + private Queue responses; + + public MockIAMPolicyImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void testIamPermissions( + TestIamPermissionsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof TestIamPermissionsResponse) { + requests.add(request); + responseObserver.onNext(((TestIamPermissionsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method TestIamPermissions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + TestIamPermissionsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void setIamPolicy(SetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getIamPolicy(GetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/google-cloud-functions/src/test/java/com/google/cloud/functions/v2beta/MockLocations.java b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2beta/MockLocations.java new file mode 100644 index 00000000..4cc07491 --- /dev/null +++ b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2beta/MockLocations.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v2beta; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocations implements MockGrpcService { + private final MockLocationsImpl serviceImpl; + + public MockLocations() { + serviceImpl = new MockLocationsImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-functions/src/test/java/com/google/cloud/functions/v2beta/MockLocationsImpl.java b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2beta/MockLocationsImpl.java new file mode 100644 index 00000000..3935f942 --- /dev/null +++ b/google-cloud-functions/src/test/java/com/google/cloud/functions/v2beta/MockLocationsImpl.java @@ -0,0 +1,83 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v2beta; + +import com.google.api.core.BetaApi; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.LocationsGrpc.LocationsImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocationsImpl extends LocationsImplBase { + private List requests; + private Queue responses; + + public MockLocationsImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void listLocations( + ListLocationsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListLocationsResponse) { + requests.add(request); + responseObserver.onNext(((ListLocationsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListLocations, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListLocationsResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/grpc-google-cloud-functions-v2alpha/pom.xml b/grpc-google-cloud-functions-v2alpha/pom.xml new file mode 100644 index 00000000..aaf6355e --- /dev/null +++ b/grpc-google-cloud-functions-v2alpha/pom.xml @@ -0,0 +1,69 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-functions-v2alpha + 2.4.2-SNAPSHOT + grpc-google-cloud-functions-v2alpha + GRPC library for google-cloud-functions + + com.google.cloud + google-cloud-functions-parent + 2.4.2-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-cloud-functions-v2alpha + + + com.google.guava + guava + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/grpc-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/FunctionServiceGrpc.java b/grpc-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/FunctionServiceGrpc.java new file mode 100644 index 00000000..cc0d18d5 --- /dev/null +++ b/grpc-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/FunctionServiceGrpc.java @@ -0,0 +1,1309 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.functions.v2alpha; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Google Cloud Functions is used to deploy functions that are executed by
+ * Google in response to various events. Data connected with that event is
+ * passed to a function as the input data.
+ * A **function** is a resource which describes a function that should be
+ * executed and how it is triggered.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/functions/v2alpha/functions.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class FunctionServiceGrpc { + + private FunctionServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.functions.v2alpha.FunctionService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.functions.v2alpha.GetFunctionRequest, + com.google.cloud.functions.v2alpha.Function> + getGetFunctionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetFunction", + requestType = com.google.cloud.functions.v2alpha.GetFunctionRequest.class, + responseType = com.google.cloud.functions.v2alpha.Function.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.functions.v2alpha.GetFunctionRequest, + com.google.cloud.functions.v2alpha.Function> + getGetFunctionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.functions.v2alpha.GetFunctionRequest, + com.google.cloud.functions.v2alpha.Function> + getGetFunctionMethod; + if ((getGetFunctionMethod = FunctionServiceGrpc.getGetFunctionMethod) == null) { + synchronized (FunctionServiceGrpc.class) { + if ((getGetFunctionMethod = FunctionServiceGrpc.getGetFunctionMethod) == null) { + FunctionServiceGrpc.getGetFunctionMethod = + getGetFunctionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetFunction")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v2alpha.GetFunctionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v2alpha.Function.getDefaultInstance())) + .setSchemaDescriptor( + new FunctionServiceMethodDescriptorSupplier("GetFunction")) + .build(); + } + } + } + return getGetFunctionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.functions.v2alpha.ListFunctionsRequest, + com.google.cloud.functions.v2alpha.ListFunctionsResponse> + getListFunctionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListFunctions", + requestType = com.google.cloud.functions.v2alpha.ListFunctionsRequest.class, + responseType = com.google.cloud.functions.v2alpha.ListFunctionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.functions.v2alpha.ListFunctionsRequest, + com.google.cloud.functions.v2alpha.ListFunctionsResponse> + getListFunctionsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.functions.v2alpha.ListFunctionsRequest, + com.google.cloud.functions.v2alpha.ListFunctionsResponse> + getListFunctionsMethod; + if ((getListFunctionsMethod = FunctionServiceGrpc.getListFunctionsMethod) == null) { + synchronized (FunctionServiceGrpc.class) { + if ((getListFunctionsMethod = FunctionServiceGrpc.getListFunctionsMethod) == null) { + FunctionServiceGrpc.getListFunctionsMethod = + getListFunctionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListFunctions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v2alpha.ListFunctionsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v2alpha.ListFunctionsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new FunctionServiceMethodDescriptorSupplier("ListFunctions")) + .build(); + } + } + } + return getListFunctionsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.functions.v2alpha.CreateFunctionRequest, + com.google.longrunning.Operation> + getCreateFunctionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateFunction", + requestType = com.google.cloud.functions.v2alpha.CreateFunctionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.functions.v2alpha.CreateFunctionRequest, + com.google.longrunning.Operation> + getCreateFunctionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.functions.v2alpha.CreateFunctionRequest, + com.google.longrunning.Operation> + getCreateFunctionMethod; + if ((getCreateFunctionMethod = FunctionServiceGrpc.getCreateFunctionMethod) == null) { + synchronized (FunctionServiceGrpc.class) { + if ((getCreateFunctionMethod = FunctionServiceGrpc.getCreateFunctionMethod) == null) { + FunctionServiceGrpc.getCreateFunctionMethod = + getCreateFunctionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateFunction")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v2alpha.CreateFunctionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new FunctionServiceMethodDescriptorSupplier("CreateFunction")) + .build(); + } + } + } + return getCreateFunctionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.functions.v2alpha.UpdateFunctionRequest, + com.google.longrunning.Operation> + getUpdateFunctionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateFunction", + requestType = com.google.cloud.functions.v2alpha.UpdateFunctionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.functions.v2alpha.UpdateFunctionRequest, + com.google.longrunning.Operation> + getUpdateFunctionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.functions.v2alpha.UpdateFunctionRequest, + com.google.longrunning.Operation> + getUpdateFunctionMethod; + if ((getUpdateFunctionMethod = FunctionServiceGrpc.getUpdateFunctionMethod) == null) { + synchronized (FunctionServiceGrpc.class) { + if ((getUpdateFunctionMethod = FunctionServiceGrpc.getUpdateFunctionMethod) == null) { + FunctionServiceGrpc.getUpdateFunctionMethod = + getUpdateFunctionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateFunction")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v2alpha.UpdateFunctionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new FunctionServiceMethodDescriptorSupplier("UpdateFunction")) + .build(); + } + } + } + return getUpdateFunctionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.functions.v2alpha.DeleteFunctionRequest, + com.google.longrunning.Operation> + getDeleteFunctionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteFunction", + requestType = com.google.cloud.functions.v2alpha.DeleteFunctionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.functions.v2alpha.DeleteFunctionRequest, + com.google.longrunning.Operation> + getDeleteFunctionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.functions.v2alpha.DeleteFunctionRequest, + com.google.longrunning.Operation> + getDeleteFunctionMethod; + if ((getDeleteFunctionMethod = FunctionServiceGrpc.getDeleteFunctionMethod) == null) { + synchronized (FunctionServiceGrpc.class) { + if ((getDeleteFunctionMethod = FunctionServiceGrpc.getDeleteFunctionMethod) == null) { + FunctionServiceGrpc.getDeleteFunctionMethod = + getDeleteFunctionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteFunction")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v2alpha.DeleteFunctionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new FunctionServiceMethodDescriptorSupplier("DeleteFunction")) + .build(); + } + } + } + return getDeleteFunctionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest, + com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse> + getGenerateUploadUrlMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GenerateUploadUrl", + requestType = com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest.class, + responseType = com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest, + com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse> + getGenerateUploadUrlMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest, + com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse> + getGenerateUploadUrlMethod; + if ((getGenerateUploadUrlMethod = FunctionServiceGrpc.getGenerateUploadUrlMethod) == null) { + synchronized (FunctionServiceGrpc.class) { + if ((getGenerateUploadUrlMethod = FunctionServiceGrpc.getGenerateUploadUrlMethod) == null) { + FunctionServiceGrpc.getGenerateUploadUrlMethod = + getGenerateUploadUrlMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GenerateUploadUrl")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new FunctionServiceMethodDescriptorSupplier("GenerateUploadUrl")) + .build(); + } + } + } + return getGenerateUploadUrlMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest, + com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse> + getGenerateDownloadUrlMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GenerateDownloadUrl", + requestType = com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest.class, + responseType = com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest, + com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse> + getGenerateDownloadUrlMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest, + com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse> + getGenerateDownloadUrlMethod; + if ((getGenerateDownloadUrlMethod = FunctionServiceGrpc.getGenerateDownloadUrlMethod) == null) { + synchronized (FunctionServiceGrpc.class) { + if ((getGenerateDownloadUrlMethod = FunctionServiceGrpc.getGenerateDownloadUrlMethod) + == null) { + FunctionServiceGrpc.getGenerateDownloadUrlMethod = + getGenerateDownloadUrlMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GenerateDownloadUrl")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new FunctionServiceMethodDescriptorSupplier("GenerateDownloadUrl")) + .build(); + } + } + } + return getGenerateDownloadUrlMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.functions.v2alpha.ListRuntimesRequest, + com.google.cloud.functions.v2alpha.ListRuntimesResponse> + getListRuntimesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListRuntimes", + requestType = com.google.cloud.functions.v2alpha.ListRuntimesRequest.class, + responseType = com.google.cloud.functions.v2alpha.ListRuntimesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.functions.v2alpha.ListRuntimesRequest, + com.google.cloud.functions.v2alpha.ListRuntimesResponse> + getListRuntimesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.functions.v2alpha.ListRuntimesRequest, + com.google.cloud.functions.v2alpha.ListRuntimesResponse> + getListRuntimesMethod; + if ((getListRuntimesMethod = FunctionServiceGrpc.getListRuntimesMethod) == null) { + synchronized (FunctionServiceGrpc.class) { + if ((getListRuntimesMethod = FunctionServiceGrpc.getListRuntimesMethod) == null) { + FunctionServiceGrpc.getListRuntimesMethod = + getListRuntimesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListRuntimes")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v2alpha.ListRuntimesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v2alpha.ListRuntimesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new FunctionServiceMethodDescriptorSupplier("ListRuntimes")) + .build(); + } + } + } + return getListRuntimesMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static FunctionServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public FunctionServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new FunctionServiceStub(channel, callOptions); + } + }; + return FunctionServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static FunctionServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public FunctionServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new FunctionServiceBlockingStub(channel, callOptions); + } + }; + return FunctionServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static FunctionServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public FunctionServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new FunctionServiceFutureStub(channel, callOptions); + } + }; + return FunctionServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Google Cloud Functions is used to deploy functions that are executed by
+   * Google in response to various events. Data connected with that event is
+   * passed to a function as the input data.
+   * A **function** is a resource which describes a function that should be
+   * executed and how it is triggered.
+   * 
+ */ + public abstract static class FunctionServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Returns a function with the given name from the requested project.
+     * 
+ */ + public void getFunction( + com.google.cloud.functions.v2alpha.GetFunctionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetFunctionMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns a list of functions that belong to the requested project.
+     * 
+ */ + public void listFunctions( + com.google.cloud.functions.v2alpha.ListFunctionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListFunctionsMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new function. If a function with the given name already exists in
+     * the specified project, the long running operation will return
+     * `ALREADY_EXISTS` error.
+     * 
+ */ + public void createFunction( + com.google.cloud.functions.v2alpha.CreateFunctionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateFunctionMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates existing function.
+     * 
+ */ + public void updateFunction( + com.google.cloud.functions.v2alpha.UpdateFunctionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateFunctionMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a function with the given name from the specified project. If the
+     * given function is used by some trigger, the trigger will be updated to
+     * remove this function.
+     * 
+ */ + public void deleteFunction( + com.google.cloud.functions.v2alpha.DeleteFunctionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteFunctionMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns a signed URL for uploading a function source code.
+     * For more information about the signed URL usage see:
+     * https://cloud.google.com/storage/docs/access-control/signed-urls.
+     * Once the function source code upload is complete, the used signed
+     * URL should be provided in CreateFunction or UpdateFunction request
+     * as a reference to the function source code.
+     * When uploading source code to the generated signed URL, please follow
+     * these restrictions:
+     * * Source file type should be a zip file.
+     * * No credentials should be attached - the signed URLs provide access to the
+     *   target bucket using internal service identity; if credentials were
+     *   attached, the identity from the credentials would be used, but that
+     *   identity does not have permissions to upload files to the URL.
+     * When making a HTTP PUT request, these two headers need to be specified:
+     * * `content-type: application/zip`
+     * And this header SHOULD NOT be specified:
+     * * `Authorization: Bearer YOUR_TOKEN`
+     * 
+ */ + public void generateUploadUrl( + com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGenerateUploadUrlMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns a signed URL for downloading deployed function source code.
+     * The URL is only valid for a limited period and should be used within
+     * 30 minutes of generation.
+     * For more information about the signed URL usage see:
+     * https://cloud.google.com/storage/docs/access-control/signed-urls
+     * 
+ */ + public void generateDownloadUrl( + com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGenerateDownloadUrlMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns a list of runtimes that are supported for the requested project.
+     * 
+ */ + public void listRuntimes( + com.google.cloud.functions.v2alpha.ListRuntimesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListRuntimesMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getGetFunctionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.functions.v2alpha.GetFunctionRequest, + com.google.cloud.functions.v2alpha.Function>(this, METHODID_GET_FUNCTION))) + .addMethod( + getListFunctionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.functions.v2alpha.ListFunctionsRequest, + com.google.cloud.functions.v2alpha.ListFunctionsResponse>( + this, METHODID_LIST_FUNCTIONS))) + .addMethod( + getCreateFunctionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.functions.v2alpha.CreateFunctionRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_FUNCTION))) + .addMethod( + getUpdateFunctionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.functions.v2alpha.UpdateFunctionRequest, + com.google.longrunning.Operation>(this, METHODID_UPDATE_FUNCTION))) + .addMethod( + getDeleteFunctionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.functions.v2alpha.DeleteFunctionRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_FUNCTION))) + .addMethod( + getGenerateUploadUrlMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest, + com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse>( + this, METHODID_GENERATE_UPLOAD_URL))) + .addMethod( + getGenerateDownloadUrlMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest, + com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse>( + this, METHODID_GENERATE_DOWNLOAD_URL))) + .addMethod( + getListRuntimesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.functions.v2alpha.ListRuntimesRequest, + com.google.cloud.functions.v2alpha.ListRuntimesResponse>( + this, METHODID_LIST_RUNTIMES))) + .build(); + } + } + + /** + * + * + *
+   * Google Cloud Functions is used to deploy functions that are executed by
+   * Google in response to various events. Data connected with that event is
+   * passed to a function as the input data.
+   * A **function** is a resource which describes a function that should be
+   * executed and how it is triggered.
+   * 
+ */ + public static final class FunctionServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private FunctionServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected FunctionServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new FunctionServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns a function with the given name from the requested project.
+     * 
+ */ + public void getFunction( + com.google.cloud.functions.v2alpha.GetFunctionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetFunctionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns a list of functions that belong to the requested project.
+     * 
+ */ + public void listFunctions( + com.google.cloud.functions.v2alpha.ListFunctionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListFunctionsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a new function. If a function with the given name already exists in
+     * the specified project, the long running operation will return
+     * `ALREADY_EXISTS` error.
+     * 
+ */ + public void createFunction( + com.google.cloud.functions.v2alpha.CreateFunctionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateFunctionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates existing function.
+     * 
+ */ + public void updateFunction( + com.google.cloud.functions.v2alpha.UpdateFunctionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateFunctionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a function with the given name from the specified project. If the
+     * given function is used by some trigger, the trigger will be updated to
+     * remove this function.
+     * 
+ */ + public void deleteFunction( + com.google.cloud.functions.v2alpha.DeleteFunctionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteFunctionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns a signed URL for uploading a function source code.
+     * For more information about the signed URL usage see:
+     * https://cloud.google.com/storage/docs/access-control/signed-urls.
+     * Once the function source code upload is complete, the used signed
+     * URL should be provided in CreateFunction or UpdateFunction request
+     * as a reference to the function source code.
+     * When uploading source code to the generated signed URL, please follow
+     * these restrictions:
+     * * Source file type should be a zip file.
+     * * No credentials should be attached - the signed URLs provide access to the
+     *   target bucket using internal service identity; if credentials were
+     *   attached, the identity from the credentials would be used, but that
+     *   identity does not have permissions to upload files to the URL.
+     * When making a HTTP PUT request, these two headers need to be specified:
+     * * `content-type: application/zip`
+     * And this header SHOULD NOT be specified:
+     * * `Authorization: Bearer YOUR_TOKEN`
+     * 
+ */ + public void generateUploadUrl( + com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGenerateUploadUrlMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns a signed URL for downloading deployed function source code.
+     * The URL is only valid for a limited period and should be used within
+     * 30 minutes of generation.
+     * For more information about the signed URL usage see:
+     * https://cloud.google.com/storage/docs/access-control/signed-urls
+     * 
+ */ + public void generateDownloadUrl( + com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGenerateDownloadUrlMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns a list of runtimes that are supported for the requested project.
+     * 
+ */ + public void listRuntimes( + com.google.cloud.functions.v2alpha.ListRuntimesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListRuntimesMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Google Cloud Functions is used to deploy functions that are executed by
+   * Google in response to various events. Data connected with that event is
+   * passed to a function as the input data.
+   * A **function** is a resource which describes a function that should be
+   * executed and how it is triggered.
+   * 
+ */ + public static final class FunctionServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private FunctionServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected FunctionServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new FunctionServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns a function with the given name from the requested project.
+     * 
+ */ + public com.google.cloud.functions.v2alpha.Function getFunction( + com.google.cloud.functions.v2alpha.GetFunctionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetFunctionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns a list of functions that belong to the requested project.
+     * 
+ */ + public com.google.cloud.functions.v2alpha.ListFunctionsResponse listFunctions( + com.google.cloud.functions.v2alpha.ListFunctionsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListFunctionsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new function. If a function with the given name already exists in
+     * the specified project, the long running operation will return
+     * `ALREADY_EXISTS` error.
+     * 
+ */ + public com.google.longrunning.Operation createFunction( + com.google.cloud.functions.v2alpha.CreateFunctionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateFunctionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates existing function.
+     * 
+ */ + public com.google.longrunning.Operation updateFunction( + com.google.cloud.functions.v2alpha.UpdateFunctionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateFunctionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a function with the given name from the specified project. If the
+     * given function is used by some trigger, the trigger will be updated to
+     * remove this function.
+     * 
+ */ + public com.google.longrunning.Operation deleteFunction( + com.google.cloud.functions.v2alpha.DeleteFunctionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteFunctionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns a signed URL for uploading a function source code.
+     * For more information about the signed URL usage see:
+     * https://cloud.google.com/storage/docs/access-control/signed-urls.
+     * Once the function source code upload is complete, the used signed
+     * URL should be provided in CreateFunction or UpdateFunction request
+     * as a reference to the function source code.
+     * When uploading source code to the generated signed URL, please follow
+     * these restrictions:
+     * * Source file type should be a zip file.
+     * * No credentials should be attached - the signed URLs provide access to the
+     *   target bucket using internal service identity; if credentials were
+     *   attached, the identity from the credentials would be used, but that
+     *   identity does not have permissions to upload files to the URL.
+     * When making a HTTP PUT request, these two headers need to be specified:
+     * * `content-type: application/zip`
+     * And this header SHOULD NOT be specified:
+     * * `Authorization: Bearer YOUR_TOKEN`
+     * 
+ */ + public com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse generateUploadUrl( + com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGenerateUploadUrlMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns a signed URL for downloading deployed function source code.
+     * The URL is only valid for a limited period and should be used within
+     * 30 minutes of generation.
+     * For more information about the signed URL usage see:
+     * https://cloud.google.com/storage/docs/access-control/signed-urls
+     * 
+ */ + public com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse generateDownloadUrl( + com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGenerateDownloadUrlMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns a list of runtimes that are supported for the requested project.
+     * 
+ */ + public com.google.cloud.functions.v2alpha.ListRuntimesResponse listRuntimes( + com.google.cloud.functions.v2alpha.ListRuntimesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListRuntimesMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Google Cloud Functions is used to deploy functions that are executed by
+   * Google in response to various events. Data connected with that event is
+   * passed to a function as the input data.
+   * A **function** is a resource which describes a function that should be
+   * executed and how it is triggered.
+   * 
+ */ + public static final class FunctionServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private FunctionServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected FunctionServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new FunctionServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns a function with the given name from the requested project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.functions.v2alpha.Function> + getFunction(com.google.cloud.functions.v2alpha.GetFunctionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetFunctionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns a list of functions that belong to the requested project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.functions.v2alpha.ListFunctionsResponse> + listFunctions(com.google.cloud.functions.v2alpha.ListFunctionsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListFunctionsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new function. If a function with the given name already exists in
+     * the specified project, the long running operation will return
+     * `ALREADY_EXISTS` error.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createFunction(com.google.cloud.functions.v2alpha.CreateFunctionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateFunctionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates existing function.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateFunction(com.google.cloud.functions.v2alpha.UpdateFunctionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateFunctionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a function with the given name from the specified project. If the
+     * given function is used by some trigger, the trigger will be updated to
+     * remove this function.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteFunction(com.google.cloud.functions.v2alpha.DeleteFunctionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteFunctionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns a signed URL for uploading a function source code.
+     * For more information about the signed URL usage see:
+     * https://cloud.google.com/storage/docs/access-control/signed-urls.
+     * Once the function source code upload is complete, the used signed
+     * URL should be provided in CreateFunction or UpdateFunction request
+     * as a reference to the function source code.
+     * When uploading source code to the generated signed URL, please follow
+     * these restrictions:
+     * * Source file type should be a zip file.
+     * * No credentials should be attached - the signed URLs provide access to the
+     *   target bucket using internal service identity; if credentials were
+     *   attached, the identity from the credentials would be used, but that
+     *   identity does not have permissions to upload files to the URL.
+     * When making a HTTP PUT request, these two headers need to be specified:
+     * * `content-type: application/zip`
+     * And this header SHOULD NOT be specified:
+     * * `Authorization: Bearer YOUR_TOKEN`
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse> + generateUploadUrl(com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGenerateUploadUrlMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns a signed URL for downloading deployed function source code.
+     * The URL is only valid for a limited period and should be used within
+     * 30 minutes of generation.
+     * For more information about the signed URL usage see:
+     * https://cloud.google.com/storage/docs/access-control/signed-urls
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse> + generateDownloadUrl(com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGenerateDownloadUrlMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns a list of runtimes that are supported for the requested project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.functions.v2alpha.ListRuntimesResponse> + listRuntimes(com.google.cloud.functions.v2alpha.ListRuntimesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListRuntimesMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_GET_FUNCTION = 0; + private static final int METHODID_LIST_FUNCTIONS = 1; + private static final int METHODID_CREATE_FUNCTION = 2; + private static final int METHODID_UPDATE_FUNCTION = 3; + private static final int METHODID_DELETE_FUNCTION = 4; + private static final int METHODID_GENERATE_UPLOAD_URL = 5; + private static final int METHODID_GENERATE_DOWNLOAD_URL = 6; + private static final int METHODID_LIST_RUNTIMES = 7; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final FunctionServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(FunctionServiceImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_GET_FUNCTION: + serviceImpl.getFunction( + (com.google.cloud.functions.v2alpha.GetFunctionRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_FUNCTIONS: + serviceImpl.listFunctions( + (com.google.cloud.functions.v2alpha.ListFunctionsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.functions.v2alpha.ListFunctionsResponse>) + responseObserver); + break; + case METHODID_CREATE_FUNCTION: + serviceImpl.createFunction( + (com.google.cloud.functions.v2alpha.CreateFunctionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_FUNCTION: + serviceImpl.updateFunction( + (com.google.cloud.functions.v2alpha.UpdateFunctionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_FUNCTION: + serviceImpl.deleteFunction( + (com.google.cloud.functions.v2alpha.DeleteFunctionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GENERATE_UPLOAD_URL: + serviceImpl.generateUploadUrl( + (com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse>) + responseObserver); + break; + case METHODID_GENERATE_DOWNLOAD_URL: + serviceImpl.generateDownloadUrl( + (com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse>) + responseObserver); + break; + case METHODID_LIST_RUNTIMES: + serviceImpl.listRuntimes( + (com.google.cloud.functions.v2alpha.ListRuntimesRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class FunctionServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + FunctionServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("FunctionService"); + } + } + + private static final class FunctionServiceFileDescriptorSupplier + extends FunctionServiceBaseDescriptorSupplier { + FunctionServiceFileDescriptorSupplier() {} + } + + private static final class FunctionServiceMethodDescriptorSupplier + extends FunctionServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + FunctionServiceMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (FunctionServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new FunctionServiceFileDescriptorSupplier()) + .addMethod(getGetFunctionMethod()) + .addMethod(getListFunctionsMethod()) + .addMethod(getCreateFunctionMethod()) + .addMethod(getUpdateFunctionMethod()) + .addMethod(getDeleteFunctionMethod()) + .addMethod(getGenerateUploadUrlMethod()) + .addMethod(getGenerateDownloadUrlMethod()) + .addMethod(getListRuntimesMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/grpc-google-cloud-functions-v2beta/pom.xml b/grpc-google-cloud-functions-v2beta/pom.xml new file mode 100644 index 00000000..a980629b --- /dev/null +++ b/grpc-google-cloud-functions-v2beta/pom.xml @@ -0,0 +1,69 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-functions-v2beta + 2.4.2-SNAPSHOT + grpc-google-cloud-functions-v2beta + GRPC library for google-cloud-functions + + com.google.cloud + google-cloud-functions-parent + 2.4.2-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-cloud-functions-v2beta + + + com.google.guava + guava + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/grpc-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/FunctionServiceGrpc.java b/grpc-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/FunctionServiceGrpc.java new file mode 100644 index 00000000..1b00ba30 --- /dev/null +++ b/grpc-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/FunctionServiceGrpc.java @@ -0,0 +1,1302 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.functions.v2beta; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Google Cloud Functions is used to deploy functions that are executed by
+ * Google in response to various events. Data connected with that event is
+ * passed to a function as the input data.
+ * A **function** is a resource which describes a function that should be
+ * executed and how it is triggered.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/functions/v2beta/functions.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class FunctionServiceGrpc { + + private FunctionServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.functions.v2beta.FunctionService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.functions.v2beta.GetFunctionRequest, + com.google.cloud.functions.v2beta.Function> + getGetFunctionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetFunction", + requestType = com.google.cloud.functions.v2beta.GetFunctionRequest.class, + responseType = com.google.cloud.functions.v2beta.Function.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.functions.v2beta.GetFunctionRequest, + com.google.cloud.functions.v2beta.Function> + getGetFunctionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.functions.v2beta.GetFunctionRequest, + com.google.cloud.functions.v2beta.Function> + getGetFunctionMethod; + if ((getGetFunctionMethod = FunctionServiceGrpc.getGetFunctionMethod) == null) { + synchronized (FunctionServiceGrpc.class) { + if ((getGetFunctionMethod = FunctionServiceGrpc.getGetFunctionMethod) == null) { + FunctionServiceGrpc.getGetFunctionMethod = + getGetFunctionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetFunction")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v2beta.GetFunctionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v2beta.Function.getDefaultInstance())) + .setSchemaDescriptor( + new FunctionServiceMethodDescriptorSupplier("GetFunction")) + .build(); + } + } + } + return getGetFunctionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.functions.v2beta.ListFunctionsRequest, + com.google.cloud.functions.v2beta.ListFunctionsResponse> + getListFunctionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListFunctions", + requestType = com.google.cloud.functions.v2beta.ListFunctionsRequest.class, + responseType = com.google.cloud.functions.v2beta.ListFunctionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.functions.v2beta.ListFunctionsRequest, + com.google.cloud.functions.v2beta.ListFunctionsResponse> + getListFunctionsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.functions.v2beta.ListFunctionsRequest, + com.google.cloud.functions.v2beta.ListFunctionsResponse> + getListFunctionsMethod; + if ((getListFunctionsMethod = FunctionServiceGrpc.getListFunctionsMethod) == null) { + synchronized (FunctionServiceGrpc.class) { + if ((getListFunctionsMethod = FunctionServiceGrpc.getListFunctionsMethod) == null) { + FunctionServiceGrpc.getListFunctionsMethod = + getListFunctionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListFunctions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v2beta.ListFunctionsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v2beta.ListFunctionsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new FunctionServiceMethodDescriptorSupplier("ListFunctions")) + .build(); + } + } + } + return getListFunctionsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.functions.v2beta.CreateFunctionRequest, com.google.longrunning.Operation> + getCreateFunctionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateFunction", + requestType = com.google.cloud.functions.v2beta.CreateFunctionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.functions.v2beta.CreateFunctionRequest, com.google.longrunning.Operation> + getCreateFunctionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.functions.v2beta.CreateFunctionRequest, + com.google.longrunning.Operation> + getCreateFunctionMethod; + if ((getCreateFunctionMethod = FunctionServiceGrpc.getCreateFunctionMethod) == null) { + synchronized (FunctionServiceGrpc.class) { + if ((getCreateFunctionMethod = FunctionServiceGrpc.getCreateFunctionMethod) == null) { + FunctionServiceGrpc.getCreateFunctionMethod = + getCreateFunctionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateFunction")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v2beta.CreateFunctionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new FunctionServiceMethodDescriptorSupplier("CreateFunction")) + .build(); + } + } + } + return getCreateFunctionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.functions.v2beta.UpdateFunctionRequest, com.google.longrunning.Operation> + getUpdateFunctionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateFunction", + requestType = com.google.cloud.functions.v2beta.UpdateFunctionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.functions.v2beta.UpdateFunctionRequest, com.google.longrunning.Operation> + getUpdateFunctionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.functions.v2beta.UpdateFunctionRequest, + com.google.longrunning.Operation> + getUpdateFunctionMethod; + if ((getUpdateFunctionMethod = FunctionServiceGrpc.getUpdateFunctionMethod) == null) { + synchronized (FunctionServiceGrpc.class) { + if ((getUpdateFunctionMethod = FunctionServiceGrpc.getUpdateFunctionMethod) == null) { + FunctionServiceGrpc.getUpdateFunctionMethod = + getUpdateFunctionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateFunction")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v2beta.UpdateFunctionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new FunctionServiceMethodDescriptorSupplier("UpdateFunction")) + .build(); + } + } + } + return getUpdateFunctionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.functions.v2beta.DeleteFunctionRequest, com.google.longrunning.Operation> + getDeleteFunctionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteFunction", + requestType = com.google.cloud.functions.v2beta.DeleteFunctionRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.functions.v2beta.DeleteFunctionRequest, com.google.longrunning.Operation> + getDeleteFunctionMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.functions.v2beta.DeleteFunctionRequest, + com.google.longrunning.Operation> + getDeleteFunctionMethod; + if ((getDeleteFunctionMethod = FunctionServiceGrpc.getDeleteFunctionMethod) == null) { + synchronized (FunctionServiceGrpc.class) { + if ((getDeleteFunctionMethod = FunctionServiceGrpc.getDeleteFunctionMethod) == null) { + FunctionServiceGrpc.getDeleteFunctionMethod = + getDeleteFunctionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteFunction")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v2beta.DeleteFunctionRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new FunctionServiceMethodDescriptorSupplier("DeleteFunction")) + .build(); + } + } + } + return getDeleteFunctionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.functions.v2beta.GenerateUploadUrlRequest, + com.google.cloud.functions.v2beta.GenerateUploadUrlResponse> + getGenerateUploadUrlMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GenerateUploadUrl", + requestType = com.google.cloud.functions.v2beta.GenerateUploadUrlRequest.class, + responseType = com.google.cloud.functions.v2beta.GenerateUploadUrlResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.functions.v2beta.GenerateUploadUrlRequest, + com.google.cloud.functions.v2beta.GenerateUploadUrlResponse> + getGenerateUploadUrlMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.functions.v2beta.GenerateUploadUrlRequest, + com.google.cloud.functions.v2beta.GenerateUploadUrlResponse> + getGenerateUploadUrlMethod; + if ((getGenerateUploadUrlMethod = FunctionServiceGrpc.getGenerateUploadUrlMethod) == null) { + synchronized (FunctionServiceGrpc.class) { + if ((getGenerateUploadUrlMethod = FunctionServiceGrpc.getGenerateUploadUrlMethod) == null) { + FunctionServiceGrpc.getGenerateUploadUrlMethod = + getGenerateUploadUrlMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GenerateUploadUrl")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v2beta.GenerateUploadUrlRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v2beta.GenerateUploadUrlResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new FunctionServiceMethodDescriptorSupplier("GenerateUploadUrl")) + .build(); + } + } + } + return getGenerateUploadUrlMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest, + com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse> + getGenerateDownloadUrlMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GenerateDownloadUrl", + requestType = com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest.class, + responseType = com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest, + com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse> + getGenerateDownloadUrlMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest, + com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse> + getGenerateDownloadUrlMethod; + if ((getGenerateDownloadUrlMethod = FunctionServiceGrpc.getGenerateDownloadUrlMethod) == null) { + synchronized (FunctionServiceGrpc.class) { + if ((getGenerateDownloadUrlMethod = FunctionServiceGrpc.getGenerateDownloadUrlMethod) + == null) { + FunctionServiceGrpc.getGenerateDownloadUrlMethod = + getGenerateDownloadUrlMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GenerateDownloadUrl")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new FunctionServiceMethodDescriptorSupplier("GenerateDownloadUrl")) + .build(); + } + } + } + return getGenerateDownloadUrlMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.functions.v2beta.ListRuntimesRequest, + com.google.cloud.functions.v2beta.ListRuntimesResponse> + getListRuntimesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListRuntimes", + requestType = com.google.cloud.functions.v2beta.ListRuntimesRequest.class, + responseType = com.google.cloud.functions.v2beta.ListRuntimesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.functions.v2beta.ListRuntimesRequest, + com.google.cloud.functions.v2beta.ListRuntimesResponse> + getListRuntimesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.functions.v2beta.ListRuntimesRequest, + com.google.cloud.functions.v2beta.ListRuntimesResponse> + getListRuntimesMethod; + if ((getListRuntimesMethod = FunctionServiceGrpc.getListRuntimesMethod) == null) { + synchronized (FunctionServiceGrpc.class) { + if ((getListRuntimesMethod = FunctionServiceGrpc.getListRuntimesMethod) == null) { + FunctionServiceGrpc.getListRuntimesMethod = + getListRuntimesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListRuntimes")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v2beta.ListRuntimesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.functions.v2beta.ListRuntimesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new FunctionServiceMethodDescriptorSupplier("ListRuntimes")) + .build(); + } + } + } + return getListRuntimesMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static FunctionServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public FunctionServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new FunctionServiceStub(channel, callOptions); + } + }; + return FunctionServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static FunctionServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public FunctionServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new FunctionServiceBlockingStub(channel, callOptions); + } + }; + return FunctionServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static FunctionServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public FunctionServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new FunctionServiceFutureStub(channel, callOptions); + } + }; + return FunctionServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Google Cloud Functions is used to deploy functions that are executed by
+   * Google in response to various events. Data connected with that event is
+   * passed to a function as the input data.
+   * A **function** is a resource which describes a function that should be
+   * executed and how it is triggered.
+   * 
+ */ + public abstract static class FunctionServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Returns a function with the given name from the requested project.
+     * 
+ */ + public void getFunction( + com.google.cloud.functions.v2beta.GetFunctionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetFunctionMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns a list of functions that belong to the requested project.
+     * 
+ */ + public void listFunctions( + com.google.cloud.functions.v2beta.ListFunctionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListFunctionsMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new function. If a function with the given name already exists in
+     * the specified project, the long running operation will return
+     * `ALREADY_EXISTS` error.
+     * 
+ */ + public void createFunction( + com.google.cloud.functions.v2beta.CreateFunctionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateFunctionMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates existing function.
+     * 
+ */ + public void updateFunction( + com.google.cloud.functions.v2beta.UpdateFunctionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateFunctionMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a function with the given name from the specified project. If the
+     * given function is used by some trigger, the trigger will be updated to
+     * remove this function.
+     * 
+ */ + public void deleteFunction( + com.google.cloud.functions.v2beta.DeleteFunctionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteFunctionMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns a signed URL for uploading a function source code.
+     * For more information about the signed URL usage see:
+     * https://cloud.google.com/storage/docs/access-control/signed-urls.
+     * Once the function source code upload is complete, the used signed
+     * URL should be provided in CreateFunction or UpdateFunction request
+     * as a reference to the function source code.
+     * When uploading source code to the generated signed URL, please follow
+     * these restrictions:
+     * * Source file type should be a zip file.
+     * * No credentials should be attached - the signed URLs provide access to the
+     *   target bucket using internal service identity; if credentials were
+     *   attached, the identity from the credentials would be used, but that
+     *   identity does not have permissions to upload files to the URL.
+     * When making a HTTP PUT request, these two headers need to be specified:
+     * * `content-type: application/zip`
+     * And this header SHOULD NOT be specified:
+     * * `Authorization: Bearer YOUR_TOKEN`
+     * 
+ */ + public void generateUploadUrl( + com.google.cloud.functions.v2beta.GenerateUploadUrlRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGenerateUploadUrlMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns a signed URL for downloading deployed function source code.
+     * The URL is only valid for a limited period and should be used within
+     * 30 minutes of generation.
+     * For more information about the signed URL usage see:
+     * https://cloud.google.com/storage/docs/access-control/signed-urls
+     * 
+ */ + public void generateDownloadUrl( + com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGenerateDownloadUrlMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns a list of runtimes that are supported for the requested project.
+     * 
+ */ + public void listRuntimes( + com.google.cloud.functions.v2beta.ListRuntimesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListRuntimesMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getGetFunctionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.functions.v2beta.GetFunctionRequest, + com.google.cloud.functions.v2beta.Function>(this, METHODID_GET_FUNCTION))) + .addMethod( + getListFunctionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.functions.v2beta.ListFunctionsRequest, + com.google.cloud.functions.v2beta.ListFunctionsResponse>( + this, METHODID_LIST_FUNCTIONS))) + .addMethod( + getCreateFunctionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.functions.v2beta.CreateFunctionRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_FUNCTION))) + .addMethod( + getUpdateFunctionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.functions.v2beta.UpdateFunctionRequest, + com.google.longrunning.Operation>(this, METHODID_UPDATE_FUNCTION))) + .addMethod( + getDeleteFunctionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.functions.v2beta.DeleteFunctionRequest, + com.google.longrunning.Operation>(this, METHODID_DELETE_FUNCTION))) + .addMethod( + getGenerateUploadUrlMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.functions.v2beta.GenerateUploadUrlRequest, + com.google.cloud.functions.v2beta.GenerateUploadUrlResponse>( + this, METHODID_GENERATE_UPLOAD_URL))) + .addMethod( + getGenerateDownloadUrlMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest, + com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse>( + this, METHODID_GENERATE_DOWNLOAD_URL))) + .addMethod( + getListRuntimesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.functions.v2beta.ListRuntimesRequest, + com.google.cloud.functions.v2beta.ListRuntimesResponse>( + this, METHODID_LIST_RUNTIMES))) + .build(); + } + } + + /** + * + * + *
+   * Google Cloud Functions is used to deploy functions that are executed by
+   * Google in response to various events. Data connected with that event is
+   * passed to a function as the input data.
+   * A **function** is a resource which describes a function that should be
+   * executed and how it is triggered.
+   * 
+ */ + public static final class FunctionServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private FunctionServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected FunctionServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new FunctionServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns a function with the given name from the requested project.
+     * 
+ */ + public void getFunction( + com.google.cloud.functions.v2beta.GetFunctionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetFunctionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns a list of functions that belong to the requested project.
+     * 
+ */ + public void listFunctions( + com.google.cloud.functions.v2beta.ListFunctionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListFunctionsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a new function. If a function with the given name already exists in
+     * the specified project, the long running operation will return
+     * `ALREADY_EXISTS` error.
+     * 
+ */ + public void createFunction( + com.google.cloud.functions.v2beta.CreateFunctionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateFunctionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates existing function.
+     * 
+ */ + public void updateFunction( + com.google.cloud.functions.v2beta.UpdateFunctionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateFunctionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a function with the given name from the specified project. If the
+     * given function is used by some trigger, the trigger will be updated to
+     * remove this function.
+     * 
+ */ + public void deleteFunction( + com.google.cloud.functions.v2beta.DeleteFunctionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteFunctionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns a signed URL for uploading a function source code.
+     * For more information about the signed URL usage see:
+     * https://cloud.google.com/storage/docs/access-control/signed-urls.
+     * Once the function source code upload is complete, the used signed
+     * URL should be provided in CreateFunction or UpdateFunction request
+     * as a reference to the function source code.
+     * When uploading source code to the generated signed URL, please follow
+     * these restrictions:
+     * * Source file type should be a zip file.
+     * * No credentials should be attached - the signed URLs provide access to the
+     *   target bucket using internal service identity; if credentials were
+     *   attached, the identity from the credentials would be used, but that
+     *   identity does not have permissions to upload files to the URL.
+     * When making a HTTP PUT request, these two headers need to be specified:
+     * * `content-type: application/zip`
+     * And this header SHOULD NOT be specified:
+     * * `Authorization: Bearer YOUR_TOKEN`
+     * 
+ */ + public void generateUploadUrl( + com.google.cloud.functions.v2beta.GenerateUploadUrlRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGenerateUploadUrlMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns a signed URL for downloading deployed function source code.
+     * The URL is only valid for a limited period and should be used within
+     * 30 minutes of generation.
+     * For more information about the signed URL usage see:
+     * https://cloud.google.com/storage/docs/access-control/signed-urls
+     * 
+ */ + public void generateDownloadUrl( + com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGenerateDownloadUrlMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns a list of runtimes that are supported for the requested project.
+     * 
+ */ + public void listRuntimes( + com.google.cloud.functions.v2beta.ListRuntimesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListRuntimesMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Google Cloud Functions is used to deploy functions that are executed by
+   * Google in response to various events. Data connected with that event is
+   * passed to a function as the input data.
+   * A **function** is a resource which describes a function that should be
+   * executed and how it is triggered.
+   * 
+ */ + public static final class FunctionServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private FunctionServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected FunctionServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new FunctionServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns a function with the given name from the requested project.
+     * 
+ */ + public com.google.cloud.functions.v2beta.Function getFunction( + com.google.cloud.functions.v2beta.GetFunctionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetFunctionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns a list of functions that belong to the requested project.
+     * 
+ */ + public com.google.cloud.functions.v2beta.ListFunctionsResponse listFunctions( + com.google.cloud.functions.v2beta.ListFunctionsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListFunctionsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new function. If a function with the given name already exists in
+     * the specified project, the long running operation will return
+     * `ALREADY_EXISTS` error.
+     * 
+ */ + public com.google.longrunning.Operation createFunction( + com.google.cloud.functions.v2beta.CreateFunctionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateFunctionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates existing function.
+     * 
+ */ + public com.google.longrunning.Operation updateFunction( + com.google.cloud.functions.v2beta.UpdateFunctionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateFunctionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a function with the given name from the specified project. If the
+     * given function is used by some trigger, the trigger will be updated to
+     * remove this function.
+     * 
+ */ + public com.google.longrunning.Operation deleteFunction( + com.google.cloud.functions.v2beta.DeleteFunctionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteFunctionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns a signed URL for uploading a function source code.
+     * For more information about the signed URL usage see:
+     * https://cloud.google.com/storage/docs/access-control/signed-urls.
+     * Once the function source code upload is complete, the used signed
+     * URL should be provided in CreateFunction or UpdateFunction request
+     * as a reference to the function source code.
+     * When uploading source code to the generated signed URL, please follow
+     * these restrictions:
+     * * Source file type should be a zip file.
+     * * No credentials should be attached - the signed URLs provide access to the
+     *   target bucket using internal service identity; if credentials were
+     *   attached, the identity from the credentials would be used, but that
+     *   identity does not have permissions to upload files to the URL.
+     * When making a HTTP PUT request, these two headers need to be specified:
+     * * `content-type: application/zip`
+     * And this header SHOULD NOT be specified:
+     * * `Authorization: Bearer YOUR_TOKEN`
+     * 
+ */ + public com.google.cloud.functions.v2beta.GenerateUploadUrlResponse generateUploadUrl( + com.google.cloud.functions.v2beta.GenerateUploadUrlRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGenerateUploadUrlMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns a signed URL for downloading deployed function source code.
+     * The URL is only valid for a limited period and should be used within
+     * 30 minutes of generation.
+     * For more information about the signed URL usage see:
+     * https://cloud.google.com/storage/docs/access-control/signed-urls
+     * 
+ */ + public com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse generateDownloadUrl( + com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGenerateDownloadUrlMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns a list of runtimes that are supported for the requested project.
+     * 
+ */ + public com.google.cloud.functions.v2beta.ListRuntimesResponse listRuntimes( + com.google.cloud.functions.v2beta.ListRuntimesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListRuntimesMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Google Cloud Functions is used to deploy functions that are executed by
+   * Google in response to various events. Data connected with that event is
+   * passed to a function as the input data.
+   * A **function** is a resource which describes a function that should be
+   * executed and how it is triggered.
+   * 
+ */ + public static final class FunctionServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private FunctionServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected FunctionServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new FunctionServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Returns a function with the given name from the requested project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.functions.v2beta.Function> + getFunction(com.google.cloud.functions.v2beta.GetFunctionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetFunctionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns a list of functions that belong to the requested project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.functions.v2beta.ListFunctionsResponse> + listFunctions(com.google.cloud.functions.v2beta.ListFunctionsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListFunctionsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new function. If a function with the given name already exists in
+     * the specified project, the long running operation will return
+     * `ALREADY_EXISTS` error.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createFunction(com.google.cloud.functions.v2beta.CreateFunctionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateFunctionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates existing function.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateFunction(com.google.cloud.functions.v2beta.UpdateFunctionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateFunctionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a function with the given name from the specified project. If the
+     * given function is used by some trigger, the trigger will be updated to
+     * remove this function.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteFunction(com.google.cloud.functions.v2beta.DeleteFunctionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteFunctionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns a signed URL for uploading a function source code.
+     * For more information about the signed URL usage see:
+     * https://cloud.google.com/storage/docs/access-control/signed-urls.
+     * Once the function source code upload is complete, the used signed
+     * URL should be provided in CreateFunction or UpdateFunction request
+     * as a reference to the function source code.
+     * When uploading source code to the generated signed URL, please follow
+     * these restrictions:
+     * * Source file type should be a zip file.
+     * * No credentials should be attached - the signed URLs provide access to the
+     *   target bucket using internal service identity; if credentials were
+     *   attached, the identity from the credentials would be used, but that
+     *   identity does not have permissions to upload files to the URL.
+     * When making a HTTP PUT request, these two headers need to be specified:
+     * * `content-type: application/zip`
+     * And this header SHOULD NOT be specified:
+     * * `Authorization: Bearer YOUR_TOKEN`
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.functions.v2beta.GenerateUploadUrlResponse> + generateUploadUrl(com.google.cloud.functions.v2beta.GenerateUploadUrlRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGenerateUploadUrlMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns a signed URL for downloading deployed function source code.
+     * The URL is only valid for a limited period and should be used within
+     * 30 minutes of generation.
+     * For more information about the signed URL usage see:
+     * https://cloud.google.com/storage/docs/access-control/signed-urls
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse> + generateDownloadUrl(com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGenerateDownloadUrlMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns a list of runtimes that are supported for the requested project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.functions.v2beta.ListRuntimesResponse> + listRuntimes(com.google.cloud.functions.v2beta.ListRuntimesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListRuntimesMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_GET_FUNCTION = 0; + private static final int METHODID_LIST_FUNCTIONS = 1; + private static final int METHODID_CREATE_FUNCTION = 2; + private static final int METHODID_UPDATE_FUNCTION = 3; + private static final int METHODID_DELETE_FUNCTION = 4; + private static final int METHODID_GENERATE_UPLOAD_URL = 5; + private static final int METHODID_GENERATE_DOWNLOAD_URL = 6; + private static final int METHODID_LIST_RUNTIMES = 7; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final FunctionServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(FunctionServiceImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_GET_FUNCTION: + serviceImpl.getFunction( + (com.google.cloud.functions.v2beta.GetFunctionRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_FUNCTIONS: + serviceImpl.listFunctions( + (com.google.cloud.functions.v2beta.ListFunctionsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_CREATE_FUNCTION: + serviceImpl.createFunction( + (com.google.cloud.functions.v2beta.CreateFunctionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_FUNCTION: + serviceImpl.updateFunction( + (com.google.cloud.functions.v2beta.UpdateFunctionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_FUNCTION: + serviceImpl.deleteFunction( + (com.google.cloud.functions.v2beta.DeleteFunctionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GENERATE_UPLOAD_URL: + serviceImpl.generateUploadUrl( + (com.google.cloud.functions.v2beta.GenerateUploadUrlRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.functions.v2beta.GenerateUploadUrlResponse>) + responseObserver); + break; + case METHODID_GENERATE_DOWNLOAD_URL: + serviceImpl.generateDownloadUrl( + (com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse>) + responseObserver); + break; + case METHODID_LIST_RUNTIMES: + serviceImpl.listRuntimes( + (com.google.cloud.functions.v2beta.ListRuntimesRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class FunctionServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + FunctionServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("FunctionService"); + } + } + + private static final class FunctionServiceFileDescriptorSupplier + extends FunctionServiceBaseDescriptorSupplier { + FunctionServiceFileDescriptorSupplier() {} + } + + private static final class FunctionServiceMethodDescriptorSupplier + extends FunctionServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + FunctionServiceMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (FunctionServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new FunctionServiceFileDescriptorSupplier()) + .addMethod(getGetFunctionMethod()) + .addMethod(getListFunctionsMethod()) + .addMethod(getCreateFunctionMethod()) + .addMethod(getUpdateFunctionMethod()) + .addMethod(getDeleteFunctionMethod()) + .addMethod(getGenerateUploadUrlMethod()) + .addMethod(getGenerateDownloadUrlMethod()) + .addMethod(getListRuntimesMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/pom.xml b/pom.xml index c0093b4d..f39817ea 100644 --- a/pom.xml +++ b/pom.xml @@ -63,6 +63,26 @@ google-cloud-functions 2.4.2-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-functions-v2alpha + 2.4.2-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-functions-v2beta + 2.4.2-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-functions-v2alpha + 2.4.2-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-functions-v2beta + 2.4.2-SNAPSHOT + com.google.api.grpc proto-google-cloud-functions-v1 @@ -111,7 +131,11 @@ google-cloud-functions grpc-google-cloud-functions-v1 + grpc-google-cloud-functions-v2beta + grpc-google-cloud-functions-v2alpha proto-google-cloud-functions-v1 + proto-google-cloud-functions-v2beta + proto-google-cloud-functions-v2alpha google-cloud-functions-bom diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CloudFunction.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CloudFunction.java index f6b609b8..bcb223da 100644 --- a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CloudFunction.java +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CloudFunction.java @@ -24,7 +24,6 @@ *
  * Describes a Cloud Function that contains user computation executed in
  * response to an event. It encapsulate function and triggers configurations.
- * Next tag: 36
  * 
* * Protobuf type {@code google.cloud.functions.v1.CloudFunction} @@ -58,6 +57,7 @@ private CloudFunction() { secretVolumes_ = java.util.Collections.emptyList(); sourceToken_ = ""; dockerRepository_ = ""; + dockerRegistry_ = 0; } @java.lang.Override @@ -390,6 +390,13 @@ private CloudFunction( dockerRepository_ = s; break; } + case 280: + { + int rawValue = input.readEnum(); + + dockerRegistry_ = rawValue; + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -795,6 +802,173 @@ private IngressSettings(int value) { // @@protoc_insertion_point(enum_scope:google.cloud.functions.v1.CloudFunction.IngressSettings) } + /** + * + * + *
+   * Docker Registry to use for storing function Docker images.
+   * 
+ * + * Protobuf enum {@code google.cloud.functions.v1.CloudFunction.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.v1.CloudFunction.getDescriptor().getEnumTypes().get(2); + } + + 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.v1.CloudFunction.DockerRegistry) + } + private int sourceCodeCase_ = 0; private java.lang.Object sourceCode_; @@ -2233,8 +2407,9 @@ public com.google.cloud.functions.v1.CloudFunction.IngressSettings getIngressSet * If specified, you must also provide an artifact registry repository using * the `docker_repository` field that was created with the same KMS crypto * key. - * The following service accounts need to be granted Cloud KMS crypto key - * encrypter/decrypter roles on the key. + * The following service accounts need to be granted the role 'Cloud KMS + * CryptoKey Encrypter/Decrypter (roles/cloudkms.cryptoKeyEncrypterDecrypter)' + * on the Key/KeyRing/Project/Organization (least access preferred). * 1. Google Cloud Functions service account * (service-{project_number}@gcf-admin-robot.iam.gserviceaccount.com) - * Required to protect the function's image. @@ -2278,8 +2453,9 @@ public java.lang.String getKmsKeyName() { * If specified, you must also provide an artifact registry repository using * the `docker_repository` field that was created with the same KMS crypto * key. - * The following service accounts need to be granted Cloud KMS crypto key - * encrypter/decrypter roles on the key. + * The following service accounts need to be granted the role 'Cloud KMS + * CryptoKey Encrypter/Decrypter (roles/cloudkms.cryptoKeyEncrypterDecrypter)' + * on the Key/KeyRing/Project/Organization (least access preferred). * 1. Google Cloud Functions service account * (service-{project_number}@gcf-admin-robot.iam.gserviceaccount.com) - * Required to protect the function's image. @@ -2749,6 +2925,52 @@ public com.google.protobuf.ByteString getDockerRepositoryBytes() { } } + public static final int DOCKER_REGISTRY_FIELD_NUMBER = 35; + private int dockerRegistry_; + /** + * + * + *
+   * Docker Registry to use for this deployment.
+   * 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.v1.CloudFunction.DockerRegistry docker_registry = 35; + * + * @return The enum numeric value on the wire for dockerRegistry. + */ + @java.lang.Override + public int getDockerRegistryValue() { + return dockerRegistry_; + } + /** + * + * + *
+   * Docker Registry to use for this deployment.
+   * 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.v1.CloudFunction.DockerRegistry docker_registry = 35; + * + * @return The dockerRegistry. + */ + @java.lang.Override + public com.google.cloud.functions.v1.CloudFunction.DockerRegistry getDockerRegistry() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v1.CloudFunction.DockerRegistry result = + com.google.cloud.functions.v1.CloudFunction.DockerRegistry.valueOf(dockerRegistry_); + return result == null + ? com.google.cloud.functions.v1.CloudFunction.DockerRegistry.UNRECOGNIZED + : result; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -2869,6 +3091,11 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dockerRepository_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 34, dockerRepository_); } + if (dockerRegistry_ + != com.google.cloud.functions.v1.CloudFunction.DockerRegistry.DOCKER_REGISTRY_UNSPECIFIED + .getNumber()) { + output.writeEnum(35, dockerRegistry_); + } unknownFields.writeTo(output); } @@ -3012,6 +3239,11 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dockerRepository_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(34, dockerRepository_); } + if (dockerRegistry_ + != com.google.cloud.functions.v1.CloudFunction.DockerRegistry.DOCKER_REGISTRY_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(35, dockerRegistry_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -3064,6 +3296,7 @@ public boolean equals(final java.lang.Object obj) { if (!getSecretVolumesList().equals(other.getSecretVolumesList())) return false; if (!getSourceToken().equals(other.getSourceToken())) return false; if (!getDockerRepository().equals(other.getDockerRepository())) return false; + if (dockerRegistry_ != other.dockerRegistry_) return false; if (!getSourceCodeCase().equals(other.getSourceCodeCase())) return false; switch (sourceCodeCase_) { case 3: @@ -3168,6 +3401,8 @@ public int hashCode() { hash = (53 * hash) + getSourceToken().hashCode(); hash = (37 * hash) + DOCKER_REPOSITORY_FIELD_NUMBER; hash = (53 * hash) + getDockerRepository().hashCode(); + hash = (37 * hash) + DOCKER_REGISTRY_FIELD_NUMBER; + hash = (53 * hash) + dockerRegistry_; switch (sourceCodeCase_) { case 3: hash = (37 * hash) + SOURCE_ARCHIVE_URL_FIELD_NUMBER; @@ -3302,7 +3537,6 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build *
    * Describes a Cloud Function that contains user computation executed in
    * response to an event. It encapsulate function and triggers configurations.
-   * Next tag: 36
    * 
* * Protobuf type {@code google.cloud.functions.v1.CloudFunction} @@ -3441,6 +3675,8 @@ public Builder clear() { dockerRepository_ = ""; + dockerRegistry_ = 0; + sourceCodeCase_ = 0; sourceCode_ = null; triggerCase_ = 0; @@ -3555,6 +3791,7 @@ public com.google.cloud.functions.v1.CloudFunction buildPartial() { } result.sourceToken_ = sourceToken_; result.dockerRepository_ = dockerRepository_; + result.dockerRegistry_ = dockerRegistry_; result.sourceCodeCase_ = sourceCodeCase_; result.triggerCase_ = triggerCase_; onBuilt(); @@ -3743,6 +3980,9 @@ public Builder mergeFrom(com.google.cloud.functions.v1.CloudFunction other) { dockerRepository_ = other.dockerRepository_; onChanged(); } + if (other.dockerRegistry_ != 0) { + setDockerRegistryValue(other.getDockerRegistryValue()); + } switch (other.getSourceCodeCase()) { case SOURCE_ARCHIVE_URL: { @@ -7123,8 +7363,9 @@ public Builder clearIngressSettings() { * If specified, you must also provide an artifact registry repository using * the `docker_repository` field that was created with the same KMS crypto * key. - * The following service accounts need to be granted Cloud KMS crypto key - * encrypter/decrypter roles on the key. + * The following service accounts need to be granted the role 'Cloud KMS + * CryptoKey Encrypter/Decrypter (roles/cloudkms.cryptoKeyEncrypterDecrypter)' + * on the Key/KeyRing/Project/Organization (least access preferred). * 1. Google Cloud Functions service account * (service-{project_number}@gcf-admin-robot.iam.gserviceaccount.com) - * Required to protect the function's image. @@ -7167,8 +7408,9 @@ public java.lang.String getKmsKeyName() { * If specified, you must also provide an artifact registry repository using * the `docker_repository` field that was created with the same KMS crypto * key. - * The following service accounts need to be granted Cloud KMS crypto key - * encrypter/decrypter roles on the key. + * The following service accounts need to be granted the role 'Cloud KMS + * CryptoKey Encrypter/Decrypter (roles/cloudkms.cryptoKeyEncrypterDecrypter)' + * on the Key/KeyRing/Project/Organization (least access preferred). * 1. Google Cloud Functions service account * (service-{project_number}@gcf-admin-robot.iam.gserviceaccount.com) - * Required to protect the function's image. @@ -7211,8 +7453,9 @@ public com.google.protobuf.ByteString getKmsKeyNameBytes() { * If specified, you must also provide an artifact registry repository using * the `docker_repository` field that was created with the same KMS crypto * key. - * The following service accounts need to be granted Cloud KMS crypto key - * encrypter/decrypter roles on the key. + * The following service accounts need to be granted the role 'Cloud KMS + * CryptoKey Encrypter/Decrypter (roles/cloudkms.cryptoKeyEncrypterDecrypter)' + * on the Key/KeyRing/Project/Organization (least access preferred). * 1. Google Cloud Functions service account * (service-{project_number}@gcf-admin-robot.iam.gserviceaccount.com) - * Required to protect the function's image. @@ -7254,8 +7497,9 @@ public Builder setKmsKeyName(java.lang.String value) { * If specified, you must also provide an artifact registry repository using * the `docker_repository` field that was created with the same KMS crypto * key. - * The following service accounts need to be granted Cloud KMS crypto key - * encrypter/decrypter roles on the key. + * The following service accounts need to be granted the role 'Cloud KMS + * CryptoKey Encrypter/Decrypter (roles/cloudkms.cryptoKeyEncrypterDecrypter)' + * on the Key/KeyRing/Project/Organization (least access preferred). * 1. Google Cloud Functions service account * (service-{project_number}@gcf-admin-robot.iam.gserviceaccount.com) - * Required to protect the function's image. @@ -7293,8 +7537,9 @@ public Builder clearKmsKeyName() { * If specified, you must also provide an artifact registry repository using * the `docker_repository` field that was created with the same KMS crypto * key. - * The following service accounts need to be granted Cloud KMS crypto key - * encrypter/decrypter roles on the key. + * The following service accounts need to be granted the role 'Cloud KMS + * CryptoKey Encrypter/Decrypter (roles/cloudkms.cryptoKeyEncrypterDecrypter)' + * on the Key/KeyRing/Project/Organization (least access preferred). * 1. Google Cloud Functions service account * (service-{project_number}@gcf-admin-robot.iam.gserviceaccount.com) - * Required to protect the function's image. @@ -8707,6 +8952,120 @@ public Builder setDockerRepositoryBytes(com.google.protobuf.ByteString value) { return this; } + private int dockerRegistry_ = 0; + /** + * + * + *
+     * Docker Registry to use for this deployment.
+     * 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.v1.CloudFunction.DockerRegistry docker_registry = 35; + * + * @return The enum numeric value on the wire for dockerRegistry. + */ + @java.lang.Override + public int getDockerRegistryValue() { + return dockerRegistry_; + } + /** + * + * + *
+     * Docker Registry to use for this deployment.
+     * 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.v1.CloudFunction.DockerRegistry docker_registry = 35; + * + * @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; + onChanged(); + return this; + } + /** + * + * + *
+     * Docker Registry to use for this deployment.
+     * 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.v1.CloudFunction.DockerRegistry docker_registry = 35; + * + * @return The dockerRegistry. + */ + @java.lang.Override + public com.google.cloud.functions.v1.CloudFunction.DockerRegistry getDockerRegistry() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v1.CloudFunction.DockerRegistry result = + com.google.cloud.functions.v1.CloudFunction.DockerRegistry.valueOf(dockerRegistry_); + return result == null + ? com.google.cloud.functions.v1.CloudFunction.DockerRegistry.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Docker Registry to use for this deployment.
+     * 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.v1.CloudFunction.DockerRegistry docker_registry = 35; + * + * @param value The dockerRegistry to set. + * @return This builder for chaining. + */ + public Builder setDockerRegistry( + com.google.cloud.functions.v1.CloudFunction.DockerRegistry value) { + if (value == null) { + throw new NullPointerException(); + } + + dockerRegistry_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Docker Registry to use for this deployment.
+     * 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.v1.CloudFunction.DockerRegistry docker_registry = 35; + * + * @return This builder for chaining. + */ + public Builder clearDockerRegistry() { + + dockerRegistry_ = 0; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CloudFunctionOrBuilder.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CloudFunctionOrBuilder.java index b56d6954..d0182ca1 100644 --- a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CloudFunctionOrBuilder.java +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CloudFunctionOrBuilder.java @@ -872,8 +872,9 @@ java.lang.String getBuildEnvironmentVariablesOrDefault( * If specified, you must also provide an artifact registry repository using * the `docker_repository` field that was created with the same KMS crypto * key. - * The following service accounts need to be granted Cloud KMS crypto key - * encrypter/decrypter roles on the key. + * The following service accounts need to be granted the role 'Cloud KMS + * CryptoKey Encrypter/Decrypter (roles/cloudkms.cryptoKeyEncrypterDecrypter)' + * on the Key/KeyRing/Project/Organization (least access preferred). * 1. Google Cloud Functions service account * (service-{project_number}@gcf-admin-robot.iam.gserviceaccount.com) - * Required to protect the function's image. @@ -906,8 +907,9 @@ java.lang.String getBuildEnvironmentVariablesOrDefault( * If specified, you must also provide an artifact registry repository using * the `docker_repository` field that was created with the same KMS crypto * key. - * The following service accounts need to be granted Cloud KMS crypto key - * encrypter/decrypter roles on the key. + * The following service accounts need to be granted the role 'Cloud KMS + * CryptoKey Encrypter/Decrypter (roles/cloudkms.cryptoKeyEncrypterDecrypter)' + * on the Key/KeyRing/Project/Organization (least access preferred). * 1. Google Cloud Functions service account * (service-{project_number}@gcf-admin-robot.iam.gserviceaccount.com) - * Required to protect the function's image. @@ -1211,6 +1213,39 @@ com.google.cloud.functions.v1.SecretEnvVarOrBuilder getSecretEnvironmentVariable */ com.google.protobuf.ByteString getDockerRepositoryBytes(); + /** + * + * + *
+   * Docker Registry to use for this deployment.
+   * 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.v1.CloudFunction.DockerRegistry docker_registry = 35; + * + * @return The enum numeric value on the wire for dockerRegistry. + */ + int getDockerRegistryValue(); + /** + * + * + *
+   * Docker Registry to use for this deployment.
+   * 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.v1.CloudFunction.DockerRegistry docker_registry = 35; + * + * @return The dockerRegistry. + */ + com.google.cloud.functions.v1.CloudFunction.DockerRegistry getDockerRegistry(); + public com.google.cloud.functions.v1.CloudFunction.SourceCodeCase getSourceCodeCase(); public com.google.cloud.functions.v1.CloudFunction.TriggerCase getTriggerCase(); diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CryptoKeyName.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/CryptoKeyName.java new file mode 100644 index 00000000..6f358a37 --- /dev/null +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/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.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +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/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/FunctionsOperationsProto.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/FunctionsOperationsProto.java index 7df7b3dd..4606d134 100644 --- a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/FunctionsOperationsProto.java +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/FunctionsOperationsProto.java @@ -43,20 +43,19 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "\n*google/cloud/functions/v1/operations.p" + "roto\022\031google.cloud.functions.v1\032\031google/" + "protobuf/any.proto\032\037google/protobuf/time" - + "stamp.proto\032\034google/api/annotations.prot" - + "o\"\205\002\n\023OperationMetadataV1\022\016\n\006target\030\001 \001(" - + "\t\0226\n\004type\030\002 \001(\0162(.google.cloud.functions" - + ".v1.OperationType\022%\n\007request\030\003 \001(\0132\024.goo" - + "gle.protobuf.Any\022\022\n\nversion_id\030\004 \001(\003\022/\n\013" - + "update_time\030\005 \001(\0132\032.google.protobuf.Time" - + "stamp\022\020\n\010build_id\030\006 \001(\t\022\024\n\014source_token\030" - + "\007 \001(\t\022\022\n\nbuild_name\030\010 \001(\t*i\n\rOperationTy" - + "pe\022\031\n\025OPERATION_UNSPECIFIED\020\000\022\023\n\017CREATE_" - + "FUNCTION\020\001\022\023\n\017UPDATE_FUNCTION\020\002\022\023\n\017DELET" - + "E_FUNCTION\020\003B\177\n\035com.google.cloud.functio" - + "ns.v1B\030FunctionsOperationsProtoP\001ZBgoogl" - + "e.golang.org/genproto/googleapis/cloud/f" - + "unctions/v1;functionsb\006proto3" + + "stamp.proto\"\205\002\n\023OperationMetadataV1\022\016\n\006t" + + "arget\030\001 \001(\t\0226\n\004type\030\002 \001(\0162(.google.cloud" + + ".functions.v1.OperationType\022%\n\007request\030\003" + + " \001(\0132\024.google.protobuf.Any\022\022\n\nversion_id" + + "\030\004 \001(\003\022/\n\013update_time\030\005 \001(\0132\032.google.pro" + + "tobuf.Timestamp\022\020\n\010build_id\030\006 \001(\t\022\024\n\014sou" + + "rce_token\030\007 \001(\t\022\022\n\nbuild_name\030\010 \001(\t*i\n\rO" + + "perationType\022\031\n\025OPERATION_UNSPECIFIED\020\000\022" + + "\023\n\017CREATE_FUNCTION\020\001\022\023\n\017UPDATE_FUNCTION\020" + + "\002\022\023\n\017DELETE_FUNCTION\020\003B\177\n\035com.google.clo" + + "ud.functions.v1B\030FunctionsOperationsProt" + + "oP\001ZBgoogle.golang.org/genproto/googleap" + + "is/cloud/functions/v1;functionsb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -64,7 +63,6 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.protobuf.AnyProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), - com.google.api.AnnotationsProto.getDescriptor(), }); internal_static_google_cloud_functions_v1_OperationMetadataV1_descriptor = getDescriptor().getMessageTypes().get(0); @@ -83,7 +81,6 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { }); com.google.protobuf.AnyProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); - com.google.api.AnnotationsProto.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/FunctionsProto.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/FunctionsProto.java index 9ec1709b..e299f42c 100644 --- a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/FunctionsProto.java +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/FunctionsProto.java @@ -141,7 +141,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "proto\032#google/longrunning/operations.pro" + "to\032\036google/protobuf/duration.proto\032 goog" + "le/protobuf/field_mask.proto\032\037google/pro" - + "tobuf/timestamp.proto\"\263\020\n\rCloudFunction\022" + + "tobuf/timestamp.proto\"\347\021\n\rCloudFunction\022" + "\014\n\004name\030\001 \001(\t\022\023\n\013description\030\002 \001(\t\022\034\n\022so" + "urce_archive_url\030\003 \001(\tH\000\022H\n\021source_repos" + "itory\030\004 \001(\0132+.google.cloud.functions.v1." @@ -180,136 +180,142 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "d.functions.v1.SecretVolume\022\031\n\014source_to" + "ken\030\037 \001(\tB\003\340A\004\022J\n\021docker_repository\030\" \001(" + "\tB/\372A,\n*artifactregistry.googleapis.com/" - + "Repository\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r" - + "\n\005value\030\002 \001(\t:\0028\001\032;\n\031EnvironmentVariable" - + "sEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\032@" - + "\n\036BuildEnvironmentVariablesEntry\022\013\n\003key\030" - + "\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"u\n\032VpcConnector" - + "EgressSettings\022-\n)VPC_CONNECTOR_EGRESS_S" - + "ETTINGS_UNSPECIFIED\020\000\022\027\n\023PRIVATE_RANGES_" - + "ONLY\020\001\022\017\n\013ALL_TRAFFIC\020\002\"x\n\017IngressSettin" - + "gs\022 \n\034INGRESS_SETTINGS_UNSPECIFIED\020\000\022\r\n\t" - + "ALLOW_ALL\020\001\022\027\n\023ALLOW_INTERNAL_ONLY\020\002\022\033\n\027" - + "ALLOW_INTERNAL_AND_GCLB\020\003:n\352Ak\n+cloudfun" - + "ctions.googleapis.com/CloudFunction\022\n\032GenerateDow" - + "nloadUrlRequest\022\014\n\004name\030\001 \001(\t\022\022\n\nversion" - + "_id\030\002 \001(\004\"3\n\033GenerateDownloadUrlResponse" - + "\022\024\n\014download_url\030\001 \001(\t*\222\001\n\023CloudFunction" - + "Status\022%\n!CLOUD_FUNCTION_STATUS_UNSPECIF" - + "IED\020\000\022\n\n\006ACTIVE\020\001\022\013\n\007OFFLINE\020\002\022\026\n\022DEPLOY" - + "_IN_PROGRESS\020\003\022\026\n\022DELETE_IN_PROGRESS\020\004\022\013" - + "\n\007UNKNOWN\020\0052\227\021\n\025CloudFunctionsService\022\251\001" - + "\n\rListFunctions\022/.google.cloud.functions" - + ".v1.ListFunctionsRequest\0320.google.cloud." - + "functions.v1.ListFunctionsResponse\"5\202\323\344\223" - + "\002/\022-/v1/{parent=projects/*/locations/*}/" - + "functions\022\244\001\n\013GetFunction\022-.google.cloud" - + ".functions.v1.GetFunctionRequest\032(.googl" - + "e.cloud.functions.v1.CloudFunction\"<\202\323\344\223" - + "\002/\022-/v1/{name=projects/*/locations/*/fun" - + "ctions/*}\332A\004name\022\337\001\n\016CreateFunction\0220.go" - + "ogle.cloud.functions.v1.CreateFunctionRe" - + "quest\032\035.google.longrunning.Operation\"|\202\323" - + "\344\223\002;\"//v1/{location=projects/*/locations" - + "/*}/functions:\010function\332A\021location,funct" - + "ion\312A$\n\rCloudFunction\022\023OperationMetadata" - + "V1\022\335\001\n\016UpdateFunction\0220.google.cloud.fun" - + "ctions.v1.UpdateFunctionRequest\032\035.google" - + ".longrunning.Operation\"z\202\323\344\223\002B26/v1/{fun" - + "ction.name=projects/*/locations/*/functi" - + "ons/*}:\010function\332A\010function\312A$\n\rCloudFun" - + "ction\022\023OperationMetadataV1\022\316\001\n\016DeleteFun" - + "ction\0220.google.cloud.functions.v1.Delete" - + "FunctionRequest\032\035.google.longrunning.Ope" - + "ration\"k\202\323\344\223\002/*-/v1/{name=projects/*/loc" - + "ations/*/functions/*}\332A\004name\312A,\n\025google." - + "protobuf.Empty\022\023OperationMetadataV1\022\272\001\n\014" - + "CallFunction\022..google.cloud.functions.v1" - + ".CallFunctionRequest\032/.google.cloud.func" - + "tions.v1.CallFunctionResponse\"I\202\323\344\223\0027\"2/" - + "v1/{name=projects/*/locations/*/function" - + "s/*}:call:\001*\332A\tname,data\022\312\001\n\021GenerateUpl" - + "oadUrl\0223.google.cloud.functions.v1.Gener" - + "ateUploadUrlRequest\0324.google.cloud.funct" - + "ions.v1.GenerateUploadUrlResponse\"J\202\323\344\223\002" - + "D\"?/v1/{parent=projects/*/locations/*}/f" - + "unctions:generateUploadUrl:\001*\022\322\001\n\023Genera" - + "teDownloadUrl\0225.google.cloud.functions.v" - + "1.GenerateDownloadUrlRequest\0326.google.cl" - + "oud.functions.v1.GenerateDownloadUrlResp" - + "onse\"L\202\323\344\223\002F\"A/v1/{name=projects/*/locat" - + "ions/*/functions/*}:generateDownloadUrl:" - + "\001*\022\224\001\n\014SetIamPolicy\022\".google.iam.v1.SetI" - + "amPolicyRequest\032\025.google.iam.v1.Policy\"I" - + "\202\323\344\223\002C\">/v1/{resource=projects/*/locatio" - + "ns/*/functions/*}:setIamPolicy:\001*\022\221\001\n\014Ge" - + "tIamPolicy\022\".google.iam.v1.GetIamPolicyR" - + "equest\032\025.google.iam.v1.Policy\"F\202\323\344\223\002@\022>/" - + "v1/{resource=projects/*/locations/*/func" - + "tions/*}:getIamPolicy\022\272\001\n\022TestIamPermiss" - + "ions\022(.google.iam.v1.TestIamPermissionsR" - + "equest\032).google.iam.v1.TestIamPermission" - + "sResponse\"O\202\323\344\223\002I\"D/v1/{resource=project" - + "s/*/locations/*/functions/*}:testIamPerm" - + "issions:\001*\032Q\312A\035cloudfunctions.googleapis" - + ".com\322A.https://www.googleapis.com/auth/c" - + "loud-platformB\350\002\n\035com.google.cloud.funct" - + "ions.v1B\016FunctionsProtoP\001ZBgoogle.golang" - + ".org/genproto/googleapis/cloud/functions" - + "/v1;functions\242\002\003GCF\352Ao\n*artifactregistry" - + ".googleapis.com/Repository\022Aprojects/{pr" - + "oject}/locations/{location}/repositories" - + "/{repository}\352Ax\n!cloudkms.googleapis.co" - + "m/CryptoKey\022Sprojects/{project}/location" - + "s/{location}/keyRings/{key_ring}/cryptoK" - + "eys/{crypto_key}b\006proto3" + + "Repository\022P\n\017docker_registry\030# \001(\01627.go" + + "ogle.cloud.functions.v1.CloudFunction.Do" + + "ckerRegistry\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t" + + "\022\r\n\005value\030\002 \001(\t:\0028\001\032;\n\031EnvironmentVariab" + + "lesEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001" + + "\032@\n\036BuildEnvironmentVariablesEntry\022\013\n\003ke" + + "y\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"u\n\032VpcConnect" + + "orEgressSettings\022-\n)VPC_CONNECTOR_EGRESS" + + "_SETTINGS_UNSPECIFIED\020\000\022\027\n\023PRIVATE_RANGE" + + "S_ONLY\020\001\022\017\n\013ALL_TRAFFIC\020\002\"x\n\017IngressSett" + + "ings\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\"`\n\016DockerReg" + + "istry\022\037\n\033DOCKER_REGISTRY_UNSPECIFIED\020\000\022\026" + + "\n\022CONTAINER_REGISTRY\020\001\022\025\n\021ARTIFACT_REGIS" + + "TRY\020\002:n\352Ak\n+cloudfunctions.googleapis.co" + + "m/CloudFunction\022\n\032GenerateD" + + "ownloadUrlRequest\022\014\n\004name\030\001 \001(\t\022\022\n\nversi" + + "on_id\030\002 \001(\004\"3\n\033GenerateDownloadUrlRespon" + + "se\022\024\n\014download_url\030\001 \001(\t*\222\001\n\023CloudFuncti" + + "onStatus\022%\n!CLOUD_FUNCTION_STATUS_UNSPEC" + + "IFIED\020\000\022\n\n\006ACTIVE\020\001\022\013\n\007OFFLINE\020\002\022\026\n\022DEPL" + + "OY_IN_PROGRESS\020\003\022\026\n\022DELETE_IN_PROGRESS\020\004" + + "\022\013\n\007UNKNOWN\020\0052\227\021\n\025CloudFunctionsService\022" + + "\251\001\n\rListFunctions\022/.google.cloud.functio" + + "ns.v1.ListFunctionsRequest\0320.google.clou" + + "d.functions.v1.ListFunctionsResponse\"5\202\323" + + "\344\223\002/\022-/v1/{parent=projects/*/locations/*" + + "}/functions\022\244\001\n\013GetFunction\022-.google.clo" + + "ud.functions.v1.GetFunctionRequest\032(.goo" + + "gle.cloud.functions.v1.CloudFunction\"<\202\323" + + "\344\223\002/\022-/v1/{name=projects/*/locations/*/f" + + "unctions/*}\332A\004name\022\337\001\n\016CreateFunction\0220." + + "google.cloud.functions.v1.CreateFunction" + + "Request\032\035.google.longrunning.Operation\"|" + + "\202\323\344\223\002;\"//v1/{location=projects/*/locatio" + + "ns/*}/functions:\010function\332A\021location,fun" + + "ction\312A$\n\rCloudFunction\022\023OperationMetada" + + "taV1\022\335\001\n\016UpdateFunction\0220.google.cloud.f" + + "unctions.v1.UpdateFunctionRequest\032\035.goog" + + "le.longrunning.Operation\"z\202\323\344\223\002B26/v1/{f" + + "unction.name=projects/*/locations/*/func" + + "tions/*}:\010function\332A\010function\312A$\n\rCloudF" + + "unction\022\023OperationMetadataV1\022\316\001\n\016DeleteF" + + "unction\0220.google.cloud.functions.v1.Dele" + + "teFunctionRequest\032\035.google.longrunning.O" + + "peration\"k\202\323\344\223\002/*-/v1/{name=projects/*/l" + + "ocations/*/functions/*}\332A\004name\312A,\n\025googl" + + "e.protobuf.Empty\022\023OperationMetadataV1\022\272\001" + + "\n\014CallFunction\022..google.cloud.functions." + + "v1.CallFunctionRequest\032/.google.cloud.fu" + + "nctions.v1.CallFunctionResponse\"I\202\323\344\223\0027\"" + + "2/v1/{name=projects/*/locations/*/functi" + + "ons/*}:call:\001*\332A\tname,data\022\312\001\n\021GenerateU" + + "ploadUrl\0223.google.cloud.functions.v1.Gen" + + "erateUploadUrlRequest\0324.google.cloud.fun" + + "ctions.v1.GenerateUploadUrlResponse\"J\202\323\344" + + "\223\002D\"?/v1/{parent=projects/*/locations/*}" + + "/functions:generateUploadUrl:\001*\022\322\001\n\023Gene" + + "rateDownloadUrl\0225.google.cloud.functions" + + ".v1.GenerateDownloadUrlRequest\0326.google." + + "cloud.functions.v1.GenerateDownloadUrlRe" + + "sponse\"L\202\323\344\223\002F\"A/v1/{name=projects/*/loc" + + "ations/*/functions/*}:generateDownloadUr" + + "l:\001*\022\224\001\n\014SetIamPolicy\022\".google.iam.v1.Se" + + "tIamPolicyRequest\032\025.google.iam.v1.Policy" + + "\"I\202\323\344\223\002C\">/v1/{resource=projects/*/locat" + + "ions/*/functions/*}:setIamPolicy:\001*\022\221\001\n\014" + + "GetIamPolicy\022\".google.iam.v1.GetIamPolic" + + "yRequest\032\025.google.iam.v1.Policy\"F\202\323\344\223\002@\022" + + ">/v1/{resource=projects/*/locations/*/fu" + + "nctions/*}:getIamPolicy\022\272\001\n\022TestIamPermi" + + "ssions\022(.google.iam.v1.TestIamPermission" + + "sRequest\032).google.iam.v1.TestIamPermissi" + + "onsResponse\"O\202\323\344\223\002I\"D/v1/{resource=proje" + + "cts/*/locations/*/functions/*}:testIamPe" + + "rmissions:\001*\032Q\312A\035cloudfunctions.googleap" + + "is.com\322A.https://www.googleapis.com/auth" + + "/cloud-platformB\350\002\n\035com.google.cloud.fun" + + "ctions.v1B\016FunctionsProtoP\001ZBgoogle.gola" + + "ng.org/genproto/googleapis/cloud/functio" + + "ns/v1;functions\242\002\003GCF\352Ao\n*artifactregist" + + "ry.googleapis.com/Repository\022Aprojects/{" + + "project}/locations/{location}/repositori" + + "es/{repository}\352Ax\n!cloudkms.googleapis." + + "com/CryptoKey\022Sprojects/{project}/locati" + + "ons/{location}/keyRings/{key_ring}/crypt" + + "oKeys/{crypto_key}b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -364,6 +370,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "SecretVolumes", "SourceToken", "DockerRepository", + "DockerRegistry", "SourceCode", "Trigger", }); @@ -523,7 +530,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_functions_v1_GenerateUploadUrlRequest_descriptor, new java.lang.String[] { - "Parent", + "Parent", "KmsKeyName", }); internal_static_google_cloud_functions_v1_GenerateUploadUrlResponse_descriptor = getDescriptor().getMessageTypes().get(16); diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/GenerateUploadUrlRequest.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/GenerateUploadUrlRequest.java index d3512028..acb370b5 100644 --- a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/GenerateUploadUrlRequest.java +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/GenerateUploadUrlRequest.java @@ -39,6 +39,7 @@ private GenerateUploadUrlRequest(com.google.protobuf.GeneratedMessageV3.Builder< private GenerateUploadUrlRequest() { parent_ = ""; + kmsKeyName_ = ""; } @java.lang.Override @@ -77,6 +78,13 @@ private GenerateUploadUrlRequest( parent_ = s; break; } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + kmsKeyName_ = s; + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -164,6 +172,83 @@ public com.google.protobuf.ByteString getParentBytes() { } } + public static final int KMS_KEY_NAME_FIELD_NUMBER = 2; + 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 staging Cloud Storage
+   * buckets. When you generate an upload url and upload your source code, it
+   * gets copied to a staging Cloud Storage bucket in an internal regional
+   * project. 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). GCF will
+   * delegate access to the Google Storage service account in the internal
+   * project.
+   * 
+ * + * 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 staging Cloud Storage
+   * buckets. When you generate an upload url and upload your source code, it
+   * gets copied to a staging Cloud Storage bucket in an internal regional
+   * project. 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). GCF will
+   * delegate access to the Google Storage service account in the internal
+   * project.
+   * 
+ * + * 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 @@ -181,6 +266,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_); + } unknownFields.writeTo(output); } @@ -193,6 +281,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 += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -210,6 +301,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.cloud.functions.v1.GenerateUploadUrlRequest) obj; if (!getParent().equals(other.getParent())) return false; + if (!getKmsKeyName().equals(other.getKmsKeyName())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -223,6 +315,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) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -371,6 +465,8 @@ public Builder clear() { super.clear(); parent_ = ""; + kmsKeyName_ = ""; + return this; } @@ -399,6 +495,7 @@ public com.google.cloud.functions.v1.GenerateUploadUrlRequest buildPartial() { com.google.cloud.functions.v1.GenerateUploadUrlRequest result = new com.google.cloud.functions.v1.GenerateUploadUrlRequest(this); result.parent_ = parent_; + result.kmsKeyName_ = kmsKeyName_; onBuilt(); return result; } @@ -453,6 +550,10 @@ public Builder mergeFrom(com.google.cloud.functions.v1.GenerateUploadUrlRequest parent_ = other.parent_; onChanged(); } + if (!other.getKmsKeyName().isEmpty()) { + kmsKeyName_ = other.kmsKeyName_; + onChanged(); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -594,6 +695,182 @@ 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 staging Cloud Storage
+     * buckets. When you generate an upload url and upload your source code, it
+     * gets copied to a staging Cloud Storage bucket in an internal regional
+     * project. 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). GCF will
+     * delegate access to the Google Storage service account in the internal
+     * project.
+     * 
+ * + * 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 staging Cloud Storage
+     * buckets. When you generate an upload url and upload your source code, it
+     * gets copied to a staging Cloud Storage bucket in an internal regional
+     * project. 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). GCF will
+     * delegate access to the Google Storage service account in the internal
+     * project.
+     * 
+ * + * 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 staging Cloud Storage
+     * buckets. When you generate an upload url and upload your source code, it
+     * gets copied to a staging Cloud Storage bucket in an internal regional
+     * project. 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). GCF will
+     * delegate access to the Google Storage service account in the internal
+     * project.
+     * 
+ * + * 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; + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of a KMS crypto key (managed by the user) used to
+     * encrypt/decrypt function source code objects in staging Cloud Storage
+     * buckets. When you generate an upload url and upload your source code, it
+     * gets copied to a staging Cloud Storage bucket in an internal regional
+     * project. 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). GCF will
+     * delegate access to the Google Storage service account in the internal
+     * project.
+     * 
+ * + * string kms_key_name = 2 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearKmsKeyName() { + + kmsKeyName_ = getDefaultInstance().getKmsKeyName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Resource name of a KMS crypto key (managed by the user) used to
+     * encrypt/decrypt function source code objects in staging Cloud Storage
+     * buckets. When you generate an upload url and upload your source code, it
+     * gets copied to a staging Cloud Storage bucket in an internal regional
+     * project. 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). GCF will
+     * delegate access to the Google Storage service account in the internal
+     * project.
+     * 
+ * + * 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; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/GenerateUploadUrlRequestOrBuilder.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/GenerateUploadUrlRequestOrBuilder.java index 8aaade6f..3de6432b 100644 --- a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/GenerateUploadUrlRequestOrBuilder.java +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/GenerateUploadUrlRequestOrBuilder.java @@ -49,4 +49,57 @@ 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 staging Cloud Storage
+   * buckets. When you generate an upload url and upload your source code, it
+   * gets copied to a staging Cloud Storage bucket in an internal regional
+   * project. 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). GCF will
+   * delegate access to the Google Storage service account in the internal
+   * project.
+   * 
+ * + * 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 staging Cloud Storage
+   * buckets. When you generate an upload url and upload your source code, it
+   * gets copied to a staging Cloud Storage bucket in an internal regional
+   * project. 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). GCF will
+   * delegate access to the Google Storage service account in the internal
+   * project.
+   * 
+ * + * string kms_key_name = 2 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for kmsKeyName. + */ + com.google.protobuf.ByteString getKmsKeyNameBytes(); } diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/SecretEnvVar.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/SecretEnvVar.java index a403cd5b..2d15134c 100644 --- a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/SecretEnvVar.java +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/SecretEnvVar.java @@ -24,8 +24,7 @@ *
  * Configuration for a secret environment variable. It has the information
  * necessary to fetch the secret value from secret manager and expose it as an
- * environment variable. Secret value is not a part of the configuration. Secret
- * values are only fetched when a new clone starts.
+ * environment variable.
  * 
* * Protobuf type {@code google.cloud.functions.v1.SecretEnvVar} @@ -301,7 +300,7 @@ public com.google.protobuf.ByteString getSecretBytes() { *
    * Version of the secret (version number or the string 'latest'). It is
    * recommended to use a numeric version for secret environment variables as
-   * any updates to the secret value is not reflected until new clones start.
+   * any updates to the secret value is not reflected until new instances start.
    * 
* * string version = 4; @@ -326,7 +325,7 @@ public java.lang.String getVersion() { *
    * Version of the secret (version number or the string 'latest'). It is
    * recommended to use a numeric version for secret environment variables as
-   * any updates to the secret value is not reflected until new clones start.
+   * any updates to the secret value is not reflected until new instances start.
    * 
* * string version = 4; @@ -538,8 +537,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build *
    * Configuration for a secret environment variable. It has the information
    * necessary to fetch the secret value from secret manager and expose it as an
-   * environment variable. Secret value is not a part of the configuration. Secret
-   * values are only fetched when a new clone starts.
+   * environment variable.
    * 
* * Protobuf type {@code google.cloud.functions.v1.SecretEnvVar} @@ -1053,7 +1051,7 @@ public Builder setSecretBytes(com.google.protobuf.ByteString value) { *
      * Version of the secret (version number or the string 'latest'). It is
      * recommended to use a numeric version for secret environment variables as
-     * any updates to the secret value is not reflected until new clones start.
+     * any updates to the secret value is not reflected until new instances start.
      * 
* * string version = 4; @@ -1077,7 +1075,7 @@ public java.lang.String getVersion() { *
      * Version of the secret (version number or the string 'latest'). It is
      * recommended to use a numeric version for secret environment variables as
-     * any updates to the secret value is not reflected until new clones start.
+     * any updates to the secret value is not reflected until new instances start.
      * 
* * string version = 4; @@ -1101,7 +1099,7 @@ public com.google.protobuf.ByteString getVersionBytes() { *
      * Version of the secret (version number or the string 'latest'). It is
      * recommended to use a numeric version for secret environment variables as
-     * any updates to the secret value is not reflected until new clones start.
+     * any updates to the secret value is not reflected until new instances start.
      * 
* * string version = 4; @@ -1124,7 +1122,7 @@ public Builder setVersion(java.lang.String value) { *
      * Version of the secret (version number or the string 'latest'). It is
      * recommended to use a numeric version for secret environment variables as
-     * any updates to the secret value is not reflected until new clones start.
+     * any updates to the secret value is not reflected until new instances start.
      * 
* * string version = 4; @@ -1143,7 +1141,7 @@ public Builder clearVersion() { *
      * Version of the secret (version number or the string 'latest'). It is
      * recommended to use a numeric version for secret environment variables as
-     * any updates to the secret value is not reflected until new clones start.
+     * any updates to the secret value is not reflected until new instances start.
      * 
* * string version = 4; diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/SecretEnvVarOrBuilder.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/SecretEnvVarOrBuilder.java index 4d4838b8..0d77c938 100644 --- a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/SecretEnvVarOrBuilder.java +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/SecretEnvVarOrBuilder.java @@ -110,7 +110,7 @@ public interface SecretEnvVarOrBuilder *
    * Version of the secret (version number or the string 'latest'). It is
    * recommended to use a numeric version for secret environment variables as
-   * any updates to the secret value is not reflected until new clones start.
+   * any updates to the secret value is not reflected until new instances start.
    * 
* * string version = 4; @@ -124,7 +124,7 @@ public interface SecretEnvVarOrBuilder *
    * Version of the secret (version number or the string 'latest'). It is
    * recommended to use a numeric version for secret environment variables as
-   * any updates to the secret value is not reflected until new clones start.
+   * any updates to the secret value is not reflected until new instances start.
    * 
* * string version = 4; diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/UpdateFunctionRequest.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/UpdateFunctionRequest.java index f308358e..cf6a6c63 100644 --- a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/UpdateFunctionRequest.java +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/UpdateFunctionRequest.java @@ -195,7 +195,7 @@ public com.google.cloud.functions.v1.CloudFunctionOrBuilder getFunctionOrBuilder * * *
-   * Required list of fields to be updated in this request.
+   * Required. The list of fields in `CloudFunction` that have to be updated.
    * 
* * .google.protobuf.FieldMask update_mask = 2; @@ -210,7 +210,7 @@ public boolean hasUpdateMask() { * * *
-   * Required list of fields to be updated in this request.
+   * Required. The list of fields in `CloudFunction` that have to be updated.
    * 
* * .google.protobuf.FieldMask update_mask = 2; @@ -225,7 +225,7 @@ public com.google.protobuf.FieldMask getUpdateMask() { * * *
-   * Required list of fields to be updated in this request.
+   * Required. The list of fields in `CloudFunction` that have to be updated.
    * 
* * .google.protobuf.FieldMask update_mask = 2; @@ -807,7 +807,7 @@ public com.google.cloud.functions.v1.CloudFunctionOrBuilder getFunctionOrBuilder * * *
-     * Required list of fields to be updated in this request.
+     * Required. The list of fields in `CloudFunction` that have to be updated.
      * 
* * .google.protobuf.FieldMask update_mask = 2; @@ -821,7 +821,7 @@ public boolean hasUpdateMask() { * * *
-     * Required list of fields to be updated in this request.
+     * Required. The list of fields in `CloudFunction` that have to be updated.
      * 
* * .google.protobuf.FieldMask update_mask = 2; @@ -841,7 +841,7 @@ public com.google.protobuf.FieldMask getUpdateMask() { * * *
-     * Required list of fields to be updated in this request.
+     * Required. The list of fields in `CloudFunction` that have to be updated.
      * 
* * .google.protobuf.FieldMask update_mask = 2; @@ -863,7 +863,7 @@ public Builder setUpdateMask(com.google.protobuf.FieldMask value) { * * *
-     * Required list of fields to be updated in this request.
+     * Required. The list of fields in `CloudFunction` that have to be updated.
      * 
* * .google.protobuf.FieldMask update_mask = 2; @@ -882,7 +882,7 @@ public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForVal * * *
-     * Required list of fields to be updated in this request.
+     * Required. The list of fields in `CloudFunction` that have to be updated.
      * 
* * .google.protobuf.FieldMask update_mask = 2; @@ -906,7 +906,7 @@ public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { * * *
-     * Required list of fields to be updated in this request.
+     * Required. The list of fields in `CloudFunction` that have to be updated.
      * 
* * .google.protobuf.FieldMask update_mask = 2; @@ -926,7 +926,7 @@ public Builder clearUpdateMask() { * * *
-     * Required list of fields to be updated in this request.
+     * Required. The list of fields in `CloudFunction` that have to be updated.
      * 
* * .google.protobuf.FieldMask update_mask = 2; @@ -940,7 +940,7 @@ public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { * * *
-     * Required list of fields to be updated in this request.
+     * Required. The list of fields in `CloudFunction` that have to be updated.
      * 
* * .google.protobuf.FieldMask update_mask = 2; @@ -958,7 +958,7 @@ public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { * * *
-     * Required list of fields to be updated in this request.
+     * Required. The list of fields in `CloudFunction` that have to be updated.
      * 
* * .google.protobuf.FieldMask update_mask = 2; diff --git a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/UpdateFunctionRequestOrBuilder.java b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/UpdateFunctionRequestOrBuilder.java index f729e0f3..12f10a98 100644 --- a/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/UpdateFunctionRequestOrBuilder.java +++ b/proto-google-cloud-functions-v1/src/main/java/com/google/cloud/functions/v1/UpdateFunctionRequestOrBuilder.java @@ -68,7 +68,7 @@ public interface UpdateFunctionRequestOrBuilder * * *
-   * Required list of fields to be updated in this request.
+   * Required. The list of fields in `CloudFunction` that have to be updated.
    * 
* * .google.protobuf.FieldMask update_mask = 2; @@ -80,7 +80,7 @@ public interface UpdateFunctionRequestOrBuilder * * *
-   * Required list of fields to be updated in this request.
+   * Required. The list of fields in `CloudFunction` that have to be updated.
    * 
* * .google.protobuf.FieldMask update_mask = 2; @@ -92,7 +92,7 @@ public interface UpdateFunctionRequestOrBuilder * * *
-   * Required list of fields to be updated in this request.
+   * Required. The list of fields in `CloudFunction` that have to be updated.
    * 
* * .google.protobuf.FieldMask update_mask = 2; diff --git a/proto-google-cloud-functions-v1/src/main/proto/google/cloud/functions/v1/functions.proto b/proto-google-cloud-functions-v1/src/main/proto/google/cloud/functions/v1/functions.proto index 29693dda..7592f3be 100644 --- a/proto-google-cloud-functions-v1/src/main/proto/google/cloud/functions/v1/functions.proto +++ b/proto-google-cloud-functions-v1/src/main/proto/google/cloud/functions/v1/functions.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. @@ -191,7 +191,6 @@ service CloudFunctionsService { // Describes a Cloud Function that contains user computation executed in // response to an event. It encapsulate function and triggers configurations. -// Next tag: 36 message CloudFunction { option (google.api.resource) = { type: "cloudfunctions.googleapis.com/CloudFunction" @@ -233,6 +232,23 @@ message CloudFunction { ALLOW_INTERNAL_AND_GCLB = 3; } + // 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; + } + // A user-defined name of the function. Function names must be unique // globally and match pattern `projects/*/locations/*/functions/*` string name = 1; @@ -380,8 +396,9 @@ message CloudFunction { // the `docker_repository` field that was created with the same KMS crypto // key. // - // The following service accounts need to be granted Cloud KMS crypto key - // encrypter/decrypter roles on the key. + // The following service accounts need to be granted the role 'Cloud KMS + // CryptoKey Encrypter/Decrypter (roles/cloudkms.cryptoKeyEncrypterDecrypter)' + // on the Key/KeyRing/Project/Organization (least access preferred). // // 1. Google Cloud Functions service account // (service-{project_number}@gcf-admin-robot.iam.gserviceaccount.com) - @@ -450,6 +467,14 @@ message CloudFunction { string docker_repository = 34 [(google.api.resource_reference) = { type: "artifactregistry.googleapis.com/Repository" }]; + + // Docker Registry to use for this deployment. + // + // 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 = 35; } // Describes SourceRepository, used to represent parameters related to @@ -575,10 +600,31 @@ message FailurePolicy { } } +// Describes the current stage of a deployment. +enum CloudFunctionStatus { + // Not specified. Invalid state. + CLOUD_FUNCTION_STATUS_UNSPECIFIED = 0; + + // Function has been successfully deployed and is serving. + ACTIVE = 1; + + // Function deployment failed and the function isn’t serving. + OFFLINE = 2; + + // Function is being created or updated. + DEPLOY_IN_PROGRESS = 3; + + // Function is being deleted. + DELETE_IN_PROGRESS = 4; + + // Function deployment failed and the function serving state is undefined. + // The function should be updated or deleted to move it out of this state. + UNKNOWN = 5; +} + // Configuration for a secret environment variable. It has the information // necessary to fetch the secret value from secret manager and expose it as an -// environment variable. Secret value is not a part of the configuration. Secret -// values are only fetched when a new clone starts. +// environment variable. message SecretEnvVar { // Name of the environment variable. string key = 1; @@ -594,7 +640,7 @@ message SecretEnvVar { // Version of the secret (version number or the string 'latest'). It is // recommended to use a numeric version for secret environment variables as - // any updates to the secret value is not reflected until new clones start. + // any updates to the secret value is not reflected until new instances start. string version = 4; } @@ -662,32 +708,10 @@ message UpdateFunctionRequest { // Required. New version of the function. CloudFunction function = 1 [(google.api.field_behavior) = REQUIRED]; - // Required list of fields to be updated in this request. + // Required. The list of fields in `CloudFunction` that have to be updated. google.protobuf.FieldMask update_mask = 2; } -// Describes the current stage of a deployment. -enum CloudFunctionStatus { - // Not specified. Invalid state. - CLOUD_FUNCTION_STATUS_UNSPECIFIED = 0; - - // Function has been successfully deployed and is serving. - ACTIVE = 1; - - // Function deployment failed and the function isn’t serving. - OFFLINE = 2; - - // Function is being created or updated. - DEPLOY_IN_PROGRESS = 3; - - // Function is being deleted. - DELETE_IN_PROGRESS = 4; - - // Function deployment failed and the function serving state is undefined. - // The function should be updated or deleted to move it out of this state. - UNKNOWN = 5; -} - // Request for the `GetFunction` method. message GetFunctionRequest { // Required. The name of the function which details should be obtained. @@ -781,6 +805,27 @@ message GenerateUploadUrlRequest { // The project and location in which the Google Cloud Storage signed URL // should be generated, specified in the format `projects/*/locations/*`. string parent = 1; + + // Resource name of a KMS crypto key (managed by the user) used to + // encrypt/decrypt function source code objects in staging Cloud Storage + // buckets. When you generate an upload url and upload your source code, it + // gets copied to a staging Cloud Storage bucket in an internal regional + // project. 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). GCF will + // delegate access to the Google Storage service account in the internal + // project. + string kms_key_name = 2 [(google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + }]; } // Response of `GenerateSourceUploadUrl` method. diff --git a/proto-google-cloud-functions-v1/src/main/proto/google/cloud/functions/v1/operations.proto b/proto-google-cloud-functions-v1/src/main/proto/google/cloud/functions/v1/operations.proto index 183957cc..9d634e78 100644 --- a/proto-google-cloud-functions-v1/src/main/proto/google/cloud/functions/v1/operations.proto +++ b/proto-google-cloud-functions-v1/src/main/proto/google/cloud/functions/v1/operations.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. @@ -18,7 +18,6 @@ package google.cloud.functions.v1; import "google/protobuf/any.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/functions/v1;functions"; option java_multiple_files = true; diff --git a/proto-google-cloud-functions-v2alpha/clirr-ignored-differences.xml b/proto-google-cloud-functions-v2alpha/clirr-ignored-differences.xml new file mode 100644 index 00000000..4a58d707 --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/cloud/functions/v2alpha/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/functions/v2alpha/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/functions/v2alpha/*OrBuilder + boolean has*(*) + + diff --git a/proto-google-cloud-functions-v2alpha/pom.xml b/proto-google-cloud-functions-v2alpha/pom.xml new file mode 100644 index 00000000..990e5857 --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/pom.xml @@ -0,0 +1,42 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-functions-v2alpha + 2.4.2-SNAPSHOT + proto-google-cloud-functions-v2alpha + Proto library for google-cloud-functions + + com.google.cloud + google-cloud-functions-parent + 2.4.2-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api + api-common + + + com.google.guava + guava + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/BuildConfig.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/BuildConfig.java new file mode 100644 index 00000000..cc229f07 --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/BuildConfig.java @@ -0,0 +1,2515 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +/** + * + * + *
+ * Describes the Build step of the function that builds a container from the
+ * given source.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.BuildConfig} + */ +public final class BuildConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2alpha.BuildConfig) + BuildConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use BuildConfig.newBuilder() to construct. + private BuildConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BuildConfig() { + build_ = ""; + runtime_ = ""; + entryPoint_ = ""; + workerPool_ = ""; + dockerRepository_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BuildConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BuildConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + build_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + runtime_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + entryPoint_ = s; + break; + } + case 34: + { + com.google.cloud.functions.v2alpha.Source.Builder subBuilder = null; + if (source_ != null) { + subBuilder = source_.toBuilder(); + } + source_ = + input.readMessage( + com.google.cloud.functions.v2alpha.Source.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(source_); + source_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + workerPool_ = s; + break; + } + case 50: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + environmentVariables_ = + com.google.protobuf.MapField.newMapField( + EnvironmentVariablesDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry + environmentVariables__ = + input.readMessage( + EnvironmentVariablesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + environmentVariables_ + .getMutableMap() + .put(environmentVariables__.getKey(), environmentVariables__.getValue()); + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + + dockerRepository_ = s; + break; + } + case 66: + { + com.google.cloud.functions.v2alpha.SourceProvenance.Builder subBuilder = null; + if (sourceProvenance_ != null) { + subBuilder = sourceProvenance_.toBuilder(); + } + sourceProvenance_ = + input.readMessage( + com.google.cloud.functions.v2alpha.SourceProvenance.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(sourceProvenance_); + sourceProvenance_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_BuildConfig_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 6: + return internalGetEnvironmentVariables(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_BuildConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.BuildConfig.class, + com.google.cloud.functions.v2alpha.BuildConfig.Builder.class); + } + + public static final int BUILD_FIELD_NUMBER = 1; + private volatile java.lang.Object build_; + /** + * + * + *
+   * Output only. The Cloud Build name of the latest successful deployment of the
+   * function.
+   * 
+ * + * + * string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The build. + */ + @java.lang.Override + public java.lang.String getBuild() { + java.lang.Object ref = build_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + build_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The Cloud Build name of the latest successful deployment of the
+   * function.
+   * 
+ * + * + * string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for build. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBuildBytes() { + java.lang.Object ref = build_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + build_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RUNTIME_FIELD_NUMBER = 2; + private volatile java.lang.Object runtime_; + /** + * + * + *
+   * The runtime in which to run the function. Required when deploying a new
+   * function, optional when updating an existing function. For a complete
+   * list of possible choices, see the
+   * [`gcloud` command
+   * reference](https://cloud.google.com/sdk/gcloud/reference/functions/deploy#--runtime).
+   * 
+ * + * string runtime = 2; + * + * @return The runtime. + */ + @java.lang.Override + public java.lang.String getRuntime() { + java.lang.Object ref = runtime_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + runtime_ = s; + return s; + } + } + /** + * + * + *
+   * The runtime in which to run the function. Required when deploying a new
+   * function, optional when updating an existing function. For a complete
+   * list of possible choices, see the
+   * [`gcloud` command
+   * reference](https://cloud.google.com/sdk/gcloud/reference/functions/deploy#--runtime).
+   * 
+ * + * string runtime = 2; + * + * @return The bytes for runtime. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRuntimeBytes() { + java.lang.Object ref = runtime_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + runtime_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENTRY_POINT_FIELD_NUMBER = 3; + private volatile java.lang.Object entryPoint_; + /** + * + * + *
+   * The name of the function (as defined in source code) that will be
+   * executed. Defaults to the resource name suffix, if not specified. For
+   * backward compatibility, if function with given name is not found, then the
+   * system will try to use function named "function".
+   * For Node.js this is name of a function exported by the module specified
+   * in `source_location`.
+   * 
+ * + * string entry_point = 3; + * + * @return The entryPoint. + */ + @java.lang.Override + public java.lang.String getEntryPoint() { + java.lang.Object ref = entryPoint_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + entryPoint_ = s; + return s; + } + } + /** + * + * + *
+   * The name of the function (as defined in source code) that will be
+   * executed. Defaults to the resource name suffix, if not specified. For
+   * backward compatibility, if function with given name is not found, then the
+   * system will try to use function named "function".
+   * For Node.js this is name of a function exported by the module specified
+   * in `source_location`.
+   * 
+ * + * string entry_point = 3; + * + * @return The bytes for entryPoint. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEntryPointBytes() { + java.lang.Object ref = entryPoint_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + entryPoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SOURCE_FIELD_NUMBER = 4; + private com.google.cloud.functions.v2alpha.Source source_; + /** + * + * + *
+   * The location of the function source code.
+   * 
+ * + * .google.cloud.functions.v2alpha.Source source = 4; + * + * @return Whether the source field is set. + */ + @java.lang.Override + public boolean hasSource() { + return source_ != null; + } + /** + * + * + *
+   * The location of the function source code.
+   * 
+ * + * .google.cloud.functions.v2alpha.Source source = 4; + * + * @return The source. + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.Source getSource() { + return source_ == null + ? com.google.cloud.functions.v2alpha.Source.getDefaultInstance() + : source_; + } + /** + * + * + *
+   * The location of the function source code.
+   * 
+ * + * .google.cloud.functions.v2alpha.Source source = 4; + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.SourceOrBuilder getSourceOrBuilder() { + return getSource(); + } + + public static final int SOURCE_PROVENANCE_FIELD_NUMBER = 8; + private com.google.cloud.functions.v2alpha.SourceProvenance sourceProvenance_; + /** + * + * + *
+   * Output only. A permanent fixed identifier for source.
+   * 
+ * + * + * .google.cloud.functions.v2alpha.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the sourceProvenance field is set. + */ + @java.lang.Override + public boolean hasSourceProvenance() { + return sourceProvenance_ != null; + } + /** + * + * + *
+   * Output only. A permanent fixed identifier for source.
+   * 
+ * + * + * .google.cloud.functions.v2alpha.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The sourceProvenance. + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.SourceProvenance getSourceProvenance() { + return sourceProvenance_ == null + ? com.google.cloud.functions.v2alpha.SourceProvenance.getDefaultInstance() + : sourceProvenance_; + } + /** + * + * + *
+   * Output only. A permanent fixed identifier for source.
+   * 
+ * + * + * .google.cloud.functions.v2alpha.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.SourceProvenanceOrBuilder + getSourceProvenanceOrBuilder() { + return getSourceProvenance(); + } + + public static final int WORKER_POOL_FIELD_NUMBER = 5; + private volatile java.lang.Object workerPool_; + /** + * + * + *
+   * Name of the Cloud Build Custom Worker Pool that should be used to build the
+   * function. The format of this field is
+   * `projects/{project}/locations/{region}/workerPools/{workerPool}` where
+   * {project} and {region} are the project id and region respectively where the
+   * worker pool is defined and {workerPool} is the short name of the worker
+   * pool.
+   * If the project id is not the same as the function, then the Cloud
+   * Functions Service Agent
+   * (service-<project_number>@gcf-admin-robot.iam.gserviceaccount.com) must be
+   * granted the role Cloud Build Custom Workers Builder
+   * (roles/cloudbuild.customworkers.builder) in the project.
+   * 
+ * + * string worker_pool = 5 [(.google.api.resource_reference) = { ... } + * + * @return The workerPool. + */ + @java.lang.Override + public java.lang.String getWorkerPool() { + java.lang.Object ref = workerPool_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + workerPool_ = s; + return s; + } + } + /** + * + * + *
+   * Name of the Cloud Build Custom Worker Pool that should be used to build the
+   * function. The format of this field is
+   * `projects/{project}/locations/{region}/workerPools/{workerPool}` where
+   * {project} and {region} are the project id and region respectively where the
+   * worker pool is defined and {workerPool} is the short name of the worker
+   * pool.
+   * If the project id is not the same as the function, then the Cloud
+   * Functions Service Agent
+   * (service-<project_number>@gcf-admin-robot.iam.gserviceaccount.com) must be
+   * granted the role Cloud Build Custom Workers Builder
+   * (roles/cloudbuild.customworkers.builder) in the project.
+   * 
+ * + * string worker_pool = 5 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for workerPool. + */ + @java.lang.Override + public com.google.protobuf.ByteString getWorkerPoolBytes() { + java.lang.Object ref = workerPool_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + workerPool_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENVIRONMENT_VARIABLES_FIELD_NUMBER = 6; + + private static final class EnvironmentVariablesDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_BuildConfig_EnvironmentVariablesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField environmentVariables_; + + private com.google.protobuf.MapField + internalGetEnvironmentVariables() { + if (environmentVariables_ == null) { + return com.google.protobuf.MapField.emptyMapField( + EnvironmentVariablesDefaultEntryHolder.defaultEntry); + } + return environmentVariables_; + } + + public int getEnvironmentVariablesCount() { + return internalGetEnvironmentVariables().getMap().size(); + } + /** + * + * + *
+   * User-provided build-time environment variables for the function
+   * 
+ * + * map<string, string> environment_variables = 6; + */ + @java.lang.Override + public boolean containsEnvironmentVariables(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetEnvironmentVariables().getMap().containsKey(key); + } + /** Use {@link #getEnvironmentVariablesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getEnvironmentVariables() { + return getEnvironmentVariablesMap(); + } + /** + * + * + *
+   * User-provided build-time environment variables for the function
+   * 
+ * + * map<string, string> environment_variables = 6; + */ + @java.lang.Override + public java.util.Map getEnvironmentVariablesMap() { + return internalGetEnvironmentVariables().getMap(); + } + /** + * + * + *
+   * User-provided build-time environment variables for the function
+   * 
+ * + * map<string, string> environment_variables = 6; + */ + @java.lang.Override + public java.lang.String getEnvironmentVariablesOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetEnvironmentVariables().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * User-provided build-time environment variables for the function
+   * 
+ * + * map<string, string> environment_variables = 6; + */ + @java.lang.Override + public java.lang.String getEnvironmentVariablesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetEnvironmentVariables().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int DOCKER_REPOSITORY_FIELD_NUMBER = 7; + private volatile java.lang.Object dockerRepository_; + /** + * + * + *
+   * Optional. User managed repository created in Artifact Registry optionally with a
+   * customer managed encryption key. This is the repository to which the
+   * function docker image will be pushed after it is built by Cloud Build.
+   * If unspecified, GCF will create and use a repository named 'gcf-artifacts'
+   * for every deployed region.
+   * It must match the pattern
+   * `projects/{project}/locations/{location}/repositories/{repository}`.
+   * Cross-project repositories are not supported.
+   * Cross-location repositories are not supported.
+   * Repository format must be 'DOCKER'.
+   * 
+ * + * + * string docker_repository = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The dockerRepository. + */ + @java.lang.Override + public java.lang.String getDockerRepository() { + java.lang.Object ref = dockerRepository_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dockerRepository_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. User managed repository created in Artifact Registry optionally with a
+   * customer managed encryption key. This is the repository to which the
+   * function docker image will be pushed after it is built by Cloud Build.
+   * If unspecified, GCF will create and use a repository named 'gcf-artifacts'
+   * for every deployed region.
+   * It must match the pattern
+   * `projects/{project}/locations/{location}/repositories/{repository}`.
+   * Cross-project repositories are not supported.
+   * Cross-location repositories are not supported.
+   * Repository format must be 'DOCKER'.
+   * 
+ * + * + * string docker_repository = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for dockerRepository. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDockerRepositoryBytes() { + java.lang.Object ref = dockerRepository_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dockerRepository_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(build_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, build_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(runtime_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, runtime_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(entryPoint_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, entryPoint_); + } + if (source_ != null) { + output.writeMessage(4, getSource()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(workerPool_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, workerPool_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, + internalGetEnvironmentVariables(), + EnvironmentVariablesDefaultEntryHolder.defaultEntry, + 6); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dockerRepository_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, dockerRepository_); + } + if (sourceProvenance_ != null) { + output.writeMessage(8, getSourceProvenance()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(build_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, build_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(runtime_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, runtime_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(entryPoint_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, entryPoint_); + } + if (source_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getSource()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(workerPool_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, workerPool_); + } + for (java.util.Map.Entry entry : + internalGetEnvironmentVariables().getMap().entrySet()) { + com.google.protobuf.MapEntry environmentVariables__ = + EnvironmentVariablesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, environmentVariables__); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dockerRepository_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, dockerRepository_); + } + if (sourceProvenance_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getSourceProvenance()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2alpha.BuildConfig)) { + return super.equals(obj); + } + com.google.cloud.functions.v2alpha.BuildConfig other = + (com.google.cloud.functions.v2alpha.BuildConfig) obj; + + if (!getBuild().equals(other.getBuild())) return false; + if (!getRuntime().equals(other.getRuntime())) return false; + if (!getEntryPoint().equals(other.getEntryPoint())) return false; + if (hasSource() != other.hasSource()) return false; + if (hasSource()) { + if (!getSource().equals(other.getSource())) return false; + } + if (hasSourceProvenance() != other.hasSourceProvenance()) return false; + if (hasSourceProvenance()) { + if (!getSourceProvenance().equals(other.getSourceProvenance())) return false; + } + if (!getWorkerPool().equals(other.getWorkerPool())) return false; + if (!internalGetEnvironmentVariables().equals(other.internalGetEnvironmentVariables())) + return false; + if (!getDockerRepository().equals(other.getDockerRepository())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + BUILD_FIELD_NUMBER; + hash = (53 * hash) + getBuild().hashCode(); + hash = (37 * hash) + RUNTIME_FIELD_NUMBER; + hash = (53 * hash) + getRuntime().hashCode(); + hash = (37 * hash) + ENTRY_POINT_FIELD_NUMBER; + hash = (53 * hash) + getEntryPoint().hashCode(); + if (hasSource()) { + hash = (37 * hash) + SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getSource().hashCode(); + } + if (hasSourceProvenance()) { + hash = (37 * hash) + SOURCE_PROVENANCE_FIELD_NUMBER; + hash = (53 * hash) + getSourceProvenance().hashCode(); + } + hash = (37 * hash) + WORKER_POOL_FIELD_NUMBER; + hash = (53 * hash) + getWorkerPool().hashCode(); + if (!internalGetEnvironmentVariables().getMap().isEmpty()) { + hash = (37 * hash) + ENVIRONMENT_VARIABLES_FIELD_NUMBER; + hash = (53 * hash) + internalGetEnvironmentVariables().hashCode(); + } + hash = (37 * hash) + DOCKER_REPOSITORY_FIELD_NUMBER; + hash = (53 * hash) + getDockerRepository().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2alpha.BuildConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.BuildConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.BuildConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.BuildConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.BuildConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.BuildConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.BuildConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.BuildConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.BuildConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.BuildConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.BuildConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.BuildConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v2alpha.BuildConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Describes the Build step of the function that builds a container from the
+   * given source.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.BuildConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2alpha.BuildConfig) + com.google.cloud.functions.v2alpha.BuildConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_BuildConfig_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 6: + return internalGetEnvironmentVariables(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 6: + return internalGetMutableEnvironmentVariables(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_BuildConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.BuildConfig.class, + com.google.cloud.functions.v2alpha.BuildConfig.Builder.class); + } + + // Construct using com.google.cloud.functions.v2alpha.BuildConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + build_ = ""; + + runtime_ = ""; + + entryPoint_ = ""; + + if (sourceBuilder_ == null) { + source_ = null; + } else { + source_ = null; + sourceBuilder_ = null; + } + if (sourceProvenanceBuilder_ == null) { + sourceProvenance_ = null; + } else { + sourceProvenance_ = null; + sourceProvenanceBuilder_ = null; + } + workerPool_ = ""; + + internalGetMutableEnvironmentVariables().clear(); + dockerRepository_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_BuildConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.BuildConfig getDefaultInstanceForType() { + return com.google.cloud.functions.v2alpha.BuildConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.BuildConfig build() { + com.google.cloud.functions.v2alpha.BuildConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.BuildConfig buildPartial() { + com.google.cloud.functions.v2alpha.BuildConfig result = + new com.google.cloud.functions.v2alpha.BuildConfig(this); + int from_bitField0_ = bitField0_; + result.build_ = build_; + result.runtime_ = runtime_; + result.entryPoint_ = entryPoint_; + if (sourceBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = sourceBuilder_.build(); + } + if (sourceProvenanceBuilder_ == null) { + result.sourceProvenance_ = sourceProvenance_; + } else { + result.sourceProvenance_ = sourceProvenanceBuilder_.build(); + } + result.workerPool_ = workerPool_; + result.environmentVariables_ = internalGetEnvironmentVariables(); + result.environmentVariables_.makeImmutable(); + result.dockerRepository_ = dockerRepository_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2alpha.BuildConfig) { + return mergeFrom((com.google.cloud.functions.v2alpha.BuildConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2alpha.BuildConfig other) { + if (other == com.google.cloud.functions.v2alpha.BuildConfig.getDefaultInstance()) return this; + if (!other.getBuild().isEmpty()) { + build_ = other.build_; + onChanged(); + } + if (!other.getRuntime().isEmpty()) { + runtime_ = other.runtime_; + onChanged(); + } + if (!other.getEntryPoint().isEmpty()) { + entryPoint_ = other.entryPoint_; + onChanged(); + } + if (other.hasSource()) { + mergeSource(other.getSource()); + } + if (other.hasSourceProvenance()) { + mergeSourceProvenance(other.getSourceProvenance()); + } + if (!other.getWorkerPool().isEmpty()) { + workerPool_ = other.workerPool_; + onChanged(); + } + internalGetMutableEnvironmentVariables().mergeFrom(other.internalGetEnvironmentVariables()); + if (!other.getDockerRepository().isEmpty()) { + dockerRepository_ = other.dockerRepository_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2alpha.BuildConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v2alpha.BuildConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object build_ = ""; + /** + * + * + *
+     * Output only. The Cloud Build name of the latest successful deployment of the
+     * function.
+     * 
+ * + * + * string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The build. + */ + public java.lang.String getBuild() { + java.lang.Object ref = build_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + build_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The Cloud Build name of the latest successful deployment of the
+     * function.
+     * 
+ * + * + * string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for build. + */ + public com.google.protobuf.ByteString getBuildBytes() { + java.lang.Object ref = build_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + build_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The Cloud Build name of the latest successful deployment of the
+     * function.
+     * 
+ * + * + * string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The build to set. + * @return This builder for chaining. + */ + public Builder setBuild(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + build_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The Cloud Build name of the latest successful deployment of the
+     * function.
+     * 
+ * + * + * string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearBuild() { + + build_ = getDefaultInstance().getBuild(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The Cloud Build name of the latest successful deployment of the
+     * function.
+     * 
+ * + * + * string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for build to set. + * @return This builder for chaining. + */ + public Builder setBuildBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + build_ = value; + onChanged(); + return this; + } + + private java.lang.Object runtime_ = ""; + /** + * + * + *
+     * The runtime in which to run the function. Required when deploying a new
+     * function, optional when updating an existing function. For a complete
+     * list of possible choices, see the
+     * [`gcloud` command
+     * reference](https://cloud.google.com/sdk/gcloud/reference/functions/deploy#--runtime).
+     * 
+ * + * string runtime = 2; + * + * @return The runtime. + */ + public java.lang.String getRuntime() { + java.lang.Object ref = runtime_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + runtime_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The runtime in which to run the function. Required when deploying a new
+     * function, optional when updating an existing function. For a complete
+     * list of possible choices, see the
+     * [`gcloud` command
+     * reference](https://cloud.google.com/sdk/gcloud/reference/functions/deploy#--runtime).
+     * 
+ * + * string runtime = 2; + * + * @return The bytes for runtime. + */ + public com.google.protobuf.ByteString getRuntimeBytes() { + java.lang.Object ref = runtime_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + runtime_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The runtime in which to run the function. Required when deploying a new
+     * function, optional when updating an existing function. For a complete
+     * list of possible choices, see the
+     * [`gcloud` command
+     * reference](https://cloud.google.com/sdk/gcloud/reference/functions/deploy#--runtime).
+     * 
+ * + * string runtime = 2; + * + * @param value The runtime to set. + * @return This builder for chaining. + */ + public Builder setRuntime(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + runtime_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The runtime in which to run the function. Required when deploying a new
+     * function, optional when updating an existing function. For a complete
+     * list of possible choices, see the
+     * [`gcloud` command
+     * reference](https://cloud.google.com/sdk/gcloud/reference/functions/deploy#--runtime).
+     * 
+ * + * string runtime = 2; + * + * @return This builder for chaining. + */ + public Builder clearRuntime() { + + runtime_ = getDefaultInstance().getRuntime(); + onChanged(); + return this; + } + /** + * + * + *
+     * The runtime in which to run the function. Required when deploying a new
+     * function, optional when updating an existing function. For a complete
+     * list of possible choices, see the
+     * [`gcloud` command
+     * reference](https://cloud.google.com/sdk/gcloud/reference/functions/deploy#--runtime).
+     * 
+ * + * string runtime = 2; + * + * @param value The bytes for runtime to set. + * @return This builder for chaining. + */ + public Builder setRuntimeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + runtime_ = value; + onChanged(); + return this; + } + + private java.lang.Object entryPoint_ = ""; + /** + * + * + *
+     * The name of the function (as defined in source code) that will be
+     * executed. Defaults to the resource name suffix, if not specified. For
+     * backward compatibility, if function with given name is not found, then the
+     * system will try to use function named "function".
+     * For Node.js this is name of a function exported by the module specified
+     * in `source_location`.
+     * 
+ * + * string entry_point = 3; + * + * @return The entryPoint. + */ + public java.lang.String getEntryPoint() { + java.lang.Object ref = entryPoint_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + entryPoint_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The name of the function (as defined in source code) that will be
+     * executed. Defaults to the resource name suffix, if not specified. For
+     * backward compatibility, if function with given name is not found, then the
+     * system will try to use function named "function".
+     * For Node.js this is name of a function exported by the module specified
+     * in `source_location`.
+     * 
+ * + * string entry_point = 3; + * + * @return The bytes for entryPoint. + */ + public com.google.protobuf.ByteString getEntryPointBytes() { + java.lang.Object ref = entryPoint_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + entryPoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The name of the function (as defined in source code) that will be
+     * executed. Defaults to the resource name suffix, if not specified. For
+     * backward compatibility, if function with given name is not found, then the
+     * system will try to use function named "function".
+     * For Node.js this is name of a function exported by the module specified
+     * in `source_location`.
+     * 
+ * + * string entry_point = 3; + * + * @param value The entryPoint to set. + * @return This builder for chaining. + */ + public Builder setEntryPoint(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + entryPoint_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the function (as defined in source code) that will be
+     * executed. Defaults to the resource name suffix, if not specified. For
+     * backward compatibility, if function with given name is not found, then the
+     * system will try to use function named "function".
+     * For Node.js this is name of a function exported by the module specified
+     * in `source_location`.
+     * 
+ * + * string entry_point = 3; + * + * @return This builder for chaining. + */ + public Builder clearEntryPoint() { + + entryPoint_ = getDefaultInstance().getEntryPoint(); + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the function (as defined in source code) that will be
+     * executed. Defaults to the resource name suffix, if not specified. For
+     * backward compatibility, if function with given name is not found, then the
+     * system will try to use function named "function".
+     * For Node.js this is name of a function exported by the module specified
+     * in `source_location`.
+     * 
+ * + * string entry_point = 3; + * + * @param value The bytes for entryPoint to set. + * @return This builder for chaining. + */ + public Builder setEntryPointBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + entryPoint_ = value; + onChanged(); + return this; + } + + private com.google.cloud.functions.v2alpha.Source source_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2alpha.Source, + com.google.cloud.functions.v2alpha.Source.Builder, + com.google.cloud.functions.v2alpha.SourceOrBuilder> + sourceBuilder_; + /** + * + * + *
+     * The location of the function source code.
+     * 
+ * + * .google.cloud.functions.v2alpha.Source source = 4; + * + * @return Whether the source field is set. + */ + public boolean hasSource() { + return sourceBuilder_ != null || source_ != null; + } + /** + * + * + *
+     * The location of the function source code.
+     * 
+ * + * .google.cloud.functions.v2alpha.Source source = 4; + * + * @return The source. + */ + public com.google.cloud.functions.v2alpha.Source getSource() { + if (sourceBuilder_ == null) { + return source_ == null + ? com.google.cloud.functions.v2alpha.Source.getDefaultInstance() + : source_; + } else { + return sourceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The location of the function source code.
+     * 
+ * + * .google.cloud.functions.v2alpha.Source source = 4; + */ + public Builder setSource(com.google.cloud.functions.v2alpha.Source value) { + if (sourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + sourceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The location of the function source code.
+     * 
+ * + * .google.cloud.functions.v2alpha.Source source = 4; + */ + public Builder setSource(com.google.cloud.functions.v2alpha.Source.Builder builderForValue) { + if (sourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + sourceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The location of the function source code.
+     * 
+ * + * .google.cloud.functions.v2alpha.Source source = 4; + */ + public Builder mergeSource(com.google.cloud.functions.v2alpha.Source value) { + if (sourceBuilder_ == null) { + if (source_ != null) { + source_ = + com.google.cloud.functions.v2alpha.Source.newBuilder(source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + sourceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The location of the function source code.
+     * 
+ * + * .google.cloud.functions.v2alpha.Source source = 4; + */ + public Builder clearSource() { + if (sourceBuilder_ == null) { + source_ = null; + onChanged(); + } else { + source_ = null; + sourceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The location of the function source code.
+     * 
+ * + * .google.cloud.functions.v2alpha.Source source = 4; + */ + public com.google.cloud.functions.v2alpha.Source.Builder getSourceBuilder() { + + onChanged(); + return getSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The location of the function source code.
+     * 
+ * + * .google.cloud.functions.v2alpha.Source source = 4; + */ + public com.google.cloud.functions.v2alpha.SourceOrBuilder getSourceOrBuilder() { + if (sourceBuilder_ != null) { + return sourceBuilder_.getMessageOrBuilder(); + } else { + return source_ == null + ? com.google.cloud.functions.v2alpha.Source.getDefaultInstance() + : source_; + } + } + /** + * + * + *
+     * The location of the function source code.
+     * 
+ * + * .google.cloud.functions.v2alpha.Source source = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2alpha.Source, + com.google.cloud.functions.v2alpha.Source.Builder, + com.google.cloud.functions.v2alpha.SourceOrBuilder> + getSourceFieldBuilder() { + if (sourceBuilder_ == null) { + sourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2alpha.Source, + com.google.cloud.functions.v2alpha.Source.Builder, + com.google.cloud.functions.v2alpha.SourceOrBuilder>( + getSource(), getParentForChildren(), isClean()); + source_ = null; + } + return sourceBuilder_; + } + + private com.google.cloud.functions.v2alpha.SourceProvenance sourceProvenance_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2alpha.SourceProvenance, + com.google.cloud.functions.v2alpha.SourceProvenance.Builder, + com.google.cloud.functions.v2alpha.SourceProvenanceOrBuilder> + sourceProvenanceBuilder_; + /** + * + * + *
+     * Output only. A permanent fixed identifier for source.
+     * 
+ * + * + * .google.cloud.functions.v2alpha.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the sourceProvenance field is set. + */ + public boolean hasSourceProvenance() { + return sourceProvenanceBuilder_ != null || sourceProvenance_ != null; + } + /** + * + * + *
+     * Output only. A permanent fixed identifier for source.
+     * 
+ * + * + * .google.cloud.functions.v2alpha.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The sourceProvenance. + */ + public com.google.cloud.functions.v2alpha.SourceProvenance getSourceProvenance() { + if (sourceProvenanceBuilder_ == null) { + return sourceProvenance_ == null + ? com.google.cloud.functions.v2alpha.SourceProvenance.getDefaultInstance() + : sourceProvenance_; + } else { + return sourceProvenanceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. A permanent fixed identifier for source.
+     * 
+ * + * + * .google.cloud.functions.v2alpha.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSourceProvenance(com.google.cloud.functions.v2alpha.SourceProvenance value) { + if (sourceProvenanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sourceProvenance_ = value; + onChanged(); + } else { + sourceProvenanceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. A permanent fixed identifier for source.
+     * 
+ * + * + * .google.cloud.functions.v2alpha.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSourceProvenance( + com.google.cloud.functions.v2alpha.SourceProvenance.Builder builderForValue) { + if (sourceProvenanceBuilder_ == null) { + sourceProvenance_ = builderForValue.build(); + onChanged(); + } else { + sourceProvenanceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. A permanent fixed identifier for source.
+     * 
+ * + * + * .google.cloud.functions.v2alpha.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeSourceProvenance( + com.google.cloud.functions.v2alpha.SourceProvenance value) { + if (sourceProvenanceBuilder_ == null) { + if (sourceProvenance_ != null) { + sourceProvenance_ = + com.google.cloud.functions.v2alpha.SourceProvenance.newBuilder(sourceProvenance_) + .mergeFrom(value) + .buildPartial(); + } else { + sourceProvenance_ = value; + } + onChanged(); + } else { + sourceProvenanceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. A permanent fixed identifier for source.
+     * 
+ * + * + * .google.cloud.functions.v2alpha.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearSourceProvenance() { + if (sourceProvenanceBuilder_ == null) { + sourceProvenance_ = null; + onChanged(); + } else { + sourceProvenance_ = null; + sourceProvenanceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. A permanent fixed identifier for source.
+     * 
+ * + * + * .google.cloud.functions.v2alpha.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.functions.v2alpha.SourceProvenance.Builder + getSourceProvenanceBuilder() { + + onChanged(); + return getSourceProvenanceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. A permanent fixed identifier for source.
+     * 
+ * + * + * .google.cloud.functions.v2alpha.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.functions.v2alpha.SourceProvenanceOrBuilder + getSourceProvenanceOrBuilder() { + if (sourceProvenanceBuilder_ != null) { + return sourceProvenanceBuilder_.getMessageOrBuilder(); + } else { + return sourceProvenance_ == null + ? com.google.cloud.functions.v2alpha.SourceProvenance.getDefaultInstance() + : sourceProvenance_; + } + } + /** + * + * + *
+     * Output only. A permanent fixed identifier for source.
+     * 
+ * + * + * .google.cloud.functions.v2alpha.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2alpha.SourceProvenance, + com.google.cloud.functions.v2alpha.SourceProvenance.Builder, + com.google.cloud.functions.v2alpha.SourceProvenanceOrBuilder> + getSourceProvenanceFieldBuilder() { + if (sourceProvenanceBuilder_ == null) { + sourceProvenanceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2alpha.SourceProvenance, + com.google.cloud.functions.v2alpha.SourceProvenance.Builder, + com.google.cloud.functions.v2alpha.SourceProvenanceOrBuilder>( + getSourceProvenance(), getParentForChildren(), isClean()); + sourceProvenance_ = null; + } + return sourceProvenanceBuilder_; + } + + private java.lang.Object workerPool_ = ""; + /** + * + * + *
+     * Name of the Cloud Build Custom Worker Pool that should be used to build the
+     * function. The format of this field is
+     * `projects/{project}/locations/{region}/workerPools/{workerPool}` where
+     * {project} and {region} are the project id and region respectively where the
+     * worker pool is defined and {workerPool} is the short name of the worker
+     * pool.
+     * If the project id is not the same as the function, then the Cloud
+     * Functions Service Agent
+     * (service-<project_number>@gcf-admin-robot.iam.gserviceaccount.com) must be
+     * granted the role Cloud Build Custom Workers Builder
+     * (roles/cloudbuild.customworkers.builder) in the project.
+     * 
+ * + * string worker_pool = 5 [(.google.api.resource_reference) = { ... } + * + * @return The workerPool. + */ + public java.lang.String getWorkerPool() { + java.lang.Object ref = workerPool_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + workerPool_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the Cloud Build Custom Worker Pool that should be used to build the
+     * function. The format of this field is
+     * `projects/{project}/locations/{region}/workerPools/{workerPool}` where
+     * {project} and {region} are the project id and region respectively where the
+     * worker pool is defined and {workerPool} is the short name of the worker
+     * pool.
+     * If the project id is not the same as the function, then the Cloud
+     * Functions Service Agent
+     * (service-<project_number>@gcf-admin-robot.iam.gserviceaccount.com) must be
+     * granted the role Cloud Build Custom Workers Builder
+     * (roles/cloudbuild.customworkers.builder) in the project.
+     * 
+ * + * string worker_pool = 5 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for workerPool. + */ + public com.google.protobuf.ByteString getWorkerPoolBytes() { + java.lang.Object ref = workerPool_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + workerPool_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the Cloud Build Custom Worker Pool that should be used to build the
+     * function. The format of this field is
+     * `projects/{project}/locations/{region}/workerPools/{workerPool}` where
+     * {project} and {region} are the project id and region respectively where the
+     * worker pool is defined and {workerPool} is the short name of the worker
+     * pool.
+     * If the project id is not the same as the function, then the Cloud
+     * Functions Service Agent
+     * (service-<project_number>@gcf-admin-robot.iam.gserviceaccount.com) must be
+     * granted the role Cloud Build Custom Workers Builder
+     * (roles/cloudbuild.customworkers.builder) in the project.
+     * 
+ * + * string worker_pool = 5 [(.google.api.resource_reference) = { ... } + * + * @param value The workerPool to set. + * @return This builder for chaining. + */ + public Builder setWorkerPool(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + workerPool_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the Cloud Build Custom Worker Pool that should be used to build the
+     * function. The format of this field is
+     * `projects/{project}/locations/{region}/workerPools/{workerPool}` where
+     * {project} and {region} are the project id and region respectively where the
+     * worker pool is defined and {workerPool} is the short name of the worker
+     * pool.
+     * If the project id is not the same as the function, then the Cloud
+     * Functions Service Agent
+     * (service-<project_number>@gcf-admin-robot.iam.gserviceaccount.com) must be
+     * granted the role Cloud Build Custom Workers Builder
+     * (roles/cloudbuild.customworkers.builder) in the project.
+     * 
+ * + * string worker_pool = 5 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearWorkerPool() { + + workerPool_ = getDefaultInstance().getWorkerPool(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the Cloud Build Custom Worker Pool that should be used to build the
+     * function. The format of this field is
+     * `projects/{project}/locations/{region}/workerPools/{workerPool}` where
+     * {project} and {region} are the project id and region respectively where the
+     * worker pool is defined and {workerPool} is the short name of the worker
+     * pool.
+     * If the project id is not the same as the function, then the Cloud
+     * Functions Service Agent
+     * (service-<project_number>@gcf-admin-robot.iam.gserviceaccount.com) must be
+     * granted the role Cloud Build Custom Workers Builder
+     * (roles/cloudbuild.customworkers.builder) in the project.
+     * 
+ * + * string worker_pool = 5 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for workerPool to set. + * @return This builder for chaining. + */ + public Builder setWorkerPoolBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + workerPool_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField environmentVariables_; + + private com.google.protobuf.MapField + internalGetEnvironmentVariables() { + if (environmentVariables_ == null) { + return com.google.protobuf.MapField.emptyMapField( + EnvironmentVariablesDefaultEntryHolder.defaultEntry); + } + return environmentVariables_; + } + + private com.google.protobuf.MapField + internalGetMutableEnvironmentVariables() { + onChanged(); + ; + if (environmentVariables_ == null) { + environmentVariables_ = + com.google.protobuf.MapField.newMapField( + EnvironmentVariablesDefaultEntryHolder.defaultEntry); + } + if (!environmentVariables_.isMutable()) { + environmentVariables_ = environmentVariables_.copy(); + } + return environmentVariables_; + } + + public int getEnvironmentVariablesCount() { + return internalGetEnvironmentVariables().getMap().size(); + } + /** + * + * + *
+     * User-provided build-time environment variables for the function
+     * 
+ * + * map<string, string> environment_variables = 6; + */ + @java.lang.Override + public boolean containsEnvironmentVariables(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetEnvironmentVariables().getMap().containsKey(key); + } + /** Use {@link #getEnvironmentVariablesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getEnvironmentVariables() { + return getEnvironmentVariablesMap(); + } + /** + * + * + *
+     * User-provided build-time environment variables for the function
+     * 
+ * + * map<string, string> environment_variables = 6; + */ + @java.lang.Override + public java.util.Map getEnvironmentVariablesMap() { + return internalGetEnvironmentVariables().getMap(); + } + /** + * + * + *
+     * User-provided build-time environment variables for the function
+     * 
+ * + * map<string, string> environment_variables = 6; + */ + @java.lang.Override + public java.lang.String getEnvironmentVariablesOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetEnvironmentVariables().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * User-provided build-time environment variables for the function
+     * 
+ * + * map<string, string> environment_variables = 6; + */ + @java.lang.Override + public java.lang.String getEnvironmentVariablesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetEnvironmentVariables().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearEnvironmentVariables() { + internalGetMutableEnvironmentVariables().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * User-provided build-time environment variables for the function
+     * 
+ * + * map<string, string> environment_variables = 6; + */ + public Builder removeEnvironmentVariables(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableEnvironmentVariables().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableEnvironmentVariables() { + return internalGetMutableEnvironmentVariables().getMutableMap(); + } + /** + * + * + *
+     * User-provided build-time environment variables for the function
+     * 
+ * + * map<string, string> environment_variables = 6; + */ + public Builder putEnvironmentVariables(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableEnvironmentVariables().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * User-provided build-time environment variables for the function
+     * 
+ * + * map<string, string> environment_variables = 6; + */ + public Builder putAllEnvironmentVariables( + java.util.Map values) { + internalGetMutableEnvironmentVariables().getMutableMap().putAll(values); + return this; + } + + private java.lang.Object dockerRepository_ = ""; + /** + * + * + *
+     * Optional. User managed repository created in Artifact Registry optionally with a
+     * customer managed encryption key. This is the repository to which the
+     * function docker image will be pushed after it is built by Cloud Build.
+     * If unspecified, GCF will create and use a repository named 'gcf-artifacts'
+     * for every deployed region.
+     * It must match the pattern
+     * `projects/{project}/locations/{location}/repositories/{repository}`.
+     * Cross-project repositories are not supported.
+     * Cross-location repositories are not supported.
+     * Repository format must be 'DOCKER'.
+     * 
+ * + * + * string docker_repository = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The dockerRepository. + */ + public java.lang.String getDockerRepository() { + java.lang.Object ref = dockerRepository_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dockerRepository_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. User managed repository created in Artifact Registry optionally with a
+     * customer managed encryption key. This is the repository to which the
+     * function docker image will be pushed after it is built by Cloud Build.
+     * If unspecified, GCF will create and use a repository named 'gcf-artifacts'
+     * for every deployed region.
+     * It must match the pattern
+     * `projects/{project}/locations/{location}/repositories/{repository}`.
+     * Cross-project repositories are not supported.
+     * Cross-location repositories are not supported.
+     * Repository format must be 'DOCKER'.
+     * 
+ * + * + * string docker_repository = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for dockerRepository. + */ + public com.google.protobuf.ByteString getDockerRepositoryBytes() { + java.lang.Object ref = dockerRepository_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dockerRepository_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. User managed repository created in Artifact Registry optionally with a
+     * customer managed encryption key. This is the repository to which the
+     * function docker image will be pushed after it is built by Cloud Build.
+     * If unspecified, GCF will create and use a repository named 'gcf-artifacts'
+     * for every deployed region.
+     * It must match the pattern
+     * `projects/{project}/locations/{location}/repositories/{repository}`.
+     * Cross-project repositories are not supported.
+     * Cross-location repositories are not supported.
+     * Repository format must be 'DOCKER'.
+     * 
+ * + * + * string docker_repository = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The dockerRepository to set. + * @return This builder for chaining. + */ + public Builder setDockerRepository(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + dockerRepository_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. User managed repository created in Artifact Registry optionally with a
+     * customer managed encryption key. This is the repository to which the
+     * function docker image will be pushed after it is built by Cloud Build.
+     * If unspecified, GCF will create and use a repository named 'gcf-artifacts'
+     * for every deployed region.
+     * It must match the pattern
+     * `projects/{project}/locations/{location}/repositories/{repository}`.
+     * Cross-project repositories are not supported.
+     * Cross-location repositories are not supported.
+     * Repository format must be 'DOCKER'.
+     * 
+ * + * + * string docker_repository = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearDockerRepository() { + + dockerRepository_ = getDefaultInstance().getDockerRepository(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. User managed repository created in Artifact Registry optionally with a
+     * customer managed encryption key. This is the repository to which the
+     * function docker image will be pushed after it is built by Cloud Build.
+     * If unspecified, GCF will create and use a repository named 'gcf-artifacts'
+     * for every deployed region.
+     * It must match the pattern
+     * `projects/{project}/locations/{location}/repositories/{repository}`.
+     * Cross-project repositories are not supported.
+     * Cross-location repositories are not supported.
+     * Repository format must be 'DOCKER'.
+     * 
+ * + * + * string docker_repository = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for dockerRepository to set. + * @return This builder for chaining. + */ + public Builder setDockerRepositoryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + dockerRepository_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2alpha.BuildConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2alpha.BuildConfig) + private static final com.google.cloud.functions.v2alpha.BuildConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2alpha.BuildConfig(); + } + + public static com.google.cloud.functions.v2alpha.BuildConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BuildConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BuildConfig(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.BuildConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/BuildConfigOrBuilder.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/BuildConfigOrBuilder.java new file mode 100644 index 00000000..67f27dbc --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/BuildConfigOrBuilder.java @@ -0,0 +1,351 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +public interface BuildConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2alpha.BuildConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The Cloud Build name of the latest successful deployment of the
+   * function.
+   * 
+ * + * + * string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The build. + */ + java.lang.String getBuild(); + /** + * + * + *
+   * Output only. The Cloud Build name of the latest successful deployment of the
+   * function.
+   * 
+ * + * + * string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for build. + */ + com.google.protobuf.ByteString getBuildBytes(); + + /** + * + * + *
+   * The runtime in which to run the function. Required when deploying a new
+   * function, optional when updating an existing function. For a complete
+   * list of possible choices, see the
+   * [`gcloud` command
+   * reference](https://cloud.google.com/sdk/gcloud/reference/functions/deploy#--runtime).
+   * 
+ * + * string runtime = 2; + * + * @return The runtime. + */ + java.lang.String getRuntime(); + /** + * + * + *
+   * The runtime in which to run the function. Required when deploying a new
+   * function, optional when updating an existing function. For a complete
+   * list of possible choices, see the
+   * [`gcloud` command
+   * reference](https://cloud.google.com/sdk/gcloud/reference/functions/deploy#--runtime).
+   * 
+ * + * string runtime = 2; + * + * @return The bytes for runtime. + */ + com.google.protobuf.ByteString getRuntimeBytes(); + + /** + * + * + *
+   * The name of the function (as defined in source code) that will be
+   * executed. Defaults to the resource name suffix, if not specified. For
+   * backward compatibility, if function with given name is not found, then the
+   * system will try to use function named "function".
+   * For Node.js this is name of a function exported by the module specified
+   * in `source_location`.
+   * 
+ * + * string entry_point = 3; + * + * @return The entryPoint. + */ + java.lang.String getEntryPoint(); + /** + * + * + *
+   * The name of the function (as defined in source code) that will be
+   * executed. Defaults to the resource name suffix, if not specified. For
+   * backward compatibility, if function with given name is not found, then the
+   * system will try to use function named "function".
+   * For Node.js this is name of a function exported by the module specified
+   * in `source_location`.
+   * 
+ * + * string entry_point = 3; + * + * @return The bytes for entryPoint. + */ + com.google.protobuf.ByteString getEntryPointBytes(); + + /** + * + * + *
+   * The location of the function source code.
+   * 
+ * + * .google.cloud.functions.v2alpha.Source source = 4; + * + * @return Whether the source field is set. + */ + boolean hasSource(); + /** + * + * + *
+   * The location of the function source code.
+   * 
+ * + * .google.cloud.functions.v2alpha.Source source = 4; + * + * @return The source. + */ + com.google.cloud.functions.v2alpha.Source getSource(); + /** + * + * + *
+   * The location of the function source code.
+   * 
+ * + * .google.cloud.functions.v2alpha.Source source = 4; + */ + com.google.cloud.functions.v2alpha.SourceOrBuilder getSourceOrBuilder(); + + /** + * + * + *
+   * Output only. A permanent fixed identifier for source.
+   * 
+ * + * + * .google.cloud.functions.v2alpha.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the sourceProvenance field is set. + */ + boolean hasSourceProvenance(); + /** + * + * + *
+   * Output only. A permanent fixed identifier for source.
+   * 
+ * + * + * .google.cloud.functions.v2alpha.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The sourceProvenance. + */ + com.google.cloud.functions.v2alpha.SourceProvenance getSourceProvenance(); + /** + * + * + *
+   * Output only. A permanent fixed identifier for source.
+   * 
+ * + * + * .google.cloud.functions.v2alpha.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.functions.v2alpha.SourceProvenanceOrBuilder getSourceProvenanceOrBuilder(); + + /** + * + * + *
+   * Name of the Cloud Build Custom Worker Pool that should be used to build the
+   * function. The format of this field is
+   * `projects/{project}/locations/{region}/workerPools/{workerPool}` where
+   * {project} and {region} are the project id and region respectively where the
+   * worker pool is defined and {workerPool} is the short name of the worker
+   * pool.
+   * If the project id is not the same as the function, then the Cloud
+   * Functions Service Agent
+   * (service-<project_number>@gcf-admin-robot.iam.gserviceaccount.com) must be
+   * granted the role Cloud Build Custom Workers Builder
+   * (roles/cloudbuild.customworkers.builder) in the project.
+   * 
+ * + * string worker_pool = 5 [(.google.api.resource_reference) = { ... } + * + * @return The workerPool. + */ + java.lang.String getWorkerPool(); + /** + * + * + *
+   * Name of the Cloud Build Custom Worker Pool that should be used to build the
+   * function. The format of this field is
+   * `projects/{project}/locations/{region}/workerPools/{workerPool}` where
+   * {project} and {region} are the project id and region respectively where the
+   * worker pool is defined and {workerPool} is the short name of the worker
+   * pool.
+   * If the project id is not the same as the function, then the Cloud
+   * Functions Service Agent
+   * (service-<project_number>@gcf-admin-robot.iam.gserviceaccount.com) must be
+   * granted the role Cloud Build Custom Workers Builder
+   * (roles/cloudbuild.customworkers.builder) in the project.
+   * 
+ * + * string worker_pool = 5 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for workerPool. + */ + com.google.protobuf.ByteString getWorkerPoolBytes(); + + /** + * + * + *
+   * User-provided build-time environment variables for the function
+   * 
+ * + * map<string, string> environment_variables = 6; + */ + int getEnvironmentVariablesCount(); + /** + * + * + *
+   * User-provided build-time environment variables for the function
+   * 
+ * + * map<string, string> environment_variables = 6; + */ + boolean containsEnvironmentVariables(java.lang.String key); + /** Use {@link #getEnvironmentVariablesMap()} instead. */ + @java.lang.Deprecated + java.util.Map getEnvironmentVariables(); + /** + * + * + *
+   * User-provided build-time environment variables for the function
+   * 
+ * + * map<string, string> environment_variables = 6; + */ + java.util.Map getEnvironmentVariablesMap(); + /** + * + * + *
+   * User-provided build-time environment variables for the function
+   * 
+ * + * map<string, string> environment_variables = 6; + */ + + /* nullable */ + java.lang.String getEnvironmentVariablesOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * User-provided build-time environment variables for the function
+   * 
+ * + * map<string, string> environment_variables = 6; + */ + java.lang.String getEnvironmentVariablesOrThrow(java.lang.String key); + + /** + * + * + *
+   * Optional. User managed repository created in Artifact Registry optionally with a
+   * customer managed encryption key. This is the repository to which the
+   * function docker image will be pushed after it is built by Cloud Build.
+   * If unspecified, GCF will create and use a repository named 'gcf-artifacts'
+   * for every deployed region.
+   * It must match the pattern
+   * `projects/{project}/locations/{location}/repositories/{repository}`.
+   * Cross-project repositories are not supported.
+   * Cross-location repositories are not supported.
+   * Repository format must be 'DOCKER'.
+   * 
+ * + * + * string docker_repository = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The dockerRepository. + */ + java.lang.String getDockerRepository(); + /** + * + * + *
+   * Optional. User managed repository created in Artifact Registry optionally with a
+   * customer managed encryption key. This is the repository to which the
+   * function docker image will be pushed after it is built by Cloud Build.
+   * If unspecified, GCF will create and use a repository named 'gcf-artifacts'
+   * for every deployed region.
+   * It must match the pattern
+   * `projects/{project}/locations/{location}/repositories/{repository}`.
+   * Cross-project repositories are not supported.
+   * Cross-location repositories are not supported.
+   * Repository format must be 'DOCKER'.
+   * 
+ * + * + * string docker_repository = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for dockerRepository. + */ + com.google.protobuf.ByteString getDockerRepositoryBytes(); +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/CreateFunctionRequest.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/CreateFunctionRequest.java new file mode 100644 index 00000000..7865a8a7 --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/CreateFunctionRequest.java @@ -0,0 +1,1162 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +/** + * + * + *
+ * Request for the `CreateFunction` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.CreateFunctionRequest} + */ +public final class CreateFunctionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2alpha.CreateFunctionRequest) + CreateFunctionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateFunctionRequest.newBuilder() to construct. + private CreateFunctionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateFunctionRequest() { + parent_ = ""; + functionId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateFunctionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateFunctionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + com.google.cloud.functions.v2alpha.Function.Builder subBuilder = null; + if (function_ != null) { + subBuilder = function_.toBuilder(); + } + function_ = + input.readMessage( + com.google.cloud.functions.v2alpha.Function.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(function_); + function_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + functionId_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_CreateFunctionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_CreateFunctionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.CreateFunctionRequest.class, + com.google.cloud.functions.v2alpha.CreateFunctionRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The project and location in which the function should be created, specified
+   * in the format `projects/*/locations/*`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The project and location in which the function should be created, specified
+   * in the format `projects/*/locations/*`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FUNCTION_FIELD_NUMBER = 2; + private com.google.cloud.functions.v2alpha.Function function_; + /** + * + * + *
+   * Required. Function to be created.
+   * 
+ * + * + * .google.cloud.functions.v2alpha.Function function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the function field is set. + */ + @java.lang.Override + public boolean hasFunction() { + return function_ != null; + } + /** + * + * + *
+   * Required. Function to be created.
+   * 
+ * + * + * .google.cloud.functions.v2alpha.Function function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The function. + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.Function getFunction() { + return function_ == null + ? com.google.cloud.functions.v2alpha.Function.getDefaultInstance() + : function_; + } + /** + * + * + *
+   * Required. Function to be created.
+   * 
+ * + * + * .google.cloud.functions.v2alpha.Function function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.FunctionOrBuilder getFunctionOrBuilder() { + return getFunction(); + } + + public static final int FUNCTION_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object functionId_; + /** + * + * + *
+   * The ID to use for the function, which will become the final component of
+   * the function's resource name.
+   * This value should be 4-63 characters, and valid characters
+   * are /[a-z][0-9]-/.
+   * 
+ * + * string function_id = 3; + * + * @return The functionId. + */ + @java.lang.Override + public java.lang.String getFunctionId() { + java.lang.Object ref = functionId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + functionId_ = s; + return s; + } + } + /** + * + * + *
+   * The ID to use for the function, which will become the final component of
+   * the function's resource name.
+   * This value should be 4-63 characters, and valid characters
+   * are /[a-z][0-9]-/.
+   * 
+ * + * string function_id = 3; + * + * @return The bytes for functionId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFunctionIdBytes() { + java.lang.Object ref = functionId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + functionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (function_ != null) { + output.writeMessage(2, getFunction()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(functionId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, functionId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (function_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getFunction()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(functionId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, functionId_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2alpha.CreateFunctionRequest)) { + return super.equals(obj); + } + com.google.cloud.functions.v2alpha.CreateFunctionRequest other = + (com.google.cloud.functions.v2alpha.CreateFunctionRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasFunction() != other.hasFunction()) return false; + if (hasFunction()) { + if (!getFunction().equals(other.getFunction())) return false; + } + if (!getFunctionId().equals(other.getFunctionId())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasFunction()) { + hash = (37 * hash) + FUNCTION_FIELD_NUMBER; + hash = (53 * hash) + getFunction().hashCode(); + } + hash = (37 * hash) + FUNCTION_ID_FIELD_NUMBER; + hash = (53 * hash) + getFunctionId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2alpha.CreateFunctionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.CreateFunctionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.CreateFunctionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.CreateFunctionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.CreateFunctionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.CreateFunctionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.CreateFunctionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.CreateFunctionRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.CreateFunctionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.CreateFunctionRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.CreateFunctionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.CreateFunctionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.functions.v2alpha.CreateFunctionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the `CreateFunction` method.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.CreateFunctionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2alpha.CreateFunctionRequest) + com.google.cloud.functions.v2alpha.CreateFunctionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_CreateFunctionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_CreateFunctionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.CreateFunctionRequest.class, + com.google.cloud.functions.v2alpha.CreateFunctionRequest.Builder.class); + } + + // Construct using com.google.cloud.functions.v2alpha.CreateFunctionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + if (functionBuilder_ == null) { + function_ = null; + } else { + function_ = null; + functionBuilder_ = null; + } + functionId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_CreateFunctionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.CreateFunctionRequest getDefaultInstanceForType() { + return com.google.cloud.functions.v2alpha.CreateFunctionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.CreateFunctionRequest build() { + com.google.cloud.functions.v2alpha.CreateFunctionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.CreateFunctionRequest buildPartial() { + com.google.cloud.functions.v2alpha.CreateFunctionRequest result = + new com.google.cloud.functions.v2alpha.CreateFunctionRequest(this); + result.parent_ = parent_; + if (functionBuilder_ == null) { + result.function_ = function_; + } else { + result.function_ = functionBuilder_.build(); + } + result.functionId_ = functionId_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2alpha.CreateFunctionRequest) { + return mergeFrom((com.google.cloud.functions.v2alpha.CreateFunctionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2alpha.CreateFunctionRequest other) { + if (other == com.google.cloud.functions.v2alpha.CreateFunctionRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasFunction()) { + mergeFunction(other.getFunction()); + } + if (!other.getFunctionId().isEmpty()) { + functionId_ = other.functionId_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2alpha.CreateFunctionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2alpha.CreateFunctionRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The project and location in which the function should be created, specified
+     * in the format `projects/*/locations/*`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The project and location in which the function should be created, specified
+     * in the format `projects/*/locations/*`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The project and location in which the function should be created, specified
+     * in the format `projects/*/locations/*`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The project and location in which the function should be created, specified
+     * in the format `projects/*/locations/*`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The project and location in which the function should be created, specified
+     * in the format `projects/*/locations/*`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private com.google.cloud.functions.v2alpha.Function function_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2alpha.Function, + com.google.cloud.functions.v2alpha.Function.Builder, + com.google.cloud.functions.v2alpha.FunctionOrBuilder> + functionBuilder_; + /** + * + * + *
+     * Required. Function to be created.
+     * 
+ * + * + * .google.cloud.functions.v2alpha.Function function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the function field is set. + */ + public boolean hasFunction() { + return functionBuilder_ != null || function_ != null; + } + /** + * + * + *
+     * Required. Function to be created.
+     * 
+ * + * + * .google.cloud.functions.v2alpha.Function function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The function. + */ + public com.google.cloud.functions.v2alpha.Function getFunction() { + if (functionBuilder_ == null) { + return function_ == null + ? com.google.cloud.functions.v2alpha.Function.getDefaultInstance() + : function_; + } else { + return functionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Function to be created.
+     * 
+ * + * + * .google.cloud.functions.v2alpha.Function function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setFunction(com.google.cloud.functions.v2alpha.Function value) { + if (functionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + function_ = value; + onChanged(); + } else { + functionBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Function to be created.
+     * 
+ * + * + * .google.cloud.functions.v2alpha.Function function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setFunction( + com.google.cloud.functions.v2alpha.Function.Builder builderForValue) { + if (functionBuilder_ == null) { + function_ = builderForValue.build(); + onChanged(); + } else { + functionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Function to be created.
+     * 
+ * + * + * .google.cloud.functions.v2alpha.Function function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeFunction(com.google.cloud.functions.v2alpha.Function value) { + if (functionBuilder_ == null) { + if (function_ != null) { + function_ = + com.google.cloud.functions.v2alpha.Function.newBuilder(function_) + .mergeFrom(value) + .buildPartial(); + } else { + function_ = value; + } + onChanged(); + } else { + functionBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Function to be created.
+     * 
+ * + * + * .google.cloud.functions.v2alpha.Function function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearFunction() { + if (functionBuilder_ == null) { + function_ = null; + onChanged(); + } else { + function_ = null; + functionBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Function to be created.
+     * 
+ * + * + * .google.cloud.functions.v2alpha.Function function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.functions.v2alpha.Function.Builder getFunctionBuilder() { + + onChanged(); + return getFunctionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Function to be created.
+     * 
+ * + * + * .google.cloud.functions.v2alpha.Function function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.functions.v2alpha.FunctionOrBuilder getFunctionOrBuilder() { + if (functionBuilder_ != null) { + return functionBuilder_.getMessageOrBuilder(); + } else { + return function_ == null + ? com.google.cloud.functions.v2alpha.Function.getDefaultInstance() + : function_; + } + } + /** + * + * + *
+     * Required. Function to be created.
+     * 
+ * + * + * .google.cloud.functions.v2alpha.Function function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2alpha.Function, + com.google.cloud.functions.v2alpha.Function.Builder, + com.google.cloud.functions.v2alpha.FunctionOrBuilder> + getFunctionFieldBuilder() { + if (functionBuilder_ == null) { + functionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2alpha.Function, + com.google.cloud.functions.v2alpha.Function.Builder, + com.google.cloud.functions.v2alpha.FunctionOrBuilder>( + getFunction(), getParentForChildren(), isClean()); + function_ = null; + } + return functionBuilder_; + } + + private java.lang.Object functionId_ = ""; + /** + * + * + *
+     * The ID to use for the function, which will become the final component of
+     * the function's resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-/.
+     * 
+ * + * string function_id = 3; + * + * @return The functionId. + */ + public java.lang.String getFunctionId() { + java.lang.Object ref = functionId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + functionId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The ID to use for the function, which will become the final component of
+     * the function's resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-/.
+     * 
+ * + * string function_id = 3; + * + * @return The bytes for functionId. + */ + public com.google.protobuf.ByteString getFunctionIdBytes() { + java.lang.Object ref = functionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + functionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The ID to use for the function, which will become the final component of
+     * the function's resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-/.
+     * 
+ * + * string function_id = 3; + * + * @param value The functionId to set. + * @return This builder for chaining. + */ + public Builder setFunctionId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + functionId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The ID to use for the function, which will become the final component of
+     * the function's resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-/.
+     * 
+ * + * string function_id = 3; + * + * @return This builder for chaining. + */ + public Builder clearFunctionId() { + + functionId_ = getDefaultInstance().getFunctionId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The ID to use for the function, which will become the final component of
+     * the function's resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-/.
+     * 
+ * + * string function_id = 3; + * + * @param value The bytes for functionId to set. + * @return This builder for chaining. + */ + public Builder setFunctionIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + functionId_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2alpha.CreateFunctionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2alpha.CreateFunctionRequest) + private static final com.google.cloud.functions.v2alpha.CreateFunctionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2alpha.CreateFunctionRequest(); + } + + public static com.google.cloud.functions.v2alpha.CreateFunctionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateFunctionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateFunctionRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.CreateFunctionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/CreateFunctionRequestOrBuilder.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/CreateFunctionRequestOrBuilder.java new file mode 100644 index 00000000..44bd88c4 --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/CreateFunctionRequestOrBuilder.java @@ -0,0 +1,128 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +public interface CreateFunctionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2alpha.CreateFunctionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The project and location in which the function should be created, specified
+   * in the format `projects/*/locations/*`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The project and location in which the function should be created, specified
+   * in the format `projects/*/locations/*`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. Function to be created.
+   * 
+ * + * + * .google.cloud.functions.v2alpha.Function function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the function field is set. + */ + boolean hasFunction(); + /** + * + * + *
+   * Required. Function to be created.
+   * 
+ * + * + * .google.cloud.functions.v2alpha.Function function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The function. + */ + com.google.cloud.functions.v2alpha.Function getFunction(); + /** + * + * + *
+   * Required. Function to be created.
+   * 
+ * + * + * .google.cloud.functions.v2alpha.Function function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.functions.v2alpha.FunctionOrBuilder getFunctionOrBuilder(); + + /** + * + * + *
+   * The ID to use for the function, which will become the final component of
+   * the function's resource name.
+   * This value should be 4-63 characters, and valid characters
+   * are /[a-z][0-9]-/.
+   * 
+ * + * string function_id = 3; + * + * @return The functionId. + */ + java.lang.String getFunctionId(); + /** + * + * + *
+   * The ID to use for the function, which will become the final component of
+   * the function's resource name.
+   * This value should be 4-63 characters, and valid characters
+   * are /[a-z][0-9]-/.
+   * 
+ * + * string function_id = 3; + * + * @return The bytes for functionId. + */ + com.google.protobuf.ByteString getFunctionIdBytes(); +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/DeleteFunctionRequest.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/DeleteFunctionRequest.java new file mode 100644 index 00000000..4bd8cd10 --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/DeleteFunctionRequest.java @@ -0,0 +1,653 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +/** + * + * + *
+ * Request for the `DeleteFunction` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.DeleteFunctionRequest} + */ +public final class DeleteFunctionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2alpha.DeleteFunctionRequest) + DeleteFunctionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteFunctionRequest.newBuilder() to construct. + private DeleteFunctionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteFunctionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteFunctionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteFunctionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_DeleteFunctionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_DeleteFunctionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.DeleteFunctionRequest.class, + com.google.cloud.functions.v2alpha.DeleteFunctionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the function which should be deleted.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the function which should be deleted.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2alpha.DeleteFunctionRequest)) { + return super.equals(obj); + } + com.google.cloud.functions.v2alpha.DeleteFunctionRequest other = + (com.google.cloud.functions.v2alpha.DeleteFunctionRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2alpha.DeleteFunctionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.DeleteFunctionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.DeleteFunctionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.DeleteFunctionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.DeleteFunctionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.DeleteFunctionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.DeleteFunctionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.DeleteFunctionRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.DeleteFunctionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.DeleteFunctionRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.DeleteFunctionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.DeleteFunctionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.functions.v2alpha.DeleteFunctionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the `DeleteFunction` method.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.DeleteFunctionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2alpha.DeleteFunctionRequest) + com.google.cloud.functions.v2alpha.DeleteFunctionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_DeleteFunctionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_DeleteFunctionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.DeleteFunctionRequest.class, + com.google.cloud.functions.v2alpha.DeleteFunctionRequest.Builder.class); + } + + // Construct using com.google.cloud.functions.v2alpha.DeleteFunctionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_DeleteFunctionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.DeleteFunctionRequest getDefaultInstanceForType() { + return com.google.cloud.functions.v2alpha.DeleteFunctionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.DeleteFunctionRequest build() { + com.google.cloud.functions.v2alpha.DeleteFunctionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.DeleteFunctionRequest buildPartial() { + com.google.cloud.functions.v2alpha.DeleteFunctionRequest result = + new com.google.cloud.functions.v2alpha.DeleteFunctionRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2alpha.DeleteFunctionRequest) { + return mergeFrom((com.google.cloud.functions.v2alpha.DeleteFunctionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2alpha.DeleteFunctionRequest other) { + if (other == com.google.cloud.functions.v2alpha.DeleteFunctionRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2alpha.DeleteFunctionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2alpha.DeleteFunctionRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the function which should be deleted.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the function which should be deleted.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the function which should be deleted.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the function which should be deleted.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the function which should be deleted.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2alpha.DeleteFunctionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2alpha.DeleteFunctionRequest) + private static final com.google.cloud.functions.v2alpha.DeleteFunctionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2alpha.DeleteFunctionRequest(); + } + + public static com.google.cloud.functions.v2alpha.DeleteFunctionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteFunctionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteFunctionRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.DeleteFunctionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/DeleteFunctionRequestOrBuilder.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/DeleteFunctionRequestOrBuilder.java new file mode 100644 index 00000000..34b9ca93 --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/DeleteFunctionRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +public interface DeleteFunctionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2alpha.DeleteFunctionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the function which should be deleted.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the function which should be deleted.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/Environment.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/Environment.java new file mode 100644 index 00000000..289502af --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/Environment.java @@ -0,0 +1,176 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +/** + * + * + *
+ * The environment the function is hosted on.
+ * 
+ * + * Protobuf enum {@code google.cloud.functions.v2alpha.Environment} + */ +public enum Environment implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Unspecified
+   * 
+ * + * ENVIRONMENT_UNSPECIFIED = 0; + */ + ENVIRONMENT_UNSPECIFIED(0), + /** + * + * + *
+   * Gen 1
+   * 
+ * + * GEN_1 = 1; + */ + GEN_1(1), + /** + * + * + *
+   * Gen 2
+   * 
+ * + * GEN_2 = 2; + */ + GEN_2(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Unspecified
+   * 
+ * + * ENVIRONMENT_UNSPECIFIED = 0; + */ + public static final int ENVIRONMENT_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Gen 1
+   * 
+ * + * GEN_1 = 1; + */ + public static final int GEN_1_VALUE = 1; + /** + * + * + *
+   * Gen 2
+   * 
+ * + * GEN_2 = 2; + */ + public static final int GEN_2_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Environment valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Environment forNumber(int value) { + switch (value) { + case 0: + return ENVIRONMENT_UNSPECIFIED; + case 1: + return GEN_1; + case 2: + return GEN_2; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Environment findValueByNumber(int number) { + return Environment.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto.getDescriptor().getEnumTypes().get(0); + } + + private static final Environment[] VALUES = values(); + + public static Environment valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Environment(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.functions.v2alpha.Environment) +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/EventFilter.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/EventFilter.java new file mode 100644 index 00000000..d148dbc7 --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/EventFilter.java @@ -0,0 +1,1015 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +/** + * + * + *
+ * Filters events based on exact matches on the CloudEvents attributes.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.EventFilter} + */ +public final class EventFilter extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2alpha.EventFilter) + EventFilterOrBuilder { + private static final long serialVersionUID = 0L; + // Use EventFilter.newBuilder() to construct. + private EventFilter(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EventFilter() { + attribute_ = ""; + value_ = ""; + operator_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EventFilter(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private EventFilter( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + attribute_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + value_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + operator_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_EventFilter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_EventFilter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.EventFilter.class, + com.google.cloud.functions.v2alpha.EventFilter.Builder.class); + } + + public static final int ATTRIBUTE_FIELD_NUMBER = 1; + private volatile java.lang.Object attribute_; + /** + * + * + *
+   * Required. The name of a CloudEvents attribute.
+   * 
+ * + * string attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The attribute. + */ + @java.lang.Override + public java.lang.String getAttribute() { + java.lang.Object ref = attribute_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + attribute_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of a CloudEvents attribute.
+   * 
+ * + * string attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for attribute. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAttributeBytes() { + java.lang.Object ref = attribute_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attribute_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUE_FIELD_NUMBER = 2; + private volatile java.lang.Object value_; + /** + * + * + *
+   * Required. The value for the attribute.
+   * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The value. + */ + @java.lang.Override + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The value for the attribute.
+   * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OPERATOR_FIELD_NUMBER = 3; + private volatile java.lang.Object operator_; + /** + * + * + *
+   * Optional. The operator used for matching the events with the value of the
+   * filter. If not specified, only events that have an exact key-value pair
+   * specified in the filter are matched. The only allowed value is
+   * `match-path-pattern`.
+   * 
+ * + * string operator = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The operator. + */ + @java.lang.Override + public java.lang.String getOperator() { + java.lang.Object ref = operator_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + operator_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The operator used for matching the events with the value of the
+   * filter. If not specified, only events that have an exact key-value pair
+   * specified in the filter are matched. The only allowed value is
+   * `match-path-pattern`.
+   * 
+ * + * string operator = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for operator. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOperatorBytes() { + java.lang.Object ref = operator_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + operator_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attribute_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, attribute_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(value_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, value_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(operator_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, operator_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attribute_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, attribute_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(value_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, value_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(operator_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, operator_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2alpha.EventFilter)) { + return super.equals(obj); + } + com.google.cloud.functions.v2alpha.EventFilter other = + (com.google.cloud.functions.v2alpha.EventFilter) obj; + + if (!getAttribute().equals(other.getAttribute())) return false; + if (!getValue().equals(other.getValue())) return false; + if (!getOperator().equals(other.getOperator())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ATTRIBUTE_FIELD_NUMBER; + hash = (53 * hash) + getAttribute().hashCode(); + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + hash = (37 * hash) + OPERATOR_FIELD_NUMBER; + hash = (53 * hash) + getOperator().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2alpha.EventFilter parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.EventFilter parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.EventFilter parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.EventFilter parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.EventFilter parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.EventFilter parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.EventFilter parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.EventFilter parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.EventFilter parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.EventFilter parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.EventFilter parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.EventFilter parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v2alpha.EventFilter prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Filters events based on exact matches on the CloudEvents attributes.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.EventFilter} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2alpha.EventFilter) + com.google.cloud.functions.v2alpha.EventFilterOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_EventFilter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_EventFilter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.EventFilter.class, + com.google.cloud.functions.v2alpha.EventFilter.Builder.class); + } + + // Construct using com.google.cloud.functions.v2alpha.EventFilter.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + attribute_ = ""; + + value_ = ""; + + operator_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_EventFilter_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.EventFilter getDefaultInstanceForType() { + return com.google.cloud.functions.v2alpha.EventFilter.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.EventFilter build() { + com.google.cloud.functions.v2alpha.EventFilter result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.EventFilter buildPartial() { + com.google.cloud.functions.v2alpha.EventFilter result = + new com.google.cloud.functions.v2alpha.EventFilter(this); + result.attribute_ = attribute_; + result.value_ = value_; + result.operator_ = operator_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2alpha.EventFilter) { + return mergeFrom((com.google.cloud.functions.v2alpha.EventFilter) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2alpha.EventFilter other) { + if (other == com.google.cloud.functions.v2alpha.EventFilter.getDefaultInstance()) return this; + if (!other.getAttribute().isEmpty()) { + attribute_ = other.attribute_; + onChanged(); + } + if (!other.getValue().isEmpty()) { + value_ = other.value_; + onChanged(); + } + if (!other.getOperator().isEmpty()) { + operator_ = other.operator_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2alpha.EventFilter parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v2alpha.EventFilter) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object attribute_ = ""; + /** + * + * + *
+     * Required. The name of a CloudEvents attribute.
+     * 
+ * + * string attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The attribute. + */ + public java.lang.String getAttribute() { + java.lang.Object ref = attribute_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + attribute_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of a CloudEvents attribute.
+     * 
+ * + * string attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for attribute. + */ + public com.google.protobuf.ByteString getAttributeBytes() { + java.lang.Object ref = attribute_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attribute_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of a CloudEvents attribute.
+     * 
+ * + * string attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The attribute to set. + * @return This builder for chaining. + */ + public Builder setAttribute(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + attribute_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of a CloudEvents attribute.
+     * 
+ * + * string attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearAttribute() { + + attribute_ = getDefaultInstance().getAttribute(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of a CloudEvents attribute.
+     * 
+ * + * string attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for attribute to set. + * @return This builder for chaining. + */ + public Builder setAttributeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + attribute_ = value; + onChanged(); + return this; + } + + private java.lang.Object value_ = ""; + /** + * + * + *
+     * Required. The value for the attribute.
+     * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The value. + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The value for the attribute.
+     * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for value. + */ + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The value for the attribute.
+     * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + value_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The value for the attribute.
+     * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + + value_ = getDefaultInstance().getValue(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The value for the attribute.
+     * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for value to set. + * @return This builder for chaining. + */ + public Builder setValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + value_ = value; + onChanged(); + return this; + } + + private java.lang.Object operator_ = ""; + /** + * + * + *
+     * Optional. The operator used for matching the events with the value of the
+     * filter. If not specified, only events that have an exact key-value pair
+     * specified in the filter are matched. The only allowed value is
+     * `match-path-pattern`.
+     * 
+ * + * string operator = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The operator. + */ + public java.lang.String getOperator() { + java.lang.Object ref = operator_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + operator_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The operator used for matching the events with the value of the
+     * filter. If not specified, only events that have an exact key-value pair
+     * specified in the filter are matched. The only allowed value is
+     * `match-path-pattern`.
+     * 
+ * + * string operator = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for operator. + */ + public com.google.protobuf.ByteString getOperatorBytes() { + java.lang.Object ref = operator_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + operator_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The operator used for matching the events with the value of the
+     * filter. If not specified, only events that have an exact key-value pair
+     * specified in the filter are matched. The only allowed value is
+     * `match-path-pattern`.
+     * 
+ * + * string operator = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The operator to set. + * @return This builder for chaining. + */ + public Builder setOperator(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + operator_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The operator used for matching the events with the value of the
+     * filter. If not specified, only events that have an exact key-value pair
+     * specified in the filter are matched. The only allowed value is
+     * `match-path-pattern`.
+     * 
+ * + * string operator = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearOperator() { + + operator_ = getDefaultInstance().getOperator(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The operator used for matching the events with the value of the
+     * filter. If not specified, only events that have an exact key-value pair
+     * specified in the filter are matched. The only allowed value is
+     * `match-path-pattern`.
+     * 
+ * + * string operator = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for operator to set. + * @return This builder for chaining. + */ + public Builder setOperatorBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + operator_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2alpha.EventFilter) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2alpha.EventFilter) + private static final com.google.cloud.functions.v2alpha.EventFilter DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2alpha.EventFilter(); + } + + public static com.google.cloud.functions.v2alpha.EventFilter getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EventFilter parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EventFilter(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.EventFilter getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/EventFilterOrBuilder.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/EventFilterOrBuilder.java new file mode 100644 index 00000000..47ae6b37 --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/EventFilterOrBuilder.java @@ -0,0 +1,106 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +public interface EventFilterOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2alpha.EventFilter) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of a CloudEvents attribute.
+   * 
+ * + * string attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The attribute. + */ + java.lang.String getAttribute(); + /** + * + * + *
+   * Required. The name of a CloudEvents attribute.
+   * 
+ * + * string attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for attribute. + */ + com.google.protobuf.ByteString getAttributeBytes(); + + /** + * + * + *
+   * Required. The value for the attribute.
+   * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The value. + */ + java.lang.String getValue(); + /** + * + * + *
+   * Required. The value for the attribute.
+   * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for value. + */ + com.google.protobuf.ByteString getValueBytes(); + + /** + * + * + *
+   * Optional. The operator used for matching the events with the value of the
+   * filter. If not specified, only events that have an exact key-value pair
+   * specified in the filter are matched. The only allowed value is
+   * `match-path-pattern`.
+   * 
+ * + * string operator = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The operator. + */ + java.lang.String getOperator(); + /** + * + * + *
+   * Optional. The operator used for matching the events with the value of the
+   * filter. If not specified, only events that have an exact key-value pair
+   * specified in the filter are matched. The only allowed value is
+   * `match-path-pattern`.
+   * 
+ * + * string operator = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for operator. + */ + com.google.protobuf.ByteString getOperatorBytes(); +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/EventTrigger.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/EventTrigger.java new file mode 100644 index 00000000..95129990 --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/EventTrigger.java @@ -0,0 +1,2529 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +/** + * + * + *
+ * Describes EventTrigger, used to request events to be sent from another
+ * service.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.EventTrigger} + */ +public final class EventTrigger extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2alpha.EventTrigger) + EventTriggerOrBuilder { + private static final long serialVersionUID = 0L; + // Use EventTrigger.newBuilder() to construct. + private EventTrigger(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EventTrigger() { + trigger_ = ""; + triggerRegion_ = ""; + eventType_ = ""; + eventFilters_ = java.util.Collections.emptyList(); + pubsubTopic_ = ""; + serviceAccountEmail_ = ""; + retryPolicy_ = 0; + channel_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EventTrigger(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private EventTrigger( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + trigger_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + triggerRegion_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + eventType_ = s; + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + eventFilters_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + eventFilters_.add( + input.readMessage( + com.google.cloud.functions.v2alpha.EventFilter.parser(), extensionRegistry)); + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + pubsubTopic_ = s; + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + serviceAccountEmail_ = s; + break; + } + case 56: + { + int rawValue = input.readEnum(); + + retryPolicy_ = rawValue; + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + + channel_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + eventFilters_ = java.util.Collections.unmodifiableList(eventFilters_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_EventTrigger_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_EventTrigger_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.EventTrigger.class, + com.google.cloud.functions.v2alpha.EventTrigger.Builder.class); + } + + /** + * + * + *
+   * Describes the retry policy in case of function's execution failure.
+   * Retried execution is charged as any other execution.
+   * 
+ * + * Protobuf enum {@code google.cloud.functions.v2alpha.EventTrigger.RetryPolicy} + */ + public enum RetryPolicy implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not specified.
+     * 
+ * + * RETRY_POLICY_UNSPECIFIED = 0; + */ + RETRY_POLICY_UNSPECIFIED(0), + /** + * + * + *
+     * Do not retry.
+     * 
+ * + * RETRY_POLICY_DO_NOT_RETRY = 1; + */ + RETRY_POLICY_DO_NOT_RETRY(1), + /** + * + * + *
+     * Retry on any failure, retry up to 7 days with an exponential backoff
+     * (capped at 10 seconds).
+     * 
+ * + * RETRY_POLICY_RETRY = 2; + */ + RETRY_POLICY_RETRY(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not specified.
+     * 
+ * + * RETRY_POLICY_UNSPECIFIED = 0; + */ + public static final int RETRY_POLICY_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Do not retry.
+     * 
+ * + * RETRY_POLICY_DO_NOT_RETRY = 1; + */ + public static final int RETRY_POLICY_DO_NOT_RETRY_VALUE = 1; + /** + * + * + *
+     * Retry on any failure, retry up to 7 days with an exponential backoff
+     * (capped at 10 seconds).
+     * 
+ * + * RETRY_POLICY_RETRY = 2; + */ + public static final int RETRY_POLICY_RETRY_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static RetryPolicy valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static RetryPolicy forNumber(int value) { + switch (value) { + case 0: + return RETRY_POLICY_UNSPECIFIED; + case 1: + return RETRY_POLICY_DO_NOT_RETRY; + case 2: + return RETRY_POLICY_RETRY; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public RetryPolicy findValueByNumber(int number) { + return RetryPolicy.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.EventTrigger.getDescriptor().getEnumTypes().get(0); + } + + private static final RetryPolicy[] VALUES = values(); + + public static RetryPolicy valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private RetryPolicy(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.functions.v2alpha.EventTrigger.RetryPolicy) + } + + public static final int TRIGGER_FIELD_NUMBER = 1; + private volatile java.lang.Object trigger_; + /** + * + * + *
+   * Output only. The resource name of the Eventarc trigger. The format of this field is
+   * `projects/{project}/locations/{region}/triggers/{trigger}`.
+   * 
+ * + * + * string trigger = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The trigger. + */ + @java.lang.Override + public java.lang.String getTrigger() { + java.lang.Object ref = trigger_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + trigger_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The resource name of the Eventarc trigger. The format of this field is
+   * `projects/{project}/locations/{region}/triggers/{trigger}`.
+   * 
+ * + * + * string trigger = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for trigger. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTriggerBytes() { + java.lang.Object ref = trigger_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + trigger_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TRIGGER_REGION_FIELD_NUMBER = 2; + private volatile java.lang.Object triggerRegion_; + /** + * + * + *
+   * The region that the trigger will be in. The trigger will only receive
+   * events originating in this region. It can be the same
+   * region as the function, a different region or multi-region, or the global
+   * region. If not provided, defaults to the same region as the function.
+   * 
+ * + * string trigger_region = 2; + * + * @return The triggerRegion. + */ + @java.lang.Override + public java.lang.String getTriggerRegion() { + java.lang.Object ref = triggerRegion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + triggerRegion_ = s; + return s; + } + } + /** + * + * + *
+   * The region that the trigger will be in. The trigger will only receive
+   * events originating in this region. It can be the same
+   * region as the function, a different region or multi-region, or the global
+   * region. If not provided, defaults to the same region as the function.
+   * 
+ * + * string trigger_region = 2; + * + * @return The bytes for triggerRegion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTriggerRegionBytes() { + java.lang.Object ref = triggerRegion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + triggerRegion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EVENT_TYPE_FIELD_NUMBER = 3; + private volatile java.lang.Object eventType_; + /** + * + * + *
+   * Required. The type of event to observe. For example:
+   * `google.cloud.audit.log.v1.written` or
+   * `google.cloud.pubsub.topic.v1.messagePublished`.
+   * 
+ * + * string event_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The eventType. + */ + @java.lang.Override + public java.lang.String getEventType() { + java.lang.Object ref = eventType_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + eventType_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The type of event to observe. For example:
+   * `google.cloud.audit.log.v1.written` or
+   * `google.cloud.pubsub.topic.v1.messagePublished`.
+   * 
+ * + * string event_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for eventType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEventTypeBytes() { + java.lang.Object ref = eventType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + eventType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EVENT_FILTERS_FIELD_NUMBER = 4; + private java.util.List eventFilters_; + /** + * + * + *
+   * Criteria used to filter events.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.EventFilter event_filters = 4; + */ + @java.lang.Override + public java.util.List getEventFiltersList() { + return eventFilters_; + } + /** + * + * + *
+   * Criteria used to filter events.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.EventFilter event_filters = 4; + */ + @java.lang.Override + public java.util.List + getEventFiltersOrBuilderList() { + return eventFilters_; + } + /** + * + * + *
+   * Criteria used to filter events.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.EventFilter event_filters = 4; + */ + @java.lang.Override + public int getEventFiltersCount() { + return eventFilters_.size(); + } + /** + * + * + *
+   * Criteria used to filter events.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.EventFilter event_filters = 4; + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.EventFilter getEventFilters(int index) { + return eventFilters_.get(index); + } + /** + * + * + *
+   * Criteria used to filter events.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.EventFilter event_filters = 4; + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.EventFilterOrBuilder getEventFiltersOrBuilder( + int index) { + return eventFilters_.get(index); + } + + public static final int PUBSUB_TOPIC_FIELD_NUMBER = 5; + private volatile java.lang.Object pubsubTopic_; + /** + * + * + *
+   * Optional. The name of a Pub/Sub topic in the same project that will be used
+   * as the transport topic for the event delivery. Format:
+   * `projects/{project}/topics/{topic}`.
+   * This is only valid for events of type
+   * `google.cloud.pubsub.topic.v1.messagePublished`. The topic provided here
+   * will not be deleted at function deletion.
+   * 
+ * + * + * string pubsub_topic = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The pubsubTopic. + */ + @java.lang.Override + public java.lang.String getPubsubTopic() { + java.lang.Object ref = pubsubTopic_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pubsubTopic_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The name of a Pub/Sub topic in the same project that will be used
+   * as the transport topic for the event delivery. Format:
+   * `projects/{project}/topics/{topic}`.
+   * This is only valid for events of type
+   * `google.cloud.pubsub.topic.v1.messagePublished`. The topic provided here
+   * will not be deleted at function deletion.
+   * 
+ * + * + * string pubsub_topic = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for pubsubTopic. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPubsubTopicBytes() { + java.lang.Object ref = pubsubTopic_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pubsubTopic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVICE_ACCOUNT_EMAIL_FIELD_NUMBER = 6; + private volatile java.lang.Object serviceAccountEmail_; + /** + * + * + *
+   * Optional. The email of the trigger's service account. The service account must have
+   * permission to invoke Cloud Run services, the permission is
+   * `run.routes.invoke`.
+   * If empty, defaults to the Compute Engine default service account:
+   * `{project_number}-compute@developer.gserviceaccount.com`.
+   * 
+ * + * string service_account_email = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The serviceAccountEmail. + */ + @java.lang.Override + public java.lang.String getServiceAccountEmail() { + java.lang.Object ref = serviceAccountEmail_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAccountEmail_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The email of the trigger's service account. The service account must have
+   * permission to invoke Cloud Run services, the permission is
+   * `run.routes.invoke`.
+   * If empty, defaults to the Compute Engine default service account:
+   * `{project_number}-compute@developer.gserviceaccount.com`.
+   * 
+ * + * string service_account_email = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for serviceAccountEmail. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceAccountEmailBytes() { + java.lang.Object ref = serviceAccountEmail_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAccountEmail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RETRY_POLICY_FIELD_NUMBER = 7; + private int retryPolicy_; + /** + * + * + *
+   * Optional. If unset, then defaults to ignoring failures (i.e. not retrying them).
+   * 
+ * + * + * .google.cloud.functions.v2alpha.EventTrigger.RetryPolicy retry_policy = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for retryPolicy. + */ + @java.lang.Override + public int getRetryPolicyValue() { + return retryPolicy_; + } + /** + * + * + *
+   * Optional. If unset, then defaults to ignoring failures (i.e. not retrying them).
+   * 
+ * + * + * .google.cloud.functions.v2alpha.EventTrigger.RetryPolicy retry_policy = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The retryPolicy. + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.EventTrigger.RetryPolicy getRetryPolicy() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2alpha.EventTrigger.RetryPolicy result = + com.google.cloud.functions.v2alpha.EventTrigger.RetryPolicy.valueOf(retryPolicy_); + return result == null + ? com.google.cloud.functions.v2alpha.EventTrigger.RetryPolicy.UNRECOGNIZED + : result; + } + + public static final int CHANNEL_FIELD_NUMBER = 8; + private volatile java.lang.Object channel_; + /** + * + * + *
+   * Optional. The name of the channel associated with the trigger in
+   * `projects/{project}/locations/{location}/channels/{channel}` format.
+   * You must provide a channel to receive events from Eventarc SaaS partners.
+   * 
+ * + * + * string channel = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The channel. + */ + @java.lang.Override + public java.lang.String getChannel() { + java.lang.Object ref = channel_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + channel_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The name of the channel associated with the trigger in
+   * `projects/{project}/locations/{location}/channels/{channel}` format.
+   * You must provide a channel to receive events from Eventarc SaaS partners.
+   * 
+ * + * + * string channel = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for channel. + */ + @java.lang.Override + public com.google.protobuf.ByteString getChannelBytes() { + java.lang.Object ref = channel_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + channel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(trigger_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, trigger_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(triggerRegion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, triggerRegion_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(eventType_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, eventType_); + } + for (int i = 0; i < eventFilters_.size(); i++) { + output.writeMessage(4, eventFilters_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pubsubTopic_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, pubsubTopic_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccountEmail_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, serviceAccountEmail_); + } + if (retryPolicy_ + != com.google.cloud.functions.v2alpha.EventTrigger.RetryPolicy.RETRY_POLICY_UNSPECIFIED + .getNumber()) { + output.writeEnum(7, retryPolicy_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(channel_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, channel_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(trigger_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, trigger_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(triggerRegion_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, triggerRegion_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(eventType_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, eventType_); + } + for (int i = 0; i < eventFilters_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, eventFilters_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pubsubTopic_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, pubsubTopic_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccountEmail_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, serviceAccountEmail_); + } + if (retryPolicy_ + != com.google.cloud.functions.v2alpha.EventTrigger.RetryPolicy.RETRY_POLICY_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, retryPolicy_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(channel_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, channel_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2alpha.EventTrigger)) { + return super.equals(obj); + } + com.google.cloud.functions.v2alpha.EventTrigger other = + (com.google.cloud.functions.v2alpha.EventTrigger) obj; + + if (!getTrigger().equals(other.getTrigger())) return false; + if (!getTriggerRegion().equals(other.getTriggerRegion())) return false; + if (!getEventType().equals(other.getEventType())) return false; + if (!getEventFiltersList().equals(other.getEventFiltersList())) return false; + if (!getPubsubTopic().equals(other.getPubsubTopic())) return false; + if (!getServiceAccountEmail().equals(other.getServiceAccountEmail())) return false; + if (retryPolicy_ != other.retryPolicy_) return false; + if (!getChannel().equals(other.getChannel())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TRIGGER_FIELD_NUMBER; + hash = (53 * hash) + getTrigger().hashCode(); + hash = (37 * hash) + TRIGGER_REGION_FIELD_NUMBER; + hash = (53 * hash) + getTriggerRegion().hashCode(); + hash = (37 * hash) + EVENT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getEventType().hashCode(); + if (getEventFiltersCount() > 0) { + hash = (37 * hash) + EVENT_FILTERS_FIELD_NUMBER; + hash = (53 * hash) + getEventFiltersList().hashCode(); + } + hash = (37 * hash) + PUBSUB_TOPIC_FIELD_NUMBER; + hash = (53 * hash) + getPubsubTopic().hashCode(); + hash = (37 * hash) + SERVICE_ACCOUNT_EMAIL_FIELD_NUMBER; + hash = (53 * hash) + getServiceAccountEmail().hashCode(); + hash = (37 * hash) + RETRY_POLICY_FIELD_NUMBER; + hash = (53 * hash) + retryPolicy_; + hash = (37 * hash) + CHANNEL_FIELD_NUMBER; + hash = (53 * hash) + getChannel().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2alpha.EventTrigger parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.EventTrigger parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.EventTrigger parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.EventTrigger parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.EventTrigger parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.EventTrigger parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.EventTrigger parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.EventTrigger parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.EventTrigger parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.EventTrigger parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.EventTrigger parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.EventTrigger parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v2alpha.EventTrigger prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Describes EventTrigger, used to request events to be sent from another
+   * service.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.EventTrigger} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2alpha.EventTrigger) + com.google.cloud.functions.v2alpha.EventTriggerOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_EventTrigger_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_EventTrigger_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.EventTrigger.class, + com.google.cloud.functions.v2alpha.EventTrigger.Builder.class); + } + + // Construct using com.google.cloud.functions.v2alpha.EventTrigger.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getEventFiltersFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + trigger_ = ""; + + triggerRegion_ = ""; + + eventType_ = ""; + + if (eventFiltersBuilder_ == null) { + eventFilters_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + eventFiltersBuilder_.clear(); + } + pubsubTopic_ = ""; + + serviceAccountEmail_ = ""; + + retryPolicy_ = 0; + + channel_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_EventTrigger_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.EventTrigger getDefaultInstanceForType() { + return com.google.cloud.functions.v2alpha.EventTrigger.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.EventTrigger build() { + com.google.cloud.functions.v2alpha.EventTrigger result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.EventTrigger buildPartial() { + com.google.cloud.functions.v2alpha.EventTrigger result = + new com.google.cloud.functions.v2alpha.EventTrigger(this); + int from_bitField0_ = bitField0_; + result.trigger_ = trigger_; + result.triggerRegion_ = triggerRegion_; + result.eventType_ = eventType_; + if (eventFiltersBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + eventFilters_ = java.util.Collections.unmodifiableList(eventFilters_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.eventFilters_ = eventFilters_; + } else { + result.eventFilters_ = eventFiltersBuilder_.build(); + } + result.pubsubTopic_ = pubsubTopic_; + result.serviceAccountEmail_ = serviceAccountEmail_; + result.retryPolicy_ = retryPolicy_; + result.channel_ = channel_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2alpha.EventTrigger) { + return mergeFrom((com.google.cloud.functions.v2alpha.EventTrigger) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2alpha.EventTrigger other) { + if (other == com.google.cloud.functions.v2alpha.EventTrigger.getDefaultInstance()) + return this; + if (!other.getTrigger().isEmpty()) { + trigger_ = other.trigger_; + onChanged(); + } + if (!other.getTriggerRegion().isEmpty()) { + triggerRegion_ = other.triggerRegion_; + onChanged(); + } + if (!other.getEventType().isEmpty()) { + eventType_ = other.eventType_; + onChanged(); + } + if (eventFiltersBuilder_ == null) { + if (!other.eventFilters_.isEmpty()) { + if (eventFilters_.isEmpty()) { + eventFilters_ = other.eventFilters_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureEventFiltersIsMutable(); + eventFilters_.addAll(other.eventFilters_); + } + onChanged(); + } + } else { + if (!other.eventFilters_.isEmpty()) { + if (eventFiltersBuilder_.isEmpty()) { + eventFiltersBuilder_.dispose(); + eventFiltersBuilder_ = null; + eventFilters_ = other.eventFilters_; + bitField0_ = (bitField0_ & ~0x00000001); + eventFiltersBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getEventFiltersFieldBuilder() + : null; + } else { + eventFiltersBuilder_.addAllMessages(other.eventFilters_); + } + } + } + if (!other.getPubsubTopic().isEmpty()) { + pubsubTopic_ = other.pubsubTopic_; + onChanged(); + } + if (!other.getServiceAccountEmail().isEmpty()) { + serviceAccountEmail_ = other.serviceAccountEmail_; + onChanged(); + } + if (other.retryPolicy_ != 0) { + setRetryPolicyValue(other.getRetryPolicyValue()); + } + if (!other.getChannel().isEmpty()) { + channel_ = other.channel_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2alpha.EventTrigger parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v2alpha.EventTrigger) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object trigger_ = ""; + /** + * + * + *
+     * Output only. The resource name of the Eventarc trigger. The format of this field is
+     * `projects/{project}/locations/{region}/triggers/{trigger}`.
+     * 
+ * + * + * string trigger = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The trigger. + */ + public java.lang.String getTrigger() { + java.lang.Object ref = trigger_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + trigger_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The resource name of the Eventarc trigger. The format of this field is
+     * `projects/{project}/locations/{region}/triggers/{trigger}`.
+     * 
+ * + * + * string trigger = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for trigger. + */ + public com.google.protobuf.ByteString getTriggerBytes() { + java.lang.Object ref = trigger_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + trigger_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The resource name of the Eventarc trigger. The format of this field is
+     * `projects/{project}/locations/{region}/triggers/{trigger}`.
+     * 
+ * + * + * string trigger = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The trigger to set. + * @return This builder for chaining. + */ + public Builder setTrigger(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + trigger_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The resource name of the Eventarc trigger. The format of this field is
+     * `projects/{project}/locations/{region}/triggers/{trigger}`.
+     * 
+ * + * + * string trigger = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearTrigger() { + + trigger_ = getDefaultInstance().getTrigger(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The resource name of the Eventarc trigger. The format of this field is
+     * `projects/{project}/locations/{region}/triggers/{trigger}`.
+     * 
+ * + * + * string trigger = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for trigger to set. + * @return This builder for chaining. + */ + public Builder setTriggerBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + trigger_ = value; + onChanged(); + return this; + } + + private java.lang.Object triggerRegion_ = ""; + /** + * + * + *
+     * The region that the trigger will be in. The trigger will only receive
+     * events originating in this region. It can be the same
+     * region as the function, a different region or multi-region, or the global
+     * region. If not provided, defaults to the same region as the function.
+     * 
+ * + * string trigger_region = 2; + * + * @return The triggerRegion. + */ + public java.lang.String getTriggerRegion() { + java.lang.Object ref = triggerRegion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + triggerRegion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The region that the trigger will be in. The trigger will only receive
+     * events originating in this region. It can be the same
+     * region as the function, a different region or multi-region, or the global
+     * region. If not provided, defaults to the same region as the function.
+     * 
+ * + * string trigger_region = 2; + * + * @return The bytes for triggerRegion. + */ + public com.google.protobuf.ByteString getTriggerRegionBytes() { + java.lang.Object ref = triggerRegion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + triggerRegion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The region that the trigger will be in. The trigger will only receive
+     * events originating in this region. It can be the same
+     * region as the function, a different region or multi-region, or the global
+     * region. If not provided, defaults to the same region as the function.
+     * 
+ * + * string trigger_region = 2; + * + * @param value The triggerRegion to set. + * @return This builder for chaining. + */ + public Builder setTriggerRegion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + triggerRegion_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The region that the trigger will be in. The trigger will only receive
+     * events originating in this region. It can be the same
+     * region as the function, a different region or multi-region, or the global
+     * region. If not provided, defaults to the same region as the function.
+     * 
+ * + * string trigger_region = 2; + * + * @return This builder for chaining. + */ + public Builder clearTriggerRegion() { + + triggerRegion_ = getDefaultInstance().getTriggerRegion(); + onChanged(); + return this; + } + /** + * + * + *
+     * The region that the trigger will be in. The trigger will only receive
+     * events originating in this region. It can be the same
+     * region as the function, a different region or multi-region, or the global
+     * region. If not provided, defaults to the same region as the function.
+     * 
+ * + * string trigger_region = 2; + * + * @param value The bytes for triggerRegion to set. + * @return This builder for chaining. + */ + public Builder setTriggerRegionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + triggerRegion_ = value; + onChanged(); + return this; + } + + private java.lang.Object eventType_ = ""; + /** + * + * + *
+     * Required. The type of event to observe. For example:
+     * `google.cloud.audit.log.v1.written` or
+     * `google.cloud.pubsub.topic.v1.messagePublished`.
+     * 
+ * + * string event_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The eventType. + */ + public java.lang.String getEventType() { + java.lang.Object ref = eventType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + eventType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The type of event to observe. For example:
+     * `google.cloud.audit.log.v1.written` or
+     * `google.cloud.pubsub.topic.v1.messagePublished`.
+     * 
+ * + * string event_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for eventType. + */ + public com.google.protobuf.ByteString getEventTypeBytes() { + java.lang.Object ref = eventType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + eventType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The type of event to observe. For example:
+     * `google.cloud.audit.log.v1.written` or
+     * `google.cloud.pubsub.topic.v1.messagePublished`.
+     * 
+ * + * string event_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The eventType to set. + * @return This builder for chaining. + */ + public Builder setEventType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + eventType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The type of event to observe. For example:
+     * `google.cloud.audit.log.v1.written` or
+     * `google.cloud.pubsub.topic.v1.messagePublished`.
+     * 
+ * + * string event_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearEventType() { + + eventType_ = getDefaultInstance().getEventType(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The type of event to observe. For example:
+     * `google.cloud.audit.log.v1.written` or
+     * `google.cloud.pubsub.topic.v1.messagePublished`.
+     * 
+ * + * string event_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for eventType to set. + * @return This builder for chaining. + */ + public Builder setEventTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + eventType_ = value; + onChanged(); + return this; + } + + private java.util.List eventFilters_ = + java.util.Collections.emptyList(); + + private void ensureEventFiltersIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + eventFilters_ = + new java.util.ArrayList(eventFilters_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2alpha.EventFilter, + com.google.cloud.functions.v2alpha.EventFilter.Builder, + com.google.cloud.functions.v2alpha.EventFilterOrBuilder> + eventFiltersBuilder_; + + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.EventFilter event_filters = 4; + */ + public java.util.List getEventFiltersList() { + if (eventFiltersBuilder_ == null) { + return java.util.Collections.unmodifiableList(eventFilters_); + } else { + return eventFiltersBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.EventFilter event_filters = 4; + */ + public int getEventFiltersCount() { + if (eventFiltersBuilder_ == null) { + return eventFilters_.size(); + } else { + return eventFiltersBuilder_.getCount(); + } + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.EventFilter event_filters = 4; + */ + public com.google.cloud.functions.v2alpha.EventFilter getEventFilters(int index) { + if (eventFiltersBuilder_ == null) { + return eventFilters_.get(index); + } else { + return eventFiltersBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.EventFilter event_filters = 4; + */ + public Builder setEventFilters( + int index, com.google.cloud.functions.v2alpha.EventFilter value) { + if (eventFiltersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventFiltersIsMutable(); + eventFilters_.set(index, value); + onChanged(); + } else { + eventFiltersBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.EventFilter event_filters = 4; + */ + public Builder setEventFilters( + int index, com.google.cloud.functions.v2alpha.EventFilter.Builder builderForValue) { + if (eventFiltersBuilder_ == null) { + ensureEventFiltersIsMutable(); + eventFilters_.set(index, builderForValue.build()); + onChanged(); + } else { + eventFiltersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.EventFilter event_filters = 4; + */ + public Builder addEventFilters(com.google.cloud.functions.v2alpha.EventFilter value) { + if (eventFiltersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventFiltersIsMutable(); + eventFilters_.add(value); + onChanged(); + } else { + eventFiltersBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.EventFilter event_filters = 4; + */ + public Builder addEventFilters( + int index, com.google.cloud.functions.v2alpha.EventFilter value) { + if (eventFiltersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventFiltersIsMutable(); + eventFilters_.add(index, value); + onChanged(); + } else { + eventFiltersBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.EventFilter event_filters = 4; + */ + public Builder addEventFilters( + com.google.cloud.functions.v2alpha.EventFilter.Builder builderForValue) { + if (eventFiltersBuilder_ == null) { + ensureEventFiltersIsMutable(); + eventFilters_.add(builderForValue.build()); + onChanged(); + } else { + eventFiltersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.EventFilter event_filters = 4; + */ + public Builder addEventFilters( + int index, com.google.cloud.functions.v2alpha.EventFilter.Builder builderForValue) { + if (eventFiltersBuilder_ == null) { + ensureEventFiltersIsMutable(); + eventFilters_.add(index, builderForValue.build()); + onChanged(); + } else { + eventFiltersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.EventFilter event_filters = 4; + */ + public Builder addAllEventFilters( + java.lang.Iterable values) { + if (eventFiltersBuilder_ == null) { + ensureEventFiltersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, eventFilters_); + onChanged(); + } else { + eventFiltersBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.EventFilter event_filters = 4; + */ + public Builder clearEventFilters() { + if (eventFiltersBuilder_ == null) { + eventFilters_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + eventFiltersBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.EventFilter event_filters = 4; + */ + public Builder removeEventFilters(int index) { + if (eventFiltersBuilder_ == null) { + ensureEventFiltersIsMutable(); + eventFilters_.remove(index); + onChanged(); + } else { + eventFiltersBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.EventFilter event_filters = 4; + */ + public com.google.cloud.functions.v2alpha.EventFilter.Builder getEventFiltersBuilder( + int index) { + return getEventFiltersFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.EventFilter event_filters = 4; + */ + public com.google.cloud.functions.v2alpha.EventFilterOrBuilder getEventFiltersOrBuilder( + int index) { + if (eventFiltersBuilder_ == null) { + return eventFilters_.get(index); + } else { + return eventFiltersBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.EventFilter event_filters = 4; + */ + public java.util.List + getEventFiltersOrBuilderList() { + if (eventFiltersBuilder_ != null) { + return eventFiltersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(eventFilters_); + } + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.EventFilter event_filters = 4; + */ + public com.google.cloud.functions.v2alpha.EventFilter.Builder addEventFiltersBuilder() { + return getEventFiltersFieldBuilder() + .addBuilder(com.google.cloud.functions.v2alpha.EventFilter.getDefaultInstance()); + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.EventFilter event_filters = 4; + */ + public com.google.cloud.functions.v2alpha.EventFilter.Builder addEventFiltersBuilder( + int index) { + return getEventFiltersFieldBuilder() + .addBuilder(index, com.google.cloud.functions.v2alpha.EventFilter.getDefaultInstance()); + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.EventFilter event_filters = 4; + */ + public java.util.List + getEventFiltersBuilderList() { + return getEventFiltersFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2alpha.EventFilter, + com.google.cloud.functions.v2alpha.EventFilter.Builder, + com.google.cloud.functions.v2alpha.EventFilterOrBuilder> + getEventFiltersFieldBuilder() { + if (eventFiltersBuilder_ == null) { + eventFiltersBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2alpha.EventFilter, + com.google.cloud.functions.v2alpha.EventFilter.Builder, + com.google.cloud.functions.v2alpha.EventFilterOrBuilder>( + eventFilters_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + eventFilters_ = null; + } + return eventFiltersBuilder_; + } + + private java.lang.Object pubsubTopic_ = ""; + /** + * + * + *
+     * Optional. The name of a Pub/Sub topic in the same project that will be used
+     * as the transport topic for the event delivery. Format:
+     * `projects/{project}/topics/{topic}`.
+     * This is only valid for events of type
+     * `google.cloud.pubsub.topic.v1.messagePublished`. The topic provided here
+     * will not be deleted at function deletion.
+     * 
+ * + * + * string pubsub_topic = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The pubsubTopic. + */ + public java.lang.String getPubsubTopic() { + java.lang.Object ref = pubsubTopic_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pubsubTopic_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The name of a Pub/Sub topic in the same project that will be used
+     * as the transport topic for the event delivery. Format:
+     * `projects/{project}/topics/{topic}`.
+     * This is only valid for events of type
+     * `google.cloud.pubsub.topic.v1.messagePublished`. The topic provided here
+     * will not be deleted at function deletion.
+     * 
+ * + * + * string pubsub_topic = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for pubsubTopic. + */ + public com.google.protobuf.ByteString getPubsubTopicBytes() { + java.lang.Object ref = pubsubTopic_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pubsubTopic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The name of a Pub/Sub topic in the same project that will be used
+     * as the transport topic for the event delivery. Format:
+     * `projects/{project}/topics/{topic}`.
+     * This is only valid for events of type
+     * `google.cloud.pubsub.topic.v1.messagePublished`. The topic provided here
+     * will not be deleted at function deletion.
+     * 
+ * + * + * string pubsub_topic = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The pubsubTopic to set. + * @return This builder for chaining. + */ + public Builder setPubsubTopic(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pubsubTopic_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The name of a Pub/Sub topic in the same project that will be used
+     * as the transport topic for the event delivery. Format:
+     * `projects/{project}/topics/{topic}`.
+     * This is only valid for events of type
+     * `google.cloud.pubsub.topic.v1.messagePublished`. The topic provided here
+     * will not be deleted at function deletion.
+     * 
+ * + * + * string pubsub_topic = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearPubsubTopic() { + + pubsubTopic_ = getDefaultInstance().getPubsubTopic(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The name of a Pub/Sub topic in the same project that will be used
+     * as the transport topic for the event delivery. Format:
+     * `projects/{project}/topics/{topic}`.
+     * This is only valid for events of type
+     * `google.cloud.pubsub.topic.v1.messagePublished`. The topic provided here
+     * will not be deleted at function deletion.
+     * 
+ * + * + * string pubsub_topic = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for pubsubTopic to set. + * @return This builder for chaining. + */ + public Builder setPubsubTopicBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pubsubTopic_ = value; + onChanged(); + return this; + } + + private java.lang.Object serviceAccountEmail_ = ""; + /** + * + * + *
+     * Optional. The email of the trigger's service account. The service account must have
+     * permission to invoke Cloud Run services, the permission is
+     * `run.routes.invoke`.
+     * If empty, defaults to the Compute Engine default service account:
+     * `{project_number}-compute@developer.gserviceaccount.com`.
+     * 
+ * + * string service_account_email = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The serviceAccountEmail. + */ + public java.lang.String getServiceAccountEmail() { + java.lang.Object ref = serviceAccountEmail_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAccountEmail_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The email of the trigger's service account. The service account must have
+     * permission to invoke Cloud Run services, the permission is
+     * `run.routes.invoke`.
+     * If empty, defaults to the Compute Engine default service account:
+     * `{project_number}-compute@developer.gserviceaccount.com`.
+     * 
+ * + * string service_account_email = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for serviceAccountEmail. + */ + public com.google.protobuf.ByteString getServiceAccountEmailBytes() { + java.lang.Object ref = serviceAccountEmail_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAccountEmail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The email of the trigger's service account. The service account must have
+     * permission to invoke Cloud Run services, the permission is
+     * `run.routes.invoke`.
+     * If empty, defaults to the Compute Engine default service account:
+     * `{project_number}-compute@developer.gserviceaccount.com`.
+     * 
+ * + * string service_account_email = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The serviceAccountEmail to set. + * @return This builder for chaining. + */ + public Builder setServiceAccountEmail(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + serviceAccountEmail_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The email of the trigger's service account. The service account must have
+     * permission to invoke Cloud Run services, the permission is
+     * `run.routes.invoke`.
+     * If empty, defaults to the Compute Engine default service account:
+     * `{project_number}-compute@developer.gserviceaccount.com`.
+     * 
+ * + * string service_account_email = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearServiceAccountEmail() { + + serviceAccountEmail_ = getDefaultInstance().getServiceAccountEmail(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The email of the trigger's service account. The service account must have
+     * permission to invoke Cloud Run services, the permission is
+     * `run.routes.invoke`.
+     * If empty, defaults to the Compute Engine default service account:
+     * `{project_number}-compute@developer.gserviceaccount.com`.
+     * 
+ * + * string service_account_email = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for serviceAccountEmail to set. + * @return This builder for chaining. + */ + public Builder setServiceAccountEmailBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + serviceAccountEmail_ = value; + onChanged(); + return this; + } + + private int retryPolicy_ = 0; + /** + * + * + *
+     * Optional. If unset, then defaults to ignoring failures (i.e. not retrying them).
+     * 
+ * + * + * .google.cloud.functions.v2alpha.EventTrigger.RetryPolicy retry_policy = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for retryPolicy. + */ + @java.lang.Override + public int getRetryPolicyValue() { + return retryPolicy_; + } + /** + * + * + *
+     * Optional. If unset, then defaults to ignoring failures (i.e. not retrying them).
+     * 
+ * + * + * .google.cloud.functions.v2alpha.EventTrigger.RetryPolicy retry_policy = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for retryPolicy to set. + * @return This builder for chaining. + */ + public Builder setRetryPolicyValue(int value) { + + retryPolicy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If unset, then defaults to ignoring failures (i.e. not retrying them).
+     * 
+ * + * + * .google.cloud.functions.v2alpha.EventTrigger.RetryPolicy retry_policy = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The retryPolicy. + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.EventTrigger.RetryPolicy getRetryPolicy() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2alpha.EventTrigger.RetryPolicy result = + com.google.cloud.functions.v2alpha.EventTrigger.RetryPolicy.valueOf(retryPolicy_); + return result == null + ? com.google.cloud.functions.v2alpha.EventTrigger.RetryPolicy.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Optional. If unset, then defaults to ignoring failures (i.e. not retrying them).
+     * 
+ * + * + * .google.cloud.functions.v2alpha.EventTrigger.RetryPolicy retry_policy = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The retryPolicy to set. + * @return This builder for chaining. + */ + public Builder setRetryPolicy( + com.google.cloud.functions.v2alpha.EventTrigger.RetryPolicy value) { + if (value == null) { + throw new NullPointerException(); + } + + retryPolicy_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If unset, then defaults to ignoring failures (i.e. not retrying them).
+     * 
+ * + * + * .google.cloud.functions.v2alpha.EventTrigger.RetryPolicy retry_policy = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearRetryPolicy() { + + retryPolicy_ = 0; + onChanged(); + return this; + } + + private java.lang.Object channel_ = ""; + /** + * + * + *
+     * Optional. The name of the channel associated with the trigger in
+     * `projects/{project}/locations/{location}/channels/{channel}` format.
+     * You must provide a channel to receive events from Eventarc SaaS partners.
+     * 
+ * + * + * string channel = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The channel. + */ + public java.lang.String getChannel() { + java.lang.Object ref = channel_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + channel_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The name of the channel associated with the trigger in
+     * `projects/{project}/locations/{location}/channels/{channel}` format.
+     * You must provide a channel to receive events from Eventarc SaaS partners.
+     * 
+ * + * + * string channel = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for channel. + */ + public com.google.protobuf.ByteString getChannelBytes() { + java.lang.Object ref = channel_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + channel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The name of the channel associated with the trigger in
+     * `projects/{project}/locations/{location}/channels/{channel}` format.
+     * You must provide a channel to receive events from Eventarc SaaS partners.
+     * 
+ * + * + * string channel = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The channel to set. + * @return This builder for chaining. + */ + public Builder setChannel(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + channel_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The name of the channel associated with the trigger in
+     * `projects/{project}/locations/{location}/channels/{channel}` format.
+     * You must provide a channel to receive events from Eventarc SaaS partners.
+     * 
+ * + * + * string channel = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearChannel() { + + channel_ = getDefaultInstance().getChannel(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The name of the channel associated with the trigger in
+     * `projects/{project}/locations/{location}/channels/{channel}` format.
+     * You must provide a channel to receive events from Eventarc SaaS partners.
+     * 
+ * + * + * string channel = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for channel to set. + * @return This builder for chaining. + */ + public Builder setChannelBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + channel_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2alpha.EventTrigger) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2alpha.EventTrigger) + private static final com.google.cloud.functions.v2alpha.EventTrigger DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2alpha.EventTrigger(); + } + + public static com.google.cloud.functions.v2alpha.EventTrigger getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EventTrigger parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EventTrigger(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.EventTrigger getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/EventTriggerOrBuilder.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/EventTriggerOrBuilder.java new file mode 100644 index 00000000..b716b4ef --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/EventTriggerOrBuilder.java @@ -0,0 +1,302 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +public interface EventTriggerOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2alpha.EventTrigger) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The resource name of the Eventarc trigger. The format of this field is
+   * `projects/{project}/locations/{region}/triggers/{trigger}`.
+   * 
+ * + * + * string trigger = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The trigger. + */ + java.lang.String getTrigger(); + /** + * + * + *
+   * Output only. The resource name of the Eventarc trigger. The format of this field is
+   * `projects/{project}/locations/{region}/triggers/{trigger}`.
+   * 
+ * + * + * string trigger = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for trigger. + */ + com.google.protobuf.ByteString getTriggerBytes(); + + /** + * + * + *
+   * The region that the trigger will be in. The trigger will only receive
+   * events originating in this region. It can be the same
+   * region as the function, a different region or multi-region, or the global
+   * region. If not provided, defaults to the same region as the function.
+   * 
+ * + * string trigger_region = 2; + * + * @return The triggerRegion. + */ + java.lang.String getTriggerRegion(); + /** + * + * + *
+   * The region that the trigger will be in. The trigger will only receive
+   * events originating in this region. It can be the same
+   * region as the function, a different region or multi-region, or the global
+   * region. If not provided, defaults to the same region as the function.
+   * 
+ * + * string trigger_region = 2; + * + * @return The bytes for triggerRegion. + */ + com.google.protobuf.ByteString getTriggerRegionBytes(); + + /** + * + * + *
+   * Required. The type of event to observe. For example:
+   * `google.cloud.audit.log.v1.written` or
+   * `google.cloud.pubsub.topic.v1.messagePublished`.
+   * 
+ * + * string event_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The eventType. + */ + java.lang.String getEventType(); + /** + * + * + *
+   * Required. The type of event to observe. For example:
+   * `google.cloud.audit.log.v1.written` or
+   * `google.cloud.pubsub.topic.v1.messagePublished`.
+   * 
+ * + * string event_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for eventType. + */ + com.google.protobuf.ByteString getEventTypeBytes(); + + /** + * + * + *
+   * Criteria used to filter events.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.EventFilter event_filters = 4; + */ + java.util.List getEventFiltersList(); + /** + * + * + *
+   * Criteria used to filter events.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.EventFilter event_filters = 4; + */ + com.google.cloud.functions.v2alpha.EventFilter getEventFilters(int index); + /** + * + * + *
+   * Criteria used to filter events.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.EventFilter event_filters = 4; + */ + int getEventFiltersCount(); + /** + * + * + *
+   * Criteria used to filter events.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.EventFilter event_filters = 4; + */ + java.util.List + getEventFiltersOrBuilderList(); + /** + * + * + *
+   * Criteria used to filter events.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.EventFilter event_filters = 4; + */ + com.google.cloud.functions.v2alpha.EventFilterOrBuilder getEventFiltersOrBuilder(int index); + + /** + * + * + *
+   * Optional. The name of a Pub/Sub topic in the same project that will be used
+   * as the transport topic for the event delivery. Format:
+   * `projects/{project}/topics/{topic}`.
+   * This is only valid for events of type
+   * `google.cloud.pubsub.topic.v1.messagePublished`. The topic provided here
+   * will not be deleted at function deletion.
+   * 
+ * + * + * string pubsub_topic = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The pubsubTopic. + */ + java.lang.String getPubsubTopic(); + /** + * + * + *
+   * Optional. The name of a Pub/Sub topic in the same project that will be used
+   * as the transport topic for the event delivery. Format:
+   * `projects/{project}/topics/{topic}`.
+   * This is only valid for events of type
+   * `google.cloud.pubsub.topic.v1.messagePublished`. The topic provided here
+   * will not be deleted at function deletion.
+   * 
+ * + * + * string pubsub_topic = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for pubsubTopic. + */ + com.google.protobuf.ByteString getPubsubTopicBytes(); + + /** + * + * + *
+   * Optional. The email of the trigger's service account. The service account must have
+   * permission to invoke Cloud Run services, the permission is
+   * `run.routes.invoke`.
+   * If empty, defaults to the Compute Engine default service account:
+   * `{project_number}-compute@developer.gserviceaccount.com`.
+   * 
+ * + * string service_account_email = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The serviceAccountEmail. + */ + java.lang.String getServiceAccountEmail(); + /** + * + * + *
+   * Optional. The email of the trigger's service account. The service account must have
+   * permission to invoke Cloud Run services, the permission is
+   * `run.routes.invoke`.
+   * If empty, defaults to the Compute Engine default service account:
+   * `{project_number}-compute@developer.gserviceaccount.com`.
+   * 
+ * + * string service_account_email = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for serviceAccountEmail. + */ + com.google.protobuf.ByteString getServiceAccountEmailBytes(); + + /** + * + * + *
+   * Optional. If unset, then defaults to ignoring failures (i.e. not retrying them).
+   * 
+ * + * + * .google.cloud.functions.v2alpha.EventTrigger.RetryPolicy retry_policy = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for retryPolicy. + */ + int getRetryPolicyValue(); + /** + * + * + *
+   * Optional. If unset, then defaults to ignoring failures (i.e. not retrying them).
+   * 
+ * + * + * .google.cloud.functions.v2alpha.EventTrigger.RetryPolicy retry_policy = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The retryPolicy. + */ + com.google.cloud.functions.v2alpha.EventTrigger.RetryPolicy getRetryPolicy(); + + /** + * + * + *
+   * Optional. The name of the channel associated with the trigger in
+   * `projects/{project}/locations/{location}/channels/{channel}` format.
+   * You must provide a channel to receive events from Eventarc SaaS partners.
+   * 
+ * + * + * string channel = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The channel. + */ + java.lang.String getChannel(); + /** + * + * + *
+   * Optional. The name of the channel associated with the trigger in
+   * `projects/{project}/locations/{location}/channels/{channel}` format.
+   * You must provide a channel to receive events from Eventarc SaaS partners.
+   * 
+ * + * + * string channel = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for channel. + */ + com.google.protobuf.ByteString getChannelBytes(); +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/Function.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/Function.java new file mode 100644 index 00000000..269eb5a6 --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/Function.java @@ -0,0 +1,3402 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +/** + * + * + *
+ * Describes a Cloud Function that contains user computation executed in
+ * response to an event. It encapsulates function and trigger configurations.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.Function} + */ +public final class Function extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2alpha.Function) + FunctionOrBuilder { + private static final long serialVersionUID = 0L; + // Use Function.newBuilder() to construct. + private Function(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Function() { + name_ = ""; + environment_ = 0; + description_ = ""; + state_ = 0; + stateMessages_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Function(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Function( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 26: + { + com.google.cloud.functions.v2alpha.BuildConfig.Builder subBuilder = null; + if (buildConfig_ != null) { + subBuilder = buildConfig_.toBuilder(); + } + buildConfig_ = + input.readMessage( + com.google.cloud.functions.v2alpha.BuildConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(buildConfig_); + buildConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + com.google.cloud.functions.v2alpha.ServiceConfig.Builder subBuilder = null; + if (serviceConfig_ != null) { + subBuilder = serviceConfig_.toBuilder(); + } + serviceConfig_ = + input.readMessage( + com.google.cloud.functions.v2alpha.ServiceConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(serviceConfig_); + serviceConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + com.google.cloud.functions.v2alpha.EventTrigger.Builder subBuilder = null; + if (eventTrigger_ != null) { + subBuilder = eventTrigger_.toBuilder(); + } + eventTrigger_ = + input.readMessage( + com.google.cloud.functions.v2alpha.EventTrigger.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(eventTrigger_); + eventTrigger_ = subBuilder.buildPartial(); + } + + break; + } + case 48: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 58: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + case 66: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + case 74: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + stateMessages_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + stateMessages_.add( + input.readMessage( + com.google.cloud.functions.v2alpha.StateMessage.parser(), extensionRegistry)); + break; + } + case 80: + { + int rawValue = input.readEnum(); + + environment_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) != 0)) { + stateMessages_ = java.util.Collections.unmodifiableList(stateMessages_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_Function_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 8: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_Function_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.Function.class, + com.google.cloud.functions.v2alpha.Function.Builder.class); + } + + /** + * + * + *
+   * Describes the current state of the function.
+   * 
+ * + * Protobuf enum {@code google.cloud.functions.v2alpha.Function.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not specified. Invalid state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Function has been successfully deployed and is serving.
+     * 
+ * + * ACTIVE = 1; + */ + ACTIVE(1), + /** + * + * + *
+     * Function deployment failed and the function is not serving.
+     * 
+ * + * FAILED = 2; + */ + FAILED(2), + /** + * + * + *
+     * Function is being created or updated.
+     * 
+ * + * DEPLOYING = 3; + */ + DEPLOYING(3), + /** + * + * + *
+     * Function is being deleted.
+     * 
+ * + * DELETING = 4; + */ + DELETING(4), + /** + * + * + *
+     * Function deployment failed and the function serving state is undefined.
+     * The function should be updated or deleted to move it out of this state.
+     * 
+ * + * UNKNOWN = 5; + */ + UNKNOWN(5), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not specified. Invalid state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Function has been successfully deployed and is serving.
+     * 
+ * + * ACTIVE = 1; + */ + public static final int ACTIVE_VALUE = 1; + /** + * + * + *
+     * Function deployment failed and the function is not serving.
+     * 
+ * + * FAILED = 2; + */ + public static final int FAILED_VALUE = 2; + /** + * + * + *
+     * Function is being created or updated.
+     * 
+ * + * DEPLOYING = 3; + */ + public static final int DEPLOYING_VALUE = 3; + /** + * + * + *
+     * Function is being deleted.
+     * 
+ * + * DELETING = 4; + */ + public static final int DELETING_VALUE = 4; + /** + * + * + *
+     * Function deployment failed and the function serving state is undefined.
+     * The function should be updated or deleted to move it out of this state.
+     * 
+ * + * UNKNOWN = 5; + */ + public static final int UNKNOWN_VALUE = 5; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static State valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 1: + return ACTIVE; + case 2: + return FAILED; + case 3: + return DEPLOYING; + case 4: + return DELETING; + case 5: + return UNKNOWN; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.Function.getDescriptor().getEnumTypes().get(0); + } + + private static final State[] VALUES = values(); + + public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.functions.v2alpha.Function.State) + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * A user-defined name of the function. Function names must be unique
+   * globally and match pattern `projects/*/locations/*/functions/*`
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * A user-defined name of the function. Function names must be unique
+   * globally and match pattern `projects/*/locations/*/functions/*`
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENVIRONMENT_FIELD_NUMBER = 10; + private int environment_; + /** + * + * + *
+   * Describe whether the function is gen1 or gen2.
+   * 
+ * + * .google.cloud.functions.v2alpha.Environment environment = 10; + * + * @return The enum numeric value on the wire for environment. + */ + @java.lang.Override + public int getEnvironmentValue() { + return environment_; + } + /** + * + * + *
+   * Describe whether the function is gen1 or gen2.
+   * 
+ * + * .google.cloud.functions.v2alpha.Environment environment = 10; + * + * @return The environment. + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.Environment getEnvironment() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2alpha.Environment result = + com.google.cloud.functions.v2alpha.Environment.valueOf(environment_); + return result == null ? com.google.cloud.functions.v2alpha.Environment.UNRECOGNIZED : result; + } + + public static final int DESCRIPTION_FIELD_NUMBER = 2; + private volatile java.lang.Object description_; + /** + * + * + *
+   * User-provided description of a function.
+   * 
+ * + * string description = 2; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + * + * + *
+   * User-provided description of a function.
+   * 
+ * + * string description = 2; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BUILD_CONFIG_FIELD_NUMBER = 3; + private com.google.cloud.functions.v2alpha.BuildConfig buildConfig_; + /** + * + * + *
+   * Describes the Build step of the function that builds a container from the
+   * given source.
+   * 
+ * + * .google.cloud.functions.v2alpha.BuildConfig build_config = 3; + * + * @return Whether the buildConfig field is set. + */ + @java.lang.Override + public boolean hasBuildConfig() { + return buildConfig_ != null; + } + /** + * + * + *
+   * Describes the Build step of the function that builds a container from the
+   * given source.
+   * 
+ * + * .google.cloud.functions.v2alpha.BuildConfig build_config = 3; + * + * @return The buildConfig. + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.BuildConfig getBuildConfig() { + return buildConfig_ == null + ? com.google.cloud.functions.v2alpha.BuildConfig.getDefaultInstance() + : buildConfig_; + } + /** + * + * + *
+   * Describes the Build step of the function that builds a container from the
+   * given source.
+   * 
+ * + * .google.cloud.functions.v2alpha.BuildConfig build_config = 3; + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.BuildConfigOrBuilder getBuildConfigOrBuilder() { + return getBuildConfig(); + } + + public static final int SERVICE_CONFIG_FIELD_NUMBER = 4; + private com.google.cloud.functions.v2alpha.ServiceConfig serviceConfig_; + /** + * + * + *
+   * Describes the Service being deployed. Currently deploys services to Cloud
+   * Run (fully managed).
+   * 
+ * + * .google.cloud.functions.v2alpha.ServiceConfig service_config = 4; + * + * @return Whether the serviceConfig field is set. + */ + @java.lang.Override + public boolean hasServiceConfig() { + return serviceConfig_ != null; + } + /** + * + * + *
+   * Describes the Service being deployed. Currently deploys services to Cloud
+   * Run (fully managed).
+   * 
+ * + * .google.cloud.functions.v2alpha.ServiceConfig service_config = 4; + * + * @return The serviceConfig. + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.ServiceConfig getServiceConfig() { + return serviceConfig_ == null + ? com.google.cloud.functions.v2alpha.ServiceConfig.getDefaultInstance() + : serviceConfig_; + } + /** + * + * + *
+   * Describes the Service being deployed. Currently deploys services to Cloud
+   * Run (fully managed).
+   * 
+ * + * .google.cloud.functions.v2alpha.ServiceConfig service_config = 4; + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.ServiceConfigOrBuilder getServiceConfigOrBuilder() { + return getServiceConfig(); + } + + public static final int EVENT_TRIGGER_FIELD_NUMBER = 5; + private com.google.cloud.functions.v2alpha.EventTrigger eventTrigger_; + /** + * + * + *
+   * An Eventarc trigger managed by Google Cloud Functions that fires events in
+   * response to a condition in another service.
+   * 
+ * + * .google.cloud.functions.v2alpha.EventTrigger event_trigger = 5; + * + * @return Whether the eventTrigger field is set. + */ + @java.lang.Override + public boolean hasEventTrigger() { + return eventTrigger_ != null; + } + /** + * + * + *
+   * An Eventarc trigger managed by Google Cloud Functions that fires events in
+   * response to a condition in another service.
+   * 
+ * + * .google.cloud.functions.v2alpha.EventTrigger event_trigger = 5; + * + * @return The eventTrigger. + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.EventTrigger getEventTrigger() { + return eventTrigger_ == null + ? com.google.cloud.functions.v2alpha.EventTrigger.getDefaultInstance() + : eventTrigger_; + } + /** + * + * + *
+   * An Eventarc trigger managed by Google Cloud Functions that fires events in
+   * response to a condition in another service.
+   * 
+ * + * .google.cloud.functions.v2alpha.EventTrigger event_trigger = 5; + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.EventTriggerOrBuilder getEventTriggerOrBuilder() { + return getEventTrigger(); + } + + public static final int STATE_FIELD_NUMBER = 6; + private int state_; + /** + * + * + *
+   * Output only. State of the function.
+   * 
+ * + * + * .google.cloud.functions.v2alpha.Function.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Output only. State of the function.
+   * 
+ * + * + * .google.cloud.functions.v2alpha.Function.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.Function.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2alpha.Function.State result = + com.google.cloud.functions.v2alpha.Function.State.valueOf(state_); + return result == null ? com.google.cloud.functions.v2alpha.Function.State.UNRECOGNIZED : result; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 7; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The last update timestamp of a Cloud Function.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. The last update timestamp of a Cloud Function.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. The last update timestamp of a Cloud Function.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int LABELS_FIELD_NUMBER = 8; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_Function_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Labels associated with this Cloud Function.
+   * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Labels associated with this Cloud Function.
+   * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Labels associated with this Cloud Function.
+   * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Labels associated with this Cloud Function.
+   * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int STATE_MESSAGES_FIELD_NUMBER = 9; + private java.util.List stateMessages_; + /** + * + * + *
+   * Output only. State Messages for this Cloud Function.
+   * 
+ * + * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getStateMessagesList() { + return stateMessages_; + } + /** + * + * + *
+   * Output only. State Messages for this Cloud Function.
+   * 
+ * + * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getStateMessagesOrBuilderList() { + return stateMessages_; + } + /** + * + * + *
+   * Output only. State Messages for this Cloud Function.
+   * 
+ * + * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getStateMessagesCount() { + return stateMessages_.size(); + } + /** + * + * + *
+   * Output only. State Messages for this Cloud Function.
+   * 
+ * + * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.StateMessage getStateMessages(int index) { + return stateMessages_.get(index); + } + /** + * + * + *
+   * Output only. State Messages for this Cloud Function.
+   * 
+ * + * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.StateMessageOrBuilder getStateMessagesOrBuilder( + int index) { + return stateMessages_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + } + if (buildConfig_ != null) { + output.writeMessage(3, getBuildConfig()); + } + if (serviceConfig_ != null) { + output.writeMessage(4, getServiceConfig()); + } + if (eventTrigger_ != null) { + output.writeMessage(5, getEventTrigger()); + } + if (state_ != com.google.cloud.functions.v2alpha.Function.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(6, state_); + } + if (updateTime_ != null) { + output.writeMessage(7, getUpdateTime()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 8); + for (int i = 0; i < stateMessages_.size(); i++) { + output.writeMessage(9, stateMessages_.get(i)); + } + if (environment_ + != com.google.cloud.functions.v2alpha.Environment.ENVIRONMENT_UNSPECIFIED.getNumber()) { + output.writeEnum(10, environment_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + } + if (buildConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getBuildConfig()); + } + if (serviceConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getServiceConfig()); + } + if (eventTrigger_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getEventTrigger()); + } + if (state_ != com.google.cloud.functions.v2alpha.Function.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, state_); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getUpdateTime()); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, labels__); + } + for (int i = 0; i < stateMessages_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, stateMessages_.get(i)); + } + if (environment_ + != com.google.cloud.functions.v2alpha.Environment.ENVIRONMENT_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(10, environment_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2alpha.Function)) { + return super.equals(obj); + } + com.google.cloud.functions.v2alpha.Function other = + (com.google.cloud.functions.v2alpha.Function) obj; + + if (!getName().equals(other.getName())) return false; + if (environment_ != other.environment_) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (hasBuildConfig() != other.hasBuildConfig()) return false; + if (hasBuildConfig()) { + if (!getBuildConfig().equals(other.getBuildConfig())) return false; + } + if (hasServiceConfig() != other.hasServiceConfig()) return false; + if (hasServiceConfig()) { + if (!getServiceConfig().equals(other.getServiceConfig())) return false; + } + if (hasEventTrigger() != other.hasEventTrigger()) return false; + if (hasEventTrigger()) { + if (!getEventTrigger().equals(other.getEventTrigger())) return false; + } + if (state_ != other.state_) return false; + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (!getStateMessagesList().equals(other.getStateMessagesList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + ENVIRONMENT_FIELD_NUMBER; + hash = (53 * hash) + environment_; + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (hasBuildConfig()) { + hash = (37 * hash) + BUILD_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getBuildConfig().hashCode(); + } + if (hasServiceConfig()) { + hash = (37 * hash) + SERVICE_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getServiceConfig().hashCode(); + } + if (hasEventTrigger()) { + hash = (37 * hash) + EVENT_TRIGGER_FIELD_NUMBER; + hash = (53 * hash) + getEventTrigger().hashCode(); + } + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + if (getStateMessagesCount() > 0) { + hash = (37 * hash) + STATE_MESSAGES_FIELD_NUMBER; + hash = (53 * hash) + getStateMessagesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2alpha.Function parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.Function parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.Function parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.Function parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.Function parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.Function parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.Function parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.Function parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.Function parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.Function parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.Function parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.Function parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v2alpha.Function prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Describes a Cloud Function that contains user computation executed in
+   * response to an event. It encapsulates function and trigger configurations.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.Function} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2alpha.Function) + com.google.cloud.functions.v2alpha.FunctionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_Function_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 8: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 8: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_Function_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.Function.class, + com.google.cloud.functions.v2alpha.Function.Builder.class); + } + + // Construct using com.google.cloud.functions.v2alpha.Function.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getStateMessagesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + environment_ = 0; + + description_ = ""; + + if (buildConfigBuilder_ == null) { + buildConfig_ = null; + } else { + buildConfig_ = null; + buildConfigBuilder_ = null; + } + if (serviceConfigBuilder_ == null) { + serviceConfig_ = null; + } else { + serviceConfig_ = null; + serviceConfigBuilder_ = null; + } + if (eventTriggerBuilder_ == null) { + eventTrigger_ = null; + } else { + eventTrigger_ = null; + eventTriggerBuilder_ = null; + } + state_ = 0; + + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + internalGetMutableLabels().clear(); + if (stateMessagesBuilder_ == null) { + stateMessages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + stateMessagesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_Function_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.Function getDefaultInstanceForType() { + return com.google.cloud.functions.v2alpha.Function.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.Function build() { + com.google.cloud.functions.v2alpha.Function result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.Function buildPartial() { + com.google.cloud.functions.v2alpha.Function result = + new com.google.cloud.functions.v2alpha.Function(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.environment_ = environment_; + result.description_ = description_; + if (buildConfigBuilder_ == null) { + result.buildConfig_ = buildConfig_; + } else { + result.buildConfig_ = buildConfigBuilder_.build(); + } + if (serviceConfigBuilder_ == null) { + result.serviceConfig_ = serviceConfig_; + } else { + result.serviceConfig_ = serviceConfigBuilder_.build(); + } + if (eventTriggerBuilder_ == null) { + result.eventTrigger_ = eventTrigger_; + } else { + result.eventTrigger_ = eventTriggerBuilder_.build(); + } + result.state_ = state_; + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + if (stateMessagesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + stateMessages_ = java.util.Collections.unmodifiableList(stateMessages_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.stateMessages_ = stateMessages_; + } else { + result.stateMessages_ = stateMessagesBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2alpha.Function) { + return mergeFrom((com.google.cloud.functions.v2alpha.Function) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2alpha.Function other) { + if (other == com.google.cloud.functions.v2alpha.Function.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.environment_ != 0) { + setEnvironmentValue(other.getEnvironmentValue()); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (other.hasBuildConfig()) { + mergeBuildConfig(other.getBuildConfig()); + } + if (other.hasServiceConfig()) { + mergeServiceConfig(other.getServiceConfig()); + } + if (other.hasEventTrigger()) { + mergeEventTrigger(other.getEventTrigger()); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + if (stateMessagesBuilder_ == null) { + if (!other.stateMessages_.isEmpty()) { + if (stateMessages_.isEmpty()) { + stateMessages_ = other.stateMessages_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureStateMessagesIsMutable(); + stateMessages_.addAll(other.stateMessages_); + } + onChanged(); + } + } else { + if (!other.stateMessages_.isEmpty()) { + if (stateMessagesBuilder_.isEmpty()) { + stateMessagesBuilder_.dispose(); + stateMessagesBuilder_ = null; + stateMessages_ = other.stateMessages_; + bitField0_ = (bitField0_ & ~0x00000002); + stateMessagesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getStateMessagesFieldBuilder() + : null; + } else { + stateMessagesBuilder_.addAllMessages(other.stateMessages_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2alpha.Function parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v2alpha.Function) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * A user-defined name of the function. Function names must be unique
+     * globally and match pattern `projects/*/locations/*/functions/*`
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A user-defined name of the function. Function names must be unique
+     * globally and match pattern `projects/*/locations/*/functions/*`
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A user-defined name of the function. Function names must be unique
+     * globally and match pattern `projects/*/locations/*/functions/*`
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A user-defined name of the function. Function names must be unique
+     * globally and match pattern `projects/*/locations/*/functions/*`
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * A user-defined name of the function. Function names must be unique
+     * globally and match pattern `projects/*/locations/*/functions/*`
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private int environment_ = 0; + /** + * + * + *
+     * Describe whether the function is gen1 or gen2.
+     * 
+ * + * .google.cloud.functions.v2alpha.Environment environment = 10; + * + * @return The enum numeric value on the wire for environment. + */ + @java.lang.Override + public int getEnvironmentValue() { + return environment_; + } + /** + * + * + *
+     * Describe whether the function is gen1 or gen2.
+     * 
+ * + * .google.cloud.functions.v2alpha.Environment environment = 10; + * + * @param value The enum numeric value on the wire for environment to set. + * @return This builder for chaining. + */ + public Builder setEnvironmentValue(int value) { + + environment_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Describe whether the function is gen1 or gen2.
+     * 
+ * + * .google.cloud.functions.v2alpha.Environment environment = 10; + * + * @return The environment. + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.Environment getEnvironment() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2alpha.Environment result = + com.google.cloud.functions.v2alpha.Environment.valueOf(environment_); + return result == null ? com.google.cloud.functions.v2alpha.Environment.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Describe whether the function is gen1 or gen2.
+     * 
+ * + * .google.cloud.functions.v2alpha.Environment environment = 10; + * + * @param value The environment to set. + * @return This builder for chaining. + */ + public Builder setEnvironment(com.google.cloud.functions.v2alpha.Environment value) { + if (value == null) { + throw new NullPointerException(); + } + + environment_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Describe whether the function is gen1 or gen2.
+     * 
+ * + * .google.cloud.functions.v2alpha.Environment environment = 10; + * + * @return This builder for chaining. + */ + public Builder clearEnvironment() { + + environment_ = 0; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * User-provided description of a function.
+     * 
+ * + * string description = 2; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * User-provided description of a function.
+     * 
+ * + * string description = 2; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * User-provided description of a function.
+     * 
+ * + * string description = 2; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * User-provided description of a function.
+     * 
+ * + * string description = 2; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * User-provided description of a function.
+     * 
+ * + * string description = 2; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private com.google.cloud.functions.v2alpha.BuildConfig buildConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2alpha.BuildConfig, + com.google.cloud.functions.v2alpha.BuildConfig.Builder, + com.google.cloud.functions.v2alpha.BuildConfigOrBuilder> + buildConfigBuilder_; + /** + * + * + *
+     * Describes the Build step of the function that builds a container from the
+     * given source.
+     * 
+ * + * .google.cloud.functions.v2alpha.BuildConfig build_config = 3; + * + * @return Whether the buildConfig field is set. + */ + public boolean hasBuildConfig() { + return buildConfigBuilder_ != null || buildConfig_ != null; + } + /** + * + * + *
+     * Describes the Build step of the function that builds a container from the
+     * given source.
+     * 
+ * + * .google.cloud.functions.v2alpha.BuildConfig build_config = 3; + * + * @return The buildConfig. + */ + public com.google.cloud.functions.v2alpha.BuildConfig getBuildConfig() { + if (buildConfigBuilder_ == null) { + return buildConfig_ == null + ? com.google.cloud.functions.v2alpha.BuildConfig.getDefaultInstance() + : buildConfig_; + } else { + return buildConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Describes the Build step of the function that builds a container from the
+     * given source.
+     * 
+ * + * .google.cloud.functions.v2alpha.BuildConfig build_config = 3; + */ + public Builder setBuildConfig(com.google.cloud.functions.v2alpha.BuildConfig value) { + if (buildConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + buildConfig_ = value; + onChanged(); + } else { + buildConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Describes the Build step of the function that builds a container from the
+     * given source.
+     * 
+ * + * .google.cloud.functions.v2alpha.BuildConfig build_config = 3; + */ + public Builder setBuildConfig( + com.google.cloud.functions.v2alpha.BuildConfig.Builder builderForValue) { + if (buildConfigBuilder_ == null) { + buildConfig_ = builderForValue.build(); + onChanged(); + } else { + buildConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Describes the Build step of the function that builds a container from the
+     * given source.
+     * 
+ * + * .google.cloud.functions.v2alpha.BuildConfig build_config = 3; + */ + public Builder mergeBuildConfig(com.google.cloud.functions.v2alpha.BuildConfig value) { + if (buildConfigBuilder_ == null) { + if (buildConfig_ != null) { + buildConfig_ = + com.google.cloud.functions.v2alpha.BuildConfig.newBuilder(buildConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + buildConfig_ = value; + } + onChanged(); + } else { + buildConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Describes the Build step of the function that builds a container from the
+     * given source.
+     * 
+ * + * .google.cloud.functions.v2alpha.BuildConfig build_config = 3; + */ + public Builder clearBuildConfig() { + if (buildConfigBuilder_ == null) { + buildConfig_ = null; + onChanged(); + } else { + buildConfig_ = null; + buildConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Describes the Build step of the function that builds a container from the
+     * given source.
+     * 
+ * + * .google.cloud.functions.v2alpha.BuildConfig build_config = 3; + */ + public com.google.cloud.functions.v2alpha.BuildConfig.Builder getBuildConfigBuilder() { + + onChanged(); + return getBuildConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Describes the Build step of the function that builds a container from the
+     * given source.
+     * 
+ * + * .google.cloud.functions.v2alpha.BuildConfig build_config = 3; + */ + public com.google.cloud.functions.v2alpha.BuildConfigOrBuilder getBuildConfigOrBuilder() { + if (buildConfigBuilder_ != null) { + return buildConfigBuilder_.getMessageOrBuilder(); + } else { + return buildConfig_ == null + ? com.google.cloud.functions.v2alpha.BuildConfig.getDefaultInstance() + : buildConfig_; + } + } + /** + * + * + *
+     * Describes the Build step of the function that builds a container from the
+     * given source.
+     * 
+ * + * .google.cloud.functions.v2alpha.BuildConfig build_config = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2alpha.BuildConfig, + com.google.cloud.functions.v2alpha.BuildConfig.Builder, + com.google.cloud.functions.v2alpha.BuildConfigOrBuilder> + getBuildConfigFieldBuilder() { + if (buildConfigBuilder_ == null) { + buildConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2alpha.BuildConfig, + com.google.cloud.functions.v2alpha.BuildConfig.Builder, + com.google.cloud.functions.v2alpha.BuildConfigOrBuilder>( + getBuildConfig(), getParentForChildren(), isClean()); + buildConfig_ = null; + } + return buildConfigBuilder_; + } + + private com.google.cloud.functions.v2alpha.ServiceConfig serviceConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2alpha.ServiceConfig, + com.google.cloud.functions.v2alpha.ServiceConfig.Builder, + com.google.cloud.functions.v2alpha.ServiceConfigOrBuilder> + serviceConfigBuilder_; + /** + * + * + *
+     * Describes the Service being deployed. Currently deploys services to Cloud
+     * Run (fully managed).
+     * 
+ * + * .google.cloud.functions.v2alpha.ServiceConfig service_config = 4; + * + * @return Whether the serviceConfig field is set. + */ + public boolean hasServiceConfig() { + return serviceConfigBuilder_ != null || serviceConfig_ != null; + } + /** + * + * + *
+     * Describes the Service being deployed. Currently deploys services to Cloud
+     * Run (fully managed).
+     * 
+ * + * .google.cloud.functions.v2alpha.ServiceConfig service_config = 4; + * + * @return The serviceConfig. + */ + public com.google.cloud.functions.v2alpha.ServiceConfig getServiceConfig() { + if (serviceConfigBuilder_ == null) { + return serviceConfig_ == null + ? com.google.cloud.functions.v2alpha.ServiceConfig.getDefaultInstance() + : serviceConfig_; + } else { + return serviceConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Describes the Service being deployed. Currently deploys services to Cloud
+     * Run (fully managed).
+     * 
+ * + * .google.cloud.functions.v2alpha.ServiceConfig service_config = 4; + */ + public Builder setServiceConfig(com.google.cloud.functions.v2alpha.ServiceConfig value) { + if (serviceConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + serviceConfig_ = value; + onChanged(); + } else { + serviceConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Describes the Service being deployed. Currently deploys services to Cloud
+     * Run (fully managed).
+     * 
+ * + * .google.cloud.functions.v2alpha.ServiceConfig service_config = 4; + */ + public Builder setServiceConfig( + com.google.cloud.functions.v2alpha.ServiceConfig.Builder builderForValue) { + if (serviceConfigBuilder_ == null) { + serviceConfig_ = builderForValue.build(); + onChanged(); + } else { + serviceConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Describes the Service being deployed. Currently deploys services to Cloud
+     * Run (fully managed).
+     * 
+ * + * .google.cloud.functions.v2alpha.ServiceConfig service_config = 4; + */ + public Builder mergeServiceConfig(com.google.cloud.functions.v2alpha.ServiceConfig value) { + if (serviceConfigBuilder_ == null) { + if (serviceConfig_ != null) { + serviceConfig_ = + com.google.cloud.functions.v2alpha.ServiceConfig.newBuilder(serviceConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + serviceConfig_ = value; + } + onChanged(); + } else { + serviceConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Describes the Service being deployed. Currently deploys services to Cloud
+     * Run (fully managed).
+     * 
+ * + * .google.cloud.functions.v2alpha.ServiceConfig service_config = 4; + */ + public Builder clearServiceConfig() { + if (serviceConfigBuilder_ == null) { + serviceConfig_ = null; + onChanged(); + } else { + serviceConfig_ = null; + serviceConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Describes the Service being deployed. Currently deploys services to Cloud
+     * Run (fully managed).
+     * 
+ * + * .google.cloud.functions.v2alpha.ServiceConfig service_config = 4; + */ + public com.google.cloud.functions.v2alpha.ServiceConfig.Builder getServiceConfigBuilder() { + + onChanged(); + return getServiceConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Describes the Service being deployed. Currently deploys services to Cloud
+     * Run (fully managed).
+     * 
+ * + * .google.cloud.functions.v2alpha.ServiceConfig service_config = 4; + */ + public com.google.cloud.functions.v2alpha.ServiceConfigOrBuilder getServiceConfigOrBuilder() { + if (serviceConfigBuilder_ != null) { + return serviceConfigBuilder_.getMessageOrBuilder(); + } else { + return serviceConfig_ == null + ? com.google.cloud.functions.v2alpha.ServiceConfig.getDefaultInstance() + : serviceConfig_; + } + } + /** + * + * + *
+     * Describes the Service being deployed. Currently deploys services to Cloud
+     * Run (fully managed).
+     * 
+ * + * .google.cloud.functions.v2alpha.ServiceConfig service_config = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2alpha.ServiceConfig, + com.google.cloud.functions.v2alpha.ServiceConfig.Builder, + com.google.cloud.functions.v2alpha.ServiceConfigOrBuilder> + getServiceConfigFieldBuilder() { + if (serviceConfigBuilder_ == null) { + serviceConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2alpha.ServiceConfig, + com.google.cloud.functions.v2alpha.ServiceConfig.Builder, + com.google.cloud.functions.v2alpha.ServiceConfigOrBuilder>( + getServiceConfig(), getParentForChildren(), isClean()); + serviceConfig_ = null; + } + return serviceConfigBuilder_; + } + + private com.google.cloud.functions.v2alpha.EventTrigger eventTrigger_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2alpha.EventTrigger, + com.google.cloud.functions.v2alpha.EventTrigger.Builder, + com.google.cloud.functions.v2alpha.EventTriggerOrBuilder> + eventTriggerBuilder_; + /** + * + * + *
+     * An Eventarc trigger managed by Google Cloud Functions that fires events in
+     * response to a condition in another service.
+     * 
+ * + * .google.cloud.functions.v2alpha.EventTrigger event_trigger = 5; + * + * @return Whether the eventTrigger field is set. + */ + public boolean hasEventTrigger() { + return eventTriggerBuilder_ != null || eventTrigger_ != null; + } + /** + * + * + *
+     * An Eventarc trigger managed by Google Cloud Functions that fires events in
+     * response to a condition in another service.
+     * 
+ * + * .google.cloud.functions.v2alpha.EventTrigger event_trigger = 5; + * + * @return The eventTrigger. + */ + public com.google.cloud.functions.v2alpha.EventTrigger getEventTrigger() { + if (eventTriggerBuilder_ == null) { + return eventTrigger_ == null + ? com.google.cloud.functions.v2alpha.EventTrigger.getDefaultInstance() + : eventTrigger_; + } else { + return eventTriggerBuilder_.getMessage(); + } + } + /** + * + * + *
+     * An Eventarc trigger managed by Google Cloud Functions that fires events in
+     * response to a condition in another service.
+     * 
+ * + * .google.cloud.functions.v2alpha.EventTrigger event_trigger = 5; + */ + public Builder setEventTrigger(com.google.cloud.functions.v2alpha.EventTrigger value) { + if (eventTriggerBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + eventTrigger_ = value; + onChanged(); + } else { + eventTriggerBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * An Eventarc trigger managed by Google Cloud Functions that fires events in
+     * response to a condition in another service.
+     * 
+ * + * .google.cloud.functions.v2alpha.EventTrigger event_trigger = 5; + */ + public Builder setEventTrigger( + com.google.cloud.functions.v2alpha.EventTrigger.Builder builderForValue) { + if (eventTriggerBuilder_ == null) { + eventTrigger_ = builderForValue.build(); + onChanged(); + } else { + eventTriggerBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * An Eventarc trigger managed by Google Cloud Functions that fires events in
+     * response to a condition in another service.
+     * 
+ * + * .google.cloud.functions.v2alpha.EventTrigger event_trigger = 5; + */ + public Builder mergeEventTrigger(com.google.cloud.functions.v2alpha.EventTrigger value) { + if (eventTriggerBuilder_ == null) { + if (eventTrigger_ != null) { + eventTrigger_ = + com.google.cloud.functions.v2alpha.EventTrigger.newBuilder(eventTrigger_) + .mergeFrom(value) + .buildPartial(); + } else { + eventTrigger_ = value; + } + onChanged(); + } else { + eventTriggerBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * An Eventarc trigger managed by Google Cloud Functions that fires events in
+     * response to a condition in another service.
+     * 
+ * + * .google.cloud.functions.v2alpha.EventTrigger event_trigger = 5; + */ + public Builder clearEventTrigger() { + if (eventTriggerBuilder_ == null) { + eventTrigger_ = null; + onChanged(); + } else { + eventTrigger_ = null; + eventTriggerBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * An Eventarc trigger managed by Google Cloud Functions that fires events in
+     * response to a condition in another service.
+     * 
+ * + * .google.cloud.functions.v2alpha.EventTrigger event_trigger = 5; + */ + public com.google.cloud.functions.v2alpha.EventTrigger.Builder getEventTriggerBuilder() { + + onChanged(); + return getEventTriggerFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * An Eventarc trigger managed by Google Cloud Functions that fires events in
+     * response to a condition in another service.
+     * 
+ * + * .google.cloud.functions.v2alpha.EventTrigger event_trigger = 5; + */ + public com.google.cloud.functions.v2alpha.EventTriggerOrBuilder getEventTriggerOrBuilder() { + if (eventTriggerBuilder_ != null) { + return eventTriggerBuilder_.getMessageOrBuilder(); + } else { + return eventTrigger_ == null + ? com.google.cloud.functions.v2alpha.EventTrigger.getDefaultInstance() + : eventTrigger_; + } + } + /** + * + * + *
+     * An Eventarc trigger managed by Google Cloud Functions that fires events in
+     * response to a condition in another service.
+     * 
+ * + * .google.cloud.functions.v2alpha.EventTrigger event_trigger = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2alpha.EventTrigger, + com.google.cloud.functions.v2alpha.EventTrigger.Builder, + com.google.cloud.functions.v2alpha.EventTriggerOrBuilder> + getEventTriggerFieldBuilder() { + if (eventTriggerBuilder_ == null) { + eventTriggerBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2alpha.EventTrigger, + com.google.cloud.functions.v2alpha.EventTrigger.Builder, + com.google.cloud.functions.v2alpha.EventTriggerOrBuilder>( + getEventTrigger(), getParentForChildren(), isClean()); + eventTrigger_ = null; + } + return eventTriggerBuilder_; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. State of the function.
+     * 
+ * + * + * .google.cloud.functions.v2alpha.Function.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Output only. State of the function.
+     * 
+ * + * + * .google.cloud.functions.v2alpha.Function.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + + state_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. State of the function.
+     * 
+ * + * + * .google.cloud.functions.v2alpha.Function.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.Function.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2alpha.Function.State result = + com.google.cloud.functions.v2alpha.Function.State.valueOf(state_); + return result == null + ? com.google.cloud.functions.v2alpha.Function.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. State of the function.
+     * 
+ * + * + * .google.cloud.functions.v2alpha.Function.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.functions.v2alpha.Function.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. State of the function.
+     * 
+ * + * + * .google.cloud.functions.v2alpha.Function.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. The last update timestamp of a Cloud Function.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. The last update timestamp of a Cloud Function.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The last update timestamp of a Cloud Function.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The last update timestamp of a Cloud Function.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The last update timestamp of a Cloud Function.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The last update timestamp of a Cloud Function.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The last update timestamp of a Cloud Function.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The last update timestamp of a Cloud Function.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. The last update timestamp of a Cloud Function.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Labels associated with this Cloud Function.
+     * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Labels associated with this Cloud Function.
+     * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Labels associated with this Cloud Function.
+     * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Labels associated with this Cloud Function.
+     * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Labels associated with this Cloud Function.
+     * 
+ * + * map<string, string> labels = 8; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Labels associated with this Cloud Function.
+     * 
+ * + * map<string, string> labels = 8; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Labels associated with this Cloud Function.
+     * 
+ * + * map<string, string> labels = 8; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + private java.util.List stateMessages_ = + java.util.Collections.emptyList(); + + private void ensureStateMessagesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + stateMessages_ = + new java.util.ArrayList( + stateMessages_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2alpha.StateMessage, + com.google.cloud.functions.v2alpha.StateMessage.Builder, + com.google.cloud.functions.v2alpha.StateMessageOrBuilder> + stateMessagesBuilder_; + + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getStateMessagesList() { + if (stateMessagesBuilder_ == null) { + return java.util.Collections.unmodifiableList(stateMessages_); + } else { + return stateMessagesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getStateMessagesCount() { + if (stateMessagesBuilder_ == null) { + return stateMessages_.size(); + } else { + return stateMessagesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.functions.v2alpha.StateMessage getStateMessages(int index) { + if (stateMessagesBuilder_ == null) { + return stateMessages_.get(index); + } else { + return stateMessagesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStateMessages( + int index, com.google.cloud.functions.v2alpha.StateMessage value) { + if (stateMessagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStateMessagesIsMutable(); + stateMessages_.set(index, value); + onChanged(); + } else { + stateMessagesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStateMessages( + int index, com.google.cloud.functions.v2alpha.StateMessage.Builder builderForValue) { + if (stateMessagesBuilder_ == null) { + ensureStateMessagesIsMutable(); + stateMessages_.set(index, builderForValue.build()); + onChanged(); + } else { + stateMessagesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addStateMessages(com.google.cloud.functions.v2alpha.StateMessage value) { + if (stateMessagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStateMessagesIsMutable(); + stateMessages_.add(value); + onChanged(); + } else { + stateMessagesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addStateMessages( + int index, com.google.cloud.functions.v2alpha.StateMessage value) { + if (stateMessagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStateMessagesIsMutable(); + stateMessages_.add(index, value); + onChanged(); + } else { + stateMessagesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addStateMessages( + com.google.cloud.functions.v2alpha.StateMessage.Builder builderForValue) { + if (stateMessagesBuilder_ == null) { + ensureStateMessagesIsMutable(); + stateMessages_.add(builderForValue.build()); + onChanged(); + } else { + stateMessagesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addStateMessages( + int index, com.google.cloud.functions.v2alpha.StateMessage.Builder builderForValue) { + if (stateMessagesBuilder_ == null) { + ensureStateMessagesIsMutable(); + stateMessages_.add(index, builderForValue.build()); + onChanged(); + } else { + stateMessagesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllStateMessages( + java.lang.Iterable values) { + if (stateMessagesBuilder_ == null) { + ensureStateMessagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, stateMessages_); + onChanged(); + } else { + stateMessagesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearStateMessages() { + if (stateMessagesBuilder_ == null) { + stateMessages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + stateMessagesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeStateMessages(int index) { + if (stateMessagesBuilder_ == null) { + ensureStateMessagesIsMutable(); + stateMessages_.remove(index); + onChanged(); + } else { + stateMessagesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.functions.v2alpha.StateMessage.Builder getStateMessagesBuilder( + int index) { + return getStateMessagesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.functions.v2alpha.StateMessageOrBuilder getStateMessagesOrBuilder( + int index) { + if (stateMessagesBuilder_ == null) { + return stateMessages_.get(index); + } else { + return stateMessagesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getStateMessagesOrBuilderList() { + if (stateMessagesBuilder_ != null) { + return stateMessagesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(stateMessages_); + } + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.functions.v2alpha.StateMessage.Builder addStateMessagesBuilder() { + return getStateMessagesFieldBuilder() + .addBuilder(com.google.cloud.functions.v2alpha.StateMessage.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.functions.v2alpha.StateMessage.Builder addStateMessagesBuilder( + int index) { + return getStateMessagesFieldBuilder() + .addBuilder(index, com.google.cloud.functions.v2alpha.StateMessage.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getStateMessagesBuilderList() { + return getStateMessagesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2alpha.StateMessage, + com.google.cloud.functions.v2alpha.StateMessage.Builder, + com.google.cloud.functions.v2alpha.StateMessageOrBuilder> + getStateMessagesFieldBuilder() { + if (stateMessagesBuilder_ == null) { + stateMessagesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2alpha.StateMessage, + com.google.cloud.functions.v2alpha.StateMessage.Builder, + com.google.cloud.functions.v2alpha.StateMessageOrBuilder>( + stateMessages_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + stateMessages_ = null; + } + return stateMessagesBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2alpha.Function) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2alpha.Function) + private static final com.google.cloud.functions.v2alpha.Function DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2alpha.Function(); + } + + public static com.google.cloud.functions.v2alpha.Function getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Function parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Function(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.Function getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/FunctionName.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/FunctionName.java new file mode 100644 index 00000000..e2e3aede --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/FunctionName.java @@ -0,0 +1,223 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v2alpha; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class FunctionName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_FUNCTION = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/functions/{function}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String function; + + @Deprecated + protected FunctionName() { + project = null; + location = null; + function = null; + } + + private FunctionName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + function = Preconditions.checkNotNull(builder.getFunction()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getFunction() { + return function; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static FunctionName of(String project, String location, String function) { + return newBuilder().setProject(project).setLocation(location).setFunction(function).build(); + } + + public static String format(String project, String location, String function) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setFunction(function) + .build() + .toString(); + } + + public static FunctionName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_FUNCTION.validatedMatch( + formattedString, "FunctionName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("function")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (FunctionName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_FUNCTION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (function != null) { + fieldMapBuilder.put("function", function); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_FUNCTION.instantiate( + "project", project, "location", location, "function", function); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + FunctionName that = ((FunctionName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.function, that.function); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(function); + return h; + } + + /** Builder for projects/{project}/locations/{location}/functions/{function}. */ + public static class Builder { + private String project; + private String location; + private String function; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getFunction() { + return function; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setFunction(String function) { + this.function = function; + return this; + } + + private Builder(FunctionName functionName) { + this.project = functionName.project; + this.location = functionName.location; + this.function = functionName.function; + } + + public FunctionName build() { + return new FunctionName(this); + } + } +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/FunctionOrBuilder.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/FunctionOrBuilder.java new file mode 100644 index 00000000..ec936cac --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/FunctionOrBuilder.java @@ -0,0 +1,404 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +public interface FunctionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2alpha.Function) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A user-defined name of the function. Function names must be unique
+   * globally and match pattern `projects/*/locations/*/functions/*`
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * A user-defined name of the function. Function names must be unique
+   * globally and match pattern `projects/*/locations/*/functions/*`
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Describe whether the function is gen1 or gen2.
+   * 
+ * + * .google.cloud.functions.v2alpha.Environment environment = 10; + * + * @return The enum numeric value on the wire for environment. + */ + int getEnvironmentValue(); + /** + * + * + *
+   * Describe whether the function is gen1 or gen2.
+   * 
+ * + * .google.cloud.functions.v2alpha.Environment environment = 10; + * + * @return The environment. + */ + com.google.cloud.functions.v2alpha.Environment getEnvironment(); + + /** + * + * + *
+   * User-provided description of a function.
+   * 
+ * + * string description = 2; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * User-provided description of a function.
+   * 
+ * + * string description = 2; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Describes the Build step of the function that builds a container from the
+   * given source.
+   * 
+ * + * .google.cloud.functions.v2alpha.BuildConfig build_config = 3; + * + * @return Whether the buildConfig field is set. + */ + boolean hasBuildConfig(); + /** + * + * + *
+   * Describes the Build step of the function that builds a container from the
+   * given source.
+   * 
+ * + * .google.cloud.functions.v2alpha.BuildConfig build_config = 3; + * + * @return The buildConfig. + */ + com.google.cloud.functions.v2alpha.BuildConfig getBuildConfig(); + /** + * + * + *
+   * Describes the Build step of the function that builds a container from the
+   * given source.
+   * 
+ * + * .google.cloud.functions.v2alpha.BuildConfig build_config = 3; + */ + com.google.cloud.functions.v2alpha.BuildConfigOrBuilder getBuildConfigOrBuilder(); + + /** + * + * + *
+   * Describes the Service being deployed. Currently deploys services to Cloud
+   * Run (fully managed).
+   * 
+ * + * .google.cloud.functions.v2alpha.ServiceConfig service_config = 4; + * + * @return Whether the serviceConfig field is set. + */ + boolean hasServiceConfig(); + /** + * + * + *
+   * Describes the Service being deployed. Currently deploys services to Cloud
+   * Run (fully managed).
+   * 
+ * + * .google.cloud.functions.v2alpha.ServiceConfig service_config = 4; + * + * @return The serviceConfig. + */ + com.google.cloud.functions.v2alpha.ServiceConfig getServiceConfig(); + /** + * + * + *
+   * Describes the Service being deployed. Currently deploys services to Cloud
+   * Run (fully managed).
+   * 
+ * + * .google.cloud.functions.v2alpha.ServiceConfig service_config = 4; + */ + com.google.cloud.functions.v2alpha.ServiceConfigOrBuilder getServiceConfigOrBuilder(); + + /** + * + * + *
+   * An Eventarc trigger managed by Google Cloud Functions that fires events in
+   * response to a condition in another service.
+   * 
+ * + * .google.cloud.functions.v2alpha.EventTrigger event_trigger = 5; + * + * @return Whether the eventTrigger field is set. + */ + boolean hasEventTrigger(); + /** + * + * + *
+   * An Eventarc trigger managed by Google Cloud Functions that fires events in
+   * response to a condition in another service.
+   * 
+ * + * .google.cloud.functions.v2alpha.EventTrigger event_trigger = 5; + * + * @return The eventTrigger. + */ + com.google.cloud.functions.v2alpha.EventTrigger getEventTrigger(); + /** + * + * + *
+   * An Eventarc trigger managed by Google Cloud Functions that fires events in
+   * response to a condition in another service.
+   * 
+ * + * .google.cloud.functions.v2alpha.EventTrigger event_trigger = 5; + */ + com.google.cloud.functions.v2alpha.EventTriggerOrBuilder getEventTriggerOrBuilder(); + + /** + * + * + *
+   * Output only. State of the function.
+   * 
+ * + * + * .google.cloud.functions.v2alpha.Function.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. State of the function.
+   * 
+ * + * + * .google.cloud.functions.v2alpha.Function.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.functions.v2alpha.Function.State getState(); + + /** + * + * + *
+   * Output only. The last update timestamp of a Cloud Function.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The last update timestamp of a Cloud Function.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The last update timestamp of a Cloud Function.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Labels associated with this Cloud Function.
+   * 
+ * + * map<string, string> labels = 8; + */ + int getLabelsCount(); + /** + * + * + *
+   * Labels associated with this Cloud Function.
+   * 
+ * + * map<string, string> labels = 8; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Labels associated with this Cloud Function.
+   * 
+ * + * map<string, string> labels = 8; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Labels associated with this Cloud Function.
+   * 
+ * + * map<string, string> labels = 8; + */ + + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Labels associated with this Cloud Function.
+   * 
+ * + * map<string, string> labels = 8; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. State Messages for this Cloud Function.
+   * 
+ * + * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getStateMessagesList(); + /** + * + * + *
+   * Output only. State Messages for this Cloud Function.
+   * 
+ * + * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.functions.v2alpha.StateMessage getStateMessages(int index); + /** + * + * + *
+   * Output only. State Messages for this Cloud Function.
+   * 
+ * + * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getStateMessagesCount(); + /** + * + * + *
+   * Output only. State Messages for this Cloud Function.
+   * 
+ * + * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getStateMessagesOrBuilderList(); + /** + * + * + *
+   * Output only. State Messages for this Cloud Function.
+   * 
+ * + * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.functions.v2alpha.StateMessageOrBuilder getStateMessagesOrBuilder(int index); +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/FunctionsProto.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/FunctionsProto.java new file mode 100644 index 00000000..0cb12249 --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/FunctionsProto.java @@ -0,0 +1,758 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +public final class FunctionsProto { + private FunctionsProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2alpha_Function_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2alpha_Function_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2alpha_Function_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2alpha_Function_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2alpha_StateMessage_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2alpha_StateMessage_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2alpha_StorageSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2alpha_StorageSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2alpha_RepoSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2alpha_RepoSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2alpha_Source_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2alpha_Source_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2alpha_SourceProvenance_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2alpha_SourceProvenance_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2alpha_BuildConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2alpha_BuildConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2alpha_BuildConfig_EnvironmentVariablesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2alpha_BuildConfig_EnvironmentVariablesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2alpha_ServiceConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2alpha_ServiceConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2alpha_ServiceConfig_EnvironmentVariablesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2alpha_ServiceConfig_EnvironmentVariablesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2alpha_SecretEnvVar_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2alpha_SecretEnvVar_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2alpha_SecretVolume_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2alpha_SecretVolume_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2alpha_SecretVolume_SecretVersion_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2alpha_SecretVolume_SecretVersion_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2alpha_EventTrigger_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2alpha_EventTrigger_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2alpha_EventFilter_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2alpha_EventFilter_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2alpha_GetFunctionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2alpha_GetFunctionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2alpha_ListFunctionsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2alpha_ListFunctionsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2alpha_ListFunctionsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2alpha_ListFunctionsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2alpha_CreateFunctionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2alpha_CreateFunctionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2alpha_UpdateFunctionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2alpha_UpdateFunctionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2alpha_DeleteFunctionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2alpha_DeleteFunctionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2alpha_GenerateUploadUrlRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2alpha_GenerateUploadUrlRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2alpha_GenerateUploadUrlResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2alpha_GenerateUploadUrlResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2alpha_GenerateDownloadUrlRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2alpha_GenerateDownloadUrlRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2alpha_GenerateDownloadUrlResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2alpha_GenerateDownloadUrlResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2alpha_ListRuntimesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2alpha_ListRuntimesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2alpha_ListRuntimesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2alpha_ListRuntimesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2alpha_ListRuntimesResponse_Runtime_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2alpha_ListRuntimesResponse_Runtime_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2alpha_OperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2alpha_OperationMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2alpha_Stage_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2alpha_Stage_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n.google/cloud/functions/v2alpha/functio" + + "ns.proto\022\036google.cloud.functions.v2alpha" + + "\032\034google/api/annotations.proto\032\027google/a" + + "pi/client.proto\032\037google/api/field_behavi" + + "or.proto\032\031google/api/resource.proto\032#goo" + + "gle/longrunning/operations.proto\032\031google" + + "/protobuf/any.proto\032 google/protobuf/fie" + + "ld_mask.proto\032\037google/protobuf/timestamp" + + ".proto\"\332\006\n\010Function\022\014\n\004name\030\001 \001(\t\022@\n\013env" + + "ironment\030\n \001(\0162+.google.cloud.functions." + + "v2alpha.Environment\022\023\n\013description\030\002 \001(\t" + + "\022A\n\014build_config\030\003 \001(\0132+.google.cloud.fu" + + "nctions.v2alpha.BuildConfig\022E\n\016service_c" + + "onfig\030\004 \001(\0132-.google.cloud.functions.v2a" + + "lpha.ServiceConfig\022C\n\revent_trigger\030\005 \001(" + + "\0132,.google.cloud.functions.v2alpha.Event" + + "Trigger\022B\n\005state\030\006 \001(\0162..google.cloud.fu" + + "nctions.v2alpha.Function.StateB\003\340A\003\0224\n\013u" + + "pdate_time\030\007 \001(\0132\032.google.protobuf.Times" + + "tampB\003\340A\003\022D\n\006labels\030\010 \003(\01324.google.cloud" + + ".functions.v2alpha.Function.LabelsEntry\022" + + "I\n\016state_messages\030\t \003(\0132,.google.cloud.f" + + "unctions.v2alpha.StateMessageB\003\340A\003\032-\n\013La" + + "belsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028" + + "\001\"`\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\n\n\006ACT" + + "IVE\020\001\022\n\n\006FAILED\020\002\022\r\n\tDEPLOYING\020\003\022\014\n\010DELE" + + "TING\020\004\022\013\n\007UNKNOWN\020\005:~\352A{\n&cloudfunctions" + + ".googleapis.com/Function\022\n\013worker_pool\030\005 \001(\tB)\372A&\n$cloudbuild.go" + + "ogleapis.com/WorkerPool\022d\n\025environment_v" + + "ariables\030\006 \003(\0132E.google.cloud.functions." + + "v2alpha.BuildConfig.EnvironmentVariables" + + "Entry\022M\n\021docker_repository\030\007 \001(\tB2\340A\001\372A," + + "\n*artifactregistry.googleapis.com/Reposi" + + "tory\032;\n\031EnvironmentVariablesEntry\022\013\n\003key" + + "\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\331\010\n\rServiceCon" + + "fig\0223\n\007service\030\001 \001(\tB\"\340A\003\372A\034\n\032run.google" + + "apis.com/Service\022\027\n\017timeout_seconds\030\002 \001(" + + "\005\022\030\n\020available_memory\030\r \001(\t\022f\n\025environme" + + "nt_variables\030\004 \003(\0132G.google.cloud.functi" + + "ons.v2alpha.ServiceConfig.EnvironmentVar" + + "iablesEntry\022\032\n\022max_instance_count\030\005 \001(\005\022" + + "\032\n\022min_instance_count\030\014 \001(\005\022>\n\rvpc_conne" + + "ctor\030\006 \001(\tB\'\372A$\n\"vpcaccess.googleapis.co" + + "m/Connector\022o\n\035vpc_connector_egress_sett" + + "ings\030\007 \001(\0162H.google.cloud.functions.v2al" + + "pha.ServiceConfig.VpcConnectorEgressSett" + + "ings\022W\n\020ingress_settings\030\010 \001(\0162=.google." + + "cloud.functions.v2alpha.ServiceConfig.In" + + "gressSettings\022\020\n\003uri\030\t \001(\tB\003\340A\003\022\035\n\025servi" + + "ce_account_email\030\n \001(\t\022&\n\036all_traffic_on" + + "_latest_revision\030\020 \001(\010\022R\n\034secret_environ" + + "ment_variables\030\021 \003(\0132,.google.cloud.func" + + "tions.v2alpha.SecretEnvVar\022D\n\016secret_vol" + + "umes\030\023 \003(\0132,.google.cloud.functions.v2al" + + "pha.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\032VpcConnectorEgre" + + "ssSettings\022-\n)VPC_CONNECTOR_EGRESS_SETTI" + + "NGS_UNSPECIFIED\020\000\022\027\n\023PRIVATE_RANGES_ONLY" + + "\020\001\022\017\n\013ALL_TRAFFIC\020\002\"x\n\017IngressSettings\022 " + + "\n\034INGRESS_SETTINGS_UNSPECIFIED\020\000\022\r\n\tALLO" + + "W_ALL\020\001\022\027\n\023ALLOW_INTERNAL_ONLY\020\002\022\033\n\027ALLO" + + "W_INTERNAL_AND_GCLB\020\003\"P\n\014SecretEnvVar\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\"\304\001\n\014SecretVolume" + + "\022\022\n\nmount_path\030\001 \001(\t\022\022\n\nproject_id\030\002 \001(\t" + + "\022\016\n\006secret\030\003 \001(\t\022L\n\010versions\030\004 \003(\0132:.goo" + + "gle.cloud.functions.v2alpha.SecretVolume" + + ".SecretVersion\032.\n\rSecretVersion\022\017\n\007versi" + + "on\030\001 \001(\t\022\014\n\004path\030\002 \001(\t\"\217\004\n\014EventTrigger\022" + + "8\n\007trigger\030\001 \001(\tB\'\340A\003\372A!\n\037eventarc.googl" + + "eapis.com/Trigger\022\026\n\016trigger_region\030\002 \001(" + + "\t\022\027\n\nevent_type\030\003 \001(\tB\003\340A\002\022B\n\revent_filt" + + "ers\030\004 \003(\0132+.google.cloud.functions.v2alp" + + "ha.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\022S\n\014retry_p" + + "olicy\030\007 \001(\01628.google.cloud.functions.v2a" + + "lpha.EventTrigger.RetryPolicyB\003\340A\001\0228\n\007ch" + + "annel\030\010 \001(\tB\'\340A\001\372A!\n\037eventarc.googleapis" + + ".com/Channel\"b\n\013RetryPolicy\022\034\n\030RETRY_POL" + + "ICY_UNSPECIFIED\020\000\022\035\n\031RETRY_POLICY_DO_NOT" + + "_RETRY\020\001\022\026\n\022RETRY_POLICY_RETRY\020\002\"P\n\013Even" + + "tFilter\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\022Ge" + + "tFunctionRequest\022<\n\004name\030\001 \001(\tB.\340A\002\372A(\n&" + + "cloudfunctions.googleapis.com/Function\"\237" + + "\001\n\024ListFunctionsRequest\022>\n\006parent\030\001 \001(\tB" + + ".\340A\002\372A(\022&cloudfunctions.googleapis.com/F" + + "unction\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" + + "\"\202\001\n\025ListFunctionsResponse\022;\n\tfunctions\030" + + "\001 \003(\0132(.google.cloud.functions.v2alpha.F" + + "unction\022\027\n\017next_page_token\030\002 \001(\t\022\023\n\013unre" + + "achable\030\003 \003(\t\"\250\001\n\025CreateFunctionRequest\022" + + "9\n\006parent\030\001 \001(\tB)\340A\002\372A#\n!locations.googl" + + "eapis.com/Location\022?\n\010function\030\002 \001(\0132(.g" + + "oogle.cloud.functions.v2alpha.FunctionB\003" + + "\340A\002\022\023\n\013function_id\030\003 \001(\t\"\211\001\n\025UpdateFunct" + + "ionRequest\022?\n\010function\030\001 \001(\0132(.google.cl" + + "oud.functions.v2alpha.FunctionB\003\340A\002\022/\n\013u" + + "pdate_mask\030\002 \001(\0132\032.google.protobuf.Field" + + "Mask\"U\n\025DeleteFunctionRequest\022<\n\004name\030\001 " + + "\001(\tB.\340A\002\372A(\n&cloudfunctions.googleapis.c" + + "om/Function\"U\n\030GenerateUploadUrlRequest\022" + + "9\n\006parent\030\001 \001(\tB)\340A\002\372A#\n!locations.googl" + + "eapis.com/Location\"v\n\031GenerateUploadUrlR" + + "esponse\022\022\n\nupload_url\030\001 \001(\t\022E\n\016storage_s" + + "ource\030\002 \001(\0132-.google.cloud.functions.v2a" + + "lpha.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\"\275\003\n\024ListRuntimesRe" + + "sponse\022N\n\010runtimes\030\001 \003(\0132<.google.cloud." + + "functions.v2alpha.ListRuntimesResponse.R" + + "untime\032\323\001\n\007Runtime\022\014\n\004name\030\001 \001(\t\022\024\n\014disp" + + "lay_name\030\005 \001(\t\022P\n\005stage\030\002 \001(\0162A.google.c" + + "loud.functions.v2alpha.ListRuntimesRespo" + + "nse.RuntimeStage\022\020\n\010warnings\030\003 \003(\t\022@\n\013en" + + "vironment\030\004 \001(\0162+.google.cloud.functions" + + ".v2alpha.Environment\"\177\n\014RuntimeStage\022\035\n\031" + + "RUNTIME_STAGE_UNSPECIFIED\020\000\022\017\n\013DEVELOPME" + + "NT\020\001\022\t\n\005ALPHA\020\002\022\010\n\004BETA\020\003\022\006\n\002GA\020\004\022\016\n\nDEP" + + "RECATED\020\005\022\022\n\016DECOMMISSIONED\020\006\"\275\002\n\021Operat" + + "ionMetadata\022/\n\013create_time\030\001 \001(\0132\032.googl" + + "e.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.googl" + + "e.protobuf.Any\0225\n\006stages\030\t \003(\0132%.google." + + "cloud.functions.v2alpha.Stage\"\323\003\n\005Stage\022" + + "8\n\004name\030\001 \001(\0162*.google.cloud.functions.v" + + "2alpha.Stage.Name\022\017\n\007message\030\002 \001(\t\022:\n\005st" + + "ate\030\003 \001(\0162+.google.cloud.functions.v2alp" + + "ha.Stage.State\022\020\n\010resource\030\004 \001(\t\022\024\n\014reso" + + "urce_uri\030\005 \001(\t\022D\n\016state_messages\030\006 \003(\0132," + + ".google.cloud.functions.v2alpha.StateMes" + + "sage\"\204\001\n\004Name\022\024\n\020NAME_UNSPECIFIED\020\000\022\025\n\021A" + + "RTIFACT_REGISTRY\020\001\022\t\n\005BUILD\020\002\022\013\n\007SERVICE" + + "\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\021STATE_UN" + + "SPECIFIED\020\000\022\017\n\013NOT_STARTED\020\001\022\017\n\013IN_PROGR" + + "ESS\020\002\022\014\n\010COMPLETE\020\003*@\n\013Environment\022\033\n\027EN" + + "VIRONMENT_UNSPECIFIED\020\000\022\t\n\005GEN_1\020\001\022\t\n\005GE" + + "N_2\020\0022\254\017\n\017FunctionService\022\256\001\n\013GetFunctio" + + "n\0222.google.cloud.functions.v2alpha.GetFu" + + "nctionRequest\032(.google.cloud.functions.v" + + "2alpha.Function\"A\202\323\344\223\0024\0222/v2alpha/{name=" + + "projects/*/locations/*/functions/*}\332A\004na" + + "me\022\301\001\n\rListFunctions\0224.google.cloud.func" + + "tions.v2alpha.ListFunctionsRequest\0325.goo" + + "gle.cloud.functions.v2alpha.ListFunction" + + "sResponse\"C\202\323\344\223\0024\0222/v2alpha/{parent=proj" + + "ects/*/locations/*}/functions\332A\006parent\022\251" + + "\002\n\016CreateFunction\0225.google.cloud.functio" + + "ns.v2alpha.CreateFunctionRequest\032\035.googl" + + "e.longrunning.Operation\"\300\001\202\323\344\223\002>\"2/v2alp" + + "ha/{parent=projects/*/locations/*}/funct" + + "ions:\010function\332A\033parent,function,functio" + + "n_id\312A[\n\'google.cloud.functions.v2alpha." + + "Function\0220google.cloud.functions.v2alpha" + + ".OperationMetadata\022\253\002\n\016UpdateFunction\0225." + + "google.cloud.functions.v2alpha.UpdateFun" + + "ctionRequest\032\035.google.longrunning.Operat" + + "ion\"\302\001\202\323\344\223\002G2;/v2alpha/{function.name=pr" + + "ojects/*/locations/*/functions/*}:\010funct" + + "ion\332A\024function,update_mask\312A[\n\'google.cl" + + "oud.functions.v2alpha.Function\0220google.c" + + "loud.functions.v2alpha.OperationMetadata" + + "\022\366\001\n\016DeleteFunction\0225.google.cloud.funct" + + "ions.v2alpha.DeleteFunctionRequest\032\035.goo" + + "gle.longrunning.Operation\"\215\001\202\323\344\223\0024*2/v2a" + + "lpha/{name=projects/*/locations/*/functi" + + "ons/*}\332A\004name\312AI\n\025google.protobuf.Empty\022" + + "0google.cloud.functions.v2alpha.Operatio" + + "nMetadata\022\331\001\n\021GenerateUploadUrl\0228.google" + + ".cloud.functions.v2alpha.GenerateUploadU" + + "rlRequest\0329.google.cloud.functions.v2alp" + + "ha.GenerateUploadUrlResponse\"O\202\323\344\223\002I\"D/v" + + "2alpha/{parent=projects/*/locations/*}/f" + + "unctions:generateUploadUrl:\001*\022\341\001\n\023Genera" + + "teDownloadUrl\022:.google.cloud.functions.v" + + "2alpha.GenerateDownloadUrlRequest\032;.goog" + + "le.cloud.functions.v2alpha.GenerateDownl" + + "oadUrlResponse\"Q\202\323\344\223\002K\"F/v2alpha/{name=p" + + "rojects/*/locations/*/functions/*}:gener" + + "ateDownloadUrl:\001*\022\275\001\n\014ListRuntimes\0223.goo" + + "gle.cloud.functions.v2alpha.ListRuntimes" + + "Request\0324.google.cloud.functions.v2alpha" + + ".ListRuntimesResponse\"B\202\323\344\223\0023\0221/v2alpha/" + + "{parent=projects/*/locations/*}/runtimes" + + "\332A\006parent\032Q\312A\035cloudfunctions.googleapis." + + "com\322A.https://www.googleapis.com/auth/cl" + + "oud-platformB\204\007\n\"com.google.cloud.functi" + + "ons.v2alphaB\016FunctionsProtoP\001ZGgoogle.go" + + "lang.org/genproto/googleapis/cloud/funct" + + "ions/v2alpha;functions\242\002\003GCF\352Ao\n*artifac" + + "tregistry.googleapis.com/Repository\022Apro" + + "jects/{project}/locations/{location}/rep" + + "ositories/{repository}\352AY\n\037cloudbuild.go" + + "ogleapis.com/Build\0226projects/{project}/l" + + "ocations/{location}/builds/{build}\352Ai\n$c" + + "loudbuild.googleapis.com/WorkerPool\022Apro" + + "jects/{project}/locations/{location}/wor" + + "kerPools/{worker_pool}\352AX\n\032run.googleapi" + + "s.com/Service\022:projects/{project}/locati" + + "ons/{location}/services/{service}\352Ad\n\"vp" + + "caccess.googleapis.com/Connector\022>projec" + + "ts/{project}/locations/{location}/connec" + + "tors/{connector}\352A]\n\037eventarc.googleapis" + + ".com/Trigger\022:projects/{project}/locatio" + + "ns/{location}/triggers/{trigger}\352A]\n\037eve" + + "ntarc.googleapis.com/Channel\022:projects/{" + + "project}/locations/{location}/channels/{" + + "channel}\352A@\n\033pubsub.googleapis.com/Topic" + + "\022!projects/{project}/topics/{topic}b\006pro" + + "to3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.AnyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_functions_v2alpha_Function_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_functions_v2alpha_Function_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2alpha_Function_descriptor, + new java.lang.String[] { + "Name", + "Environment", + "Description", + "BuildConfig", + "ServiceConfig", + "EventTrigger", + "State", + "UpdateTime", + "Labels", + "StateMessages", + }); + internal_static_google_cloud_functions_v2alpha_Function_LabelsEntry_descriptor = + internal_static_google_cloud_functions_v2alpha_Function_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_functions_v2alpha_Function_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2alpha_Function_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_functions_v2alpha_StateMessage_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_functions_v2alpha_StateMessage_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2alpha_StateMessage_descriptor, + new java.lang.String[] { + "Severity", "Type", "Message", + }); + internal_static_google_cloud_functions_v2alpha_StorageSource_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_functions_v2alpha_StorageSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2alpha_StorageSource_descriptor, + new java.lang.String[] { + "Bucket", "Object", "Generation", + }); + internal_static_google_cloud_functions_v2alpha_RepoSource_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_functions_v2alpha_RepoSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2alpha_RepoSource_descriptor, + new java.lang.String[] { + "BranchName", + "TagName", + "CommitSha", + "ProjectId", + "RepoName", + "Dir", + "InvertRegex", + "Revision", + }); + internal_static_google_cloud_functions_v2alpha_Source_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_functions_v2alpha_Source_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2alpha_Source_descriptor, + new java.lang.String[] { + "StorageSource", "RepoSource", "Source", + }); + internal_static_google_cloud_functions_v2alpha_SourceProvenance_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_functions_v2alpha_SourceProvenance_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2alpha_SourceProvenance_descriptor, + new java.lang.String[] { + "ResolvedStorageSource", "ResolvedRepoSource", + }); + internal_static_google_cloud_functions_v2alpha_BuildConfig_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_functions_v2alpha_BuildConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2alpha_BuildConfig_descriptor, + new java.lang.String[] { + "Build", + "Runtime", + "EntryPoint", + "Source", + "SourceProvenance", + "WorkerPool", + "EnvironmentVariables", + "DockerRepository", + }); + internal_static_google_cloud_functions_v2alpha_BuildConfig_EnvironmentVariablesEntry_descriptor = + internal_static_google_cloud_functions_v2alpha_BuildConfig_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_functions_v2alpha_BuildConfig_EnvironmentVariablesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2alpha_BuildConfig_EnvironmentVariablesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_functions_v2alpha_ServiceConfig_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_functions_v2alpha_ServiceConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2alpha_ServiceConfig_descriptor, + new java.lang.String[] { + "Service", + "TimeoutSeconds", + "AvailableMemory", + "EnvironmentVariables", + "MaxInstanceCount", + "MinInstanceCount", + "VpcConnector", + "VpcConnectorEgressSettings", + "IngressSettings", + "Uri", + "ServiceAccountEmail", + "AllTrafficOnLatestRevision", + "SecretEnvironmentVariables", + "SecretVolumes", + "Revision", + }); + internal_static_google_cloud_functions_v2alpha_ServiceConfig_EnvironmentVariablesEntry_descriptor = + internal_static_google_cloud_functions_v2alpha_ServiceConfig_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_functions_v2alpha_ServiceConfig_EnvironmentVariablesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2alpha_ServiceConfig_EnvironmentVariablesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_functions_v2alpha_SecretEnvVar_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_functions_v2alpha_SecretEnvVar_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2alpha_SecretEnvVar_descriptor, + new java.lang.String[] { + "Key", "ProjectId", "Secret", "Version", + }); + internal_static_google_cloud_functions_v2alpha_SecretVolume_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_functions_v2alpha_SecretVolume_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2alpha_SecretVolume_descriptor, + new java.lang.String[] { + "MountPath", "ProjectId", "Secret", "Versions", + }); + internal_static_google_cloud_functions_v2alpha_SecretVolume_SecretVersion_descriptor = + internal_static_google_cloud_functions_v2alpha_SecretVolume_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_functions_v2alpha_SecretVolume_SecretVersion_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2alpha_SecretVolume_SecretVersion_descriptor, + new java.lang.String[] { + "Version", "Path", + }); + internal_static_google_cloud_functions_v2alpha_EventTrigger_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_functions_v2alpha_EventTrigger_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2alpha_EventTrigger_descriptor, + new java.lang.String[] { + "Trigger", + "TriggerRegion", + "EventType", + "EventFilters", + "PubsubTopic", + "ServiceAccountEmail", + "RetryPolicy", + "Channel", + }); + internal_static_google_cloud_functions_v2alpha_EventFilter_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_functions_v2alpha_EventFilter_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2alpha_EventFilter_descriptor, + new java.lang.String[] { + "Attribute", "Value", "Operator", + }); + internal_static_google_cloud_functions_v2alpha_GetFunctionRequest_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_functions_v2alpha_GetFunctionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2alpha_GetFunctionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_functions_v2alpha_ListFunctionsRequest_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_functions_v2alpha_ListFunctionsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2alpha_ListFunctionsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_functions_v2alpha_ListFunctionsResponse_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_functions_v2alpha_ListFunctionsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2alpha_ListFunctionsResponse_descriptor, + new java.lang.String[] { + "Functions", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_functions_v2alpha_CreateFunctionRequest_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_functions_v2alpha_CreateFunctionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2alpha_CreateFunctionRequest_descriptor, + new java.lang.String[] { + "Parent", "Function", "FunctionId", + }); + internal_static_google_cloud_functions_v2alpha_UpdateFunctionRequest_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_cloud_functions_v2alpha_UpdateFunctionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2alpha_UpdateFunctionRequest_descriptor, + new java.lang.String[] { + "Function", "UpdateMask", + }); + internal_static_google_cloud_functions_v2alpha_DeleteFunctionRequest_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_cloud_functions_v2alpha_DeleteFunctionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2alpha_DeleteFunctionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_functions_v2alpha_GenerateUploadUrlRequest_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_google_cloud_functions_v2alpha_GenerateUploadUrlRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2alpha_GenerateUploadUrlRequest_descriptor, + new java.lang.String[] { + "Parent", + }); + internal_static_google_cloud_functions_v2alpha_GenerateUploadUrlResponse_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_google_cloud_functions_v2alpha_GenerateUploadUrlResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2alpha_GenerateUploadUrlResponse_descriptor, + new java.lang.String[] { + "UploadUrl", "StorageSource", + }); + internal_static_google_cloud_functions_v2alpha_GenerateDownloadUrlRequest_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_google_cloud_functions_v2alpha_GenerateDownloadUrlRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2alpha_GenerateDownloadUrlRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_functions_v2alpha_GenerateDownloadUrlResponse_descriptor = + getDescriptor().getMessageTypes().get(21); + internal_static_google_cloud_functions_v2alpha_GenerateDownloadUrlResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2alpha_GenerateDownloadUrlResponse_descriptor, + new java.lang.String[] { + "DownloadUrl", + }); + internal_static_google_cloud_functions_v2alpha_ListRuntimesRequest_descriptor = + getDescriptor().getMessageTypes().get(22); + internal_static_google_cloud_functions_v2alpha_ListRuntimesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2alpha_ListRuntimesRequest_descriptor, + new java.lang.String[] { + "Parent", "Filter", + }); + internal_static_google_cloud_functions_v2alpha_ListRuntimesResponse_descriptor = + getDescriptor().getMessageTypes().get(23); + internal_static_google_cloud_functions_v2alpha_ListRuntimesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2alpha_ListRuntimesResponse_descriptor, + new java.lang.String[] { + "Runtimes", + }); + internal_static_google_cloud_functions_v2alpha_ListRuntimesResponse_Runtime_descriptor = + internal_static_google_cloud_functions_v2alpha_ListRuntimesResponse_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_functions_v2alpha_ListRuntimesResponse_Runtime_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2alpha_ListRuntimesResponse_Runtime_descriptor, + new java.lang.String[] { + "Name", "DisplayName", "Stage", "Warnings", "Environment", + }); + internal_static_google_cloud_functions_v2alpha_OperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(24); + internal_static_google_cloud_functions_v2alpha_OperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2alpha_OperationMetadata_descriptor, + new java.lang.String[] { + "CreateTime", + "EndTime", + "Target", + "Verb", + "StatusDetail", + "CancelRequested", + "ApiVersion", + "RequestResource", + "Stages", + }); + internal_static_google_cloud_functions_v2alpha_Stage_descriptor = + getDescriptor().getMessageTypes().get(25); + internal_static_google_cloud_functions_v2alpha_Stage_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2alpha_Stage_descriptor, + new java.lang.String[] { + "Name", "Message", "State", "Resource", "ResourceUri", "StateMessages", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceDefinition); + registry.add(com.google.api.ResourceProto.resourceReference); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.AnyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/GenerateDownloadUrlRequest.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/GenerateDownloadUrlRequest.java new file mode 100644 index 00000000..fc13cd9c --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/GenerateDownloadUrlRequest.java @@ -0,0 +1,664 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +/** + * + * + *
+ * Request of `GenerateDownloadUrl` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.GenerateDownloadUrlRequest} + */ +public final class GenerateDownloadUrlRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2alpha.GenerateDownloadUrlRequest) + GenerateDownloadUrlRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GenerateDownloadUrlRequest.newBuilder() to construct. + private GenerateDownloadUrlRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GenerateDownloadUrlRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GenerateDownloadUrlRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GenerateDownloadUrlRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_GenerateDownloadUrlRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_GenerateDownloadUrlRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest.class, + com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of function for which source code Google Cloud Storage signed
+   * URL should be generated.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of function for which source code Google Cloud Storage signed
+   * URL should be generated.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest)) { + return super.equals(obj); + } + com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest other = + (com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request of `GenerateDownloadUrl` method.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.GenerateDownloadUrlRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2alpha.GenerateDownloadUrlRequest) + com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_GenerateDownloadUrlRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_GenerateDownloadUrlRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest.class, + com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest.Builder.class); + } + + // Construct using com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_GenerateDownloadUrlRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest + getDefaultInstanceForType() { + return com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest build() { + com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest buildPartial() { + com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest result = + new com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest) { + return mergeFrom((com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest other) { + if (other + == com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of function for which source code Google Cloud Storage signed
+     * URL should be generated.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of function for which source code Google Cloud Storage signed
+     * URL should be generated.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of function for which source code Google Cloud Storage signed
+     * URL should be generated.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of function for which source code Google Cloud Storage signed
+     * URL should be generated.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of function for which source code Google Cloud Storage signed
+     * URL should be generated.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2alpha.GenerateDownloadUrlRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2alpha.GenerateDownloadUrlRequest) + private static final com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest(); + } + + public static com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GenerateDownloadUrlRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GenerateDownloadUrlRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.GenerateDownloadUrlRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/GenerateDownloadUrlRequestOrBuilder.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/GenerateDownloadUrlRequestOrBuilder.java new file mode 100644 index 00000000..0b401260 --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/GenerateDownloadUrlRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +public interface GenerateDownloadUrlRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2alpha.GenerateDownloadUrlRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of function for which source code Google Cloud Storage signed
+   * URL should be generated.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of function for which source code Google Cloud Storage signed
+   * URL should be generated.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/GenerateDownloadUrlResponse.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/GenerateDownloadUrlResponse.java new file mode 100644 index 00000000..c10d78f2 --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/GenerateDownloadUrlResponse.java @@ -0,0 +1,652 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +/** + * + * + *
+ * Response of `GenerateDownloadUrl` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.GenerateDownloadUrlResponse} + */ +public final class GenerateDownloadUrlResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2alpha.GenerateDownloadUrlResponse) + GenerateDownloadUrlResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use GenerateDownloadUrlResponse.newBuilder() to construct. + private GenerateDownloadUrlResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GenerateDownloadUrlResponse() { + downloadUrl_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GenerateDownloadUrlResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GenerateDownloadUrlResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + downloadUrl_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_GenerateDownloadUrlResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_GenerateDownloadUrlResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse.class, + com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse.Builder.class); + } + + public static final int DOWNLOAD_URL_FIELD_NUMBER = 1; + private volatile java.lang.Object downloadUrl_; + /** + * + * + *
+   * The generated Google Cloud Storage signed URL that should be used for
+   * function source code download.
+   * 
+ * + * string download_url = 1; + * + * @return The downloadUrl. + */ + @java.lang.Override + public java.lang.String getDownloadUrl() { + java.lang.Object ref = downloadUrl_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + downloadUrl_ = s; + return s; + } + } + /** + * + * + *
+   * The generated Google Cloud Storage signed URL that should be used for
+   * function source code download.
+   * 
+ * + * string download_url = 1; + * + * @return The bytes for downloadUrl. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDownloadUrlBytes() { + java.lang.Object ref = downloadUrl_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + downloadUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(downloadUrl_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, downloadUrl_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(downloadUrl_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, downloadUrl_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse)) { + return super.equals(obj); + } + com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse other = + (com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse) obj; + + if (!getDownloadUrl().equals(other.getDownloadUrl())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DOWNLOAD_URL_FIELD_NUMBER; + hash = (53 * hash) + getDownloadUrl().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response of `GenerateDownloadUrl` method.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.GenerateDownloadUrlResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2alpha.GenerateDownloadUrlResponse) + com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_GenerateDownloadUrlResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_GenerateDownloadUrlResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse.class, + com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse.Builder.class); + } + + // Construct using com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + downloadUrl_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_GenerateDownloadUrlResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse + getDefaultInstanceForType() { + return com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse build() { + com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse buildPartial() { + com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse result = + new com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse(this); + result.downloadUrl_ = downloadUrl_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse) { + return mergeFrom((com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse other) { + if (other + == com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse.getDefaultInstance()) + return this; + if (!other.getDownloadUrl().isEmpty()) { + downloadUrl_ = other.downloadUrl_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object downloadUrl_ = ""; + /** + * + * + *
+     * The generated Google Cloud Storage signed URL that should be used for
+     * function source code download.
+     * 
+ * + * string download_url = 1; + * + * @return The downloadUrl. + */ + public java.lang.String getDownloadUrl() { + java.lang.Object ref = downloadUrl_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + downloadUrl_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The generated Google Cloud Storage signed URL that should be used for
+     * function source code download.
+     * 
+ * + * string download_url = 1; + * + * @return The bytes for downloadUrl. + */ + public com.google.protobuf.ByteString getDownloadUrlBytes() { + java.lang.Object ref = downloadUrl_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + downloadUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The generated Google Cloud Storage signed URL that should be used for
+     * function source code download.
+     * 
+ * + * string download_url = 1; + * + * @param value The downloadUrl to set. + * @return This builder for chaining. + */ + public Builder setDownloadUrl(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + downloadUrl_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The generated Google Cloud Storage signed URL that should be used for
+     * function source code download.
+     * 
+ * + * string download_url = 1; + * + * @return This builder for chaining. + */ + public Builder clearDownloadUrl() { + + downloadUrl_ = getDefaultInstance().getDownloadUrl(); + onChanged(); + return this; + } + /** + * + * + *
+     * The generated Google Cloud Storage signed URL that should be used for
+     * function source code download.
+     * 
+ * + * string download_url = 1; + * + * @param value The bytes for downloadUrl to set. + * @return This builder for chaining. + */ + public Builder setDownloadUrlBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + downloadUrl_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2alpha.GenerateDownloadUrlResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2alpha.GenerateDownloadUrlResponse) + private static final com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse(); + } + + public static com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GenerateDownloadUrlResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GenerateDownloadUrlResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.GenerateDownloadUrlResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/GenerateDownloadUrlResponseOrBuilder.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/GenerateDownloadUrlResponseOrBuilder.java new file mode 100644 index 00000000..5dd3cfa2 --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/GenerateDownloadUrlResponseOrBuilder.java @@ -0,0 +1,52 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +public interface GenerateDownloadUrlResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2alpha.GenerateDownloadUrlResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The generated Google Cloud Storage signed URL that should be used for
+   * function source code download.
+   * 
+ * + * string download_url = 1; + * + * @return The downloadUrl. + */ + java.lang.String getDownloadUrl(); + /** + * + * + *
+   * The generated Google Cloud Storage signed URL that should be used for
+   * function source code download.
+   * 
+ * + * string download_url = 1; + * + * @return The bytes for downloadUrl. + */ + com.google.protobuf.ByteString getDownloadUrlBytes(); +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/GenerateUploadUrlRequest.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/GenerateUploadUrlRequest.java new file mode 100644 index 00000000..b37f9efe --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/GenerateUploadUrlRequest.java @@ -0,0 +1,660 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +/** + * + * + *
+ * Request of `GenerateSourceUploadUrl` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.GenerateUploadUrlRequest} + */ +public final class GenerateUploadUrlRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2alpha.GenerateUploadUrlRequest) + GenerateUploadUrlRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GenerateUploadUrlRequest.newBuilder() to construct. + private GenerateUploadUrlRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GenerateUploadUrlRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GenerateUploadUrlRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GenerateUploadUrlRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_GenerateUploadUrlRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_GenerateUploadUrlRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest.class, + com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The project and location in which the Google Cloud Storage signed URL
+   * should be generated, specified in the format `projects/*/locations/*`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The project and location in which the Google Cloud Storage signed URL
+   * should be generated, specified in the format `projects/*/locations/*`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest)) { + return super.equals(obj); + } + com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest other = + (com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request of `GenerateSourceUploadUrl` method.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.GenerateUploadUrlRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2alpha.GenerateUploadUrlRequest) + com.google.cloud.functions.v2alpha.GenerateUploadUrlRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_GenerateUploadUrlRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_GenerateUploadUrlRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest.class, + com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest.Builder.class); + } + + // Construct using com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_GenerateUploadUrlRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest getDefaultInstanceForType() { + return com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest build() { + com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest buildPartial() { + com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest result = + new com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest(this); + result.parent_ = parent_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest) { + return mergeFrom((com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest other) { + if (other == com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The project and location in which the Google Cloud Storage signed URL
+     * should be generated, specified in the format `projects/*/locations/*`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The project and location in which the Google Cloud Storage signed URL
+     * should be generated, specified in the format `projects/*/locations/*`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The project and location in which the Google Cloud Storage signed URL
+     * should be generated, specified in the format `projects/*/locations/*`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The project and location in which the Google Cloud Storage signed URL
+     * should be generated, specified in the format `projects/*/locations/*`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The project and location in which the Google Cloud Storage signed URL
+     * should be generated, specified in the format `projects/*/locations/*`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2alpha.GenerateUploadUrlRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2alpha.GenerateUploadUrlRequest) + private static final com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest(); + } + + public static com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GenerateUploadUrlRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GenerateUploadUrlRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.GenerateUploadUrlRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/GenerateUploadUrlRequestOrBuilder.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/GenerateUploadUrlRequestOrBuilder.java new file mode 100644 index 00000000..987f404b --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/GenerateUploadUrlRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +public interface GenerateUploadUrlRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2alpha.GenerateUploadUrlRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The project and location in which the Google Cloud Storage signed URL
+   * should be generated, specified in the format `projects/*/locations/*`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The project and location in which the Google Cloud Storage signed URL
+   * should be generated, specified in the format `projects/*/locations/*`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/GenerateUploadUrlResponse.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/GenerateUploadUrlResponse.java new file mode 100644 index 00000000..0f0a5f0a --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/GenerateUploadUrlResponse.java @@ -0,0 +1,994 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +/** + * + * + *
+ * Response of `GenerateSourceUploadUrl` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.GenerateUploadUrlResponse} + */ +public final class GenerateUploadUrlResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2alpha.GenerateUploadUrlResponse) + GenerateUploadUrlResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use GenerateUploadUrlResponse.newBuilder() to construct. + private GenerateUploadUrlResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GenerateUploadUrlResponse() { + uploadUrl_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GenerateUploadUrlResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GenerateUploadUrlResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + uploadUrl_ = s; + break; + } + case 18: + { + com.google.cloud.functions.v2alpha.StorageSource.Builder subBuilder = null; + if (storageSource_ != null) { + subBuilder = storageSource_.toBuilder(); + } + storageSource_ = + input.readMessage( + com.google.cloud.functions.v2alpha.StorageSource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(storageSource_); + storageSource_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_GenerateUploadUrlResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_GenerateUploadUrlResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse.class, + com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse.Builder.class); + } + + public static final int UPLOAD_URL_FIELD_NUMBER = 1; + private volatile java.lang.Object uploadUrl_; + /** + * + * + *
+   * The generated Google Cloud Storage signed URL that should be used for a
+   * function source code upload. The uploaded file should be a zip archive
+   * which contains a function.
+   * 
+ * + * string upload_url = 1; + * + * @return The uploadUrl. + */ + @java.lang.Override + public java.lang.String getUploadUrl() { + java.lang.Object ref = uploadUrl_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uploadUrl_ = s; + return s; + } + } + /** + * + * + *
+   * The generated Google Cloud Storage signed URL that should be used for a
+   * function source code upload. The uploaded file should be a zip archive
+   * which contains a function.
+   * 
+ * + * string upload_url = 1; + * + * @return The bytes for uploadUrl. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUploadUrlBytes() { + java.lang.Object ref = uploadUrl_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uploadUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STORAGE_SOURCE_FIELD_NUMBER = 2; + private com.google.cloud.functions.v2alpha.StorageSource storageSource_; + /** + * + * + *
+   * The location of the source code in the upload bucket.
+   * Once the archive is uploaded using the `upload_url` use this field to
+   * set the `function.build_config.source.storage_source`
+   * during CreateFunction and UpdateFunction.
+   * Generation defaults to 0, as Cloud Storage provides a new generation only
+   * upon uploading a new object or version of an object.
+   * 
+ * + * .google.cloud.functions.v2alpha.StorageSource storage_source = 2; + * + * @return Whether the storageSource field is set. + */ + @java.lang.Override + public boolean hasStorageSource() { + return storageSource_ != null; + } + /** + * + * + *
+   * The location of the source code in the upload bucket.
+   * Once the archive is uploaded using the `upload_url` use this field to
+   * set the `function.build_config.source.storage_source`
+   * during CreateFunction and UpdateFunction.
+   * Generation defaults to 0, as Cloud Storage provides a new generation only
+   * upon uploading a new object or version of an object.
+   * 
+ * + * .google.cloud.functions.v2alpha.StorageSource storage_source = 2; + * + * @return The storageSource. + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.StorageSource getStorageSource() { + return storageSource_ == null + ? com.google.cloud.functions.v2alpha.StorageSource.getDefaultInstance() + : storageSource_; + } + /** + * + * + *
+   * The location of the source code in the upload bucket.
+   * Once the archive is uploaded using the `upload_url` use this field to
+   * set the `function.build_config.source.storage_source`
+   * during CreateFunction and UpdateFunction.
+   * Generation defaults to 0, as Cloud Storage provides a new generation only
+   * upon uploading a new object or version of an object.
+   * 
+ * + * .google.cloud.functions.v2alpha.StorageSource storage_source = 2; + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.StorageSourceOrBuilder getStorageSourceOrBuilder() { + return getStorageSource(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uploadUrl_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uploadUrl_); + } + if (storageSource_ != null) { + output.writeMessage(2, getStorageSource()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uploadUrl_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, uploadUrl_); + } + if (storageSource_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStorageSource()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse)) { + return super.equals(obj); + } + com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse other = + (com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse) obj; + + if (!getUploadUrl().equals(other.getUploadUrl())) return false; + if (hasStorageSource() != other.hasStorageSource()) return false; + if (hasStorageSource()) { + if (!getStorageSource().equals(other.getStorageSource())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + UPLOAD_URL_FIELD_NUMBER; + hash = (53 * hash) + getUploadUrl().hashCode(); + if (hasStorageSource()) { + hash = (37 * hash) + STORAGE_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getStorageSource().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response of `GenerateSourceUploadUrl` method.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.GenerateUploadUrlResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2alpha.GenerateUploadUrlResponse) + com.google.cloud.functions.v2alpha.GenerateUploadUrlResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_GenerateUploadUrlResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_GenerateUploadUrlResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse.class, + com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse.Builder.class); + } + + // Construct using com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + uploadUrl_ = ""; + + if (storageSourceBuilder_ == null) { + storageSource_ = null; + } else { + storageSource_ = null; + storageSourceBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_GenerateUploadUrlResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse + getDefaultInstanceForType() { + return com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse build() { + com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse buildPartial() { + com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse result = + new com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse(this); + result.uploadUrl_ = uploadUrl_; + if (storageSourceBuilder_ == null) { + result.storageSource_ = storageSource_; + } else { + result.storageSource_ = storageSourceBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse) { + return mergeFrom((com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse other) { + if (other + == com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse.getDefaultInstance()) + return this; + if (!other.getUploadUrl().isEmpty()) { + uploadUrl_ = other.uploadUrl_; + onChanged(); + } + if (other.hasStorageSource()) { + mergeStorageSource(other.getStorageSource()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object uploadUrl_ = ""; + /** + * + * + *
+     * The generated Google Cloud Storage signed URL that should be used for a
+     * function source code upload. The uploaded file should be a zip archive
+     * which contains a function.
+     * 
+ * + * string upload_url = 1; + * + * @return The uploadUrl. + */ + public java.lang.String getUploadUrl() { + java.lang.Object ref = uploadUrl_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uploadUrl_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The generated Google Cloud Storage signed URL that should be used for a
+     * function source code upload. The uploaded file should be a zip archive
+     * which contains a function.
+     * 
+ * + * string upload_url = 1; + * + * @return The bytes for uploadUrl. + */ + public com.google.protobuf.ByteString getUploadUrlBytes() { + java.lang.Object ref = uploadUrl_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uploadUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The generated Google Cloud Storage signed URL that should be used for a
+     * function source code upload. The uploaded file should be a zip archive
+     * which contains a function.
+     * 
+ * + * string upload_url = 1; + * + * @param value The uploadUrl to set. + * @return This builder for chaining. + */ + public Builder setUploadUrl(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + uploadUrl_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The generated Google Cloud Storage signed URL that should be used for a
+     * function source code upload. The uploaded file should be a zip archive
+     * which contains a function.
+     * 
+ * + * string upload_url = 1; + * + * @return This builder for chaining. + */ + public Builder clearUploadUrl() { + + uploadUrl_ = getDefaultInstance().getUploadUrl(); + onChanged(); + return this; + } + /** + * + * + *
+     * The generated Google Cloud Storage signed URL that should be used for a
+     * function source code upload. The uploaded file should be a zip archive
+     * which contains a function.
+     * 
+ * + * string upload_url = 1; + * + * @param value The bytes for uploadUrl to set. + * @return This builder for chaining. + */ + public Builder setUploadUrlBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + uploadUrl_ = value; + onChanged(); + return this; + } + + private com.google.cloud.functions.v2alpha.StorageSource storageSource_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2alpha.StorageSource, + com.google.cloud.functions.v2alpha.StorageSource.Builder, + com.google.cloud.functions.v2alpha.StorageSourceOrBuilder> + storageSourceBuilder_; + /** + * + * + *
+     * The location of the source code in the upload bucket.
+     * Once the archive is uploaded using the `upload_url` use this field to
+     * set the `function.build_config.source.storage_source`
+     * during CreateFunction and UpdateFunction.
+     * Generation defaults to 0, as Cloud Storage provides a new generation only
+     * upon uploading a new object or version of an object.
+     * 
+ * + * .google.cloud.functions.v2alpha.StorageSource storage_source = 2; + * + * @return Whether the storageSource field is set. + */ + public boolean hasStorageSource() { + return storageSourceBuilder_ != null || storageSource_ != null; + } + /** + * + * + *
+     * The location of the source code in the upload bucket.
+     * Once the archive is uploaded using the `upload_url` use this field to
+     * set the `function.build_config.source.storage_source`
+     * during CreateFunction and UpdateFunction.
+     * Generation defaults to 0, as Cloud Storage provides a new generation only
+     * upon uploading a new object or version of an object.
+     * 
+ * + * .google.cloud.functions.v2alpha.StorageSource storage_source = 2; + * + * @return The storageSource. + */ + public com.google.cloud.functions.v2alpha.StorageSource getStorageSource() { + if (storageSourceBuilder_ == null) { + return storageSource_ == null + ? com.google.cloud.functions.v2alpha.StorageSource.getDefaultInstance() + : storageSource_; + } else { + return storageSourceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The location of the source code in the upload bucket.
+     * Once the archive is uploaded using the `upload_url` use this field to
+     * set the `function.build_config.source.storage_source`
+     * during CreateFunction and UpdateFunction.
+     * Generation defaults to 0, as Cloud Storage provides a new generation only
+     * upon uploading a new object or version of an object.
+     * 
+ * + * .google.cloud.functions.v2alpha.StorageSource storage_source = 2; + */ + public Builder setStorageSource(com.google.cloud.functions.v2alpha.StorageSource value) { + if (storageSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + storageSource_ = value; + onChanged(); + } else { + storageSourceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The location of the source code in the upload bucket.
+     * Once the archive is uploaded using the `upload_url` use this field to
+     * set the `function.build_config.source.storage_source`
+     * during CreateFunction and UpdateFunction.
+     * Generation defaults to 0, as Cloud Storage provides a new generation only
+     * upon uploading a new object or version of an object.
+     * 
+ * + * .google.cloud.functions.v2alpha.StorageSource storage_source = 2; + */ + public Builder setStorageSource( + com.google.cloud.functions.v2alpha.StorageSource.Builder builderForValue) { + if (storageSourceBuilder_ == null) { + storageSource_ = builderForValue.build(); + onChanged(); + } else { + storageSourceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The location of the source code in the upload bucket.
+     * Once the archive is uploaded using the `upload_url` use this field to
+     * set the `function.build_config.source.storage_source`
+     * during CreateFunction and UpdateFunction.
+     * Generation defaults to 0, as Cloud Storage provides a new generation only
+     * upon uploading a new object or version of an object.
+     * 
+ * + * .google.cloud.functions.v2alpha.StorageSource storage_source = 2; + */ + public Builder mergeStorageSource(com.google.cloud.functions.v2alpha.StorageSource value) { + if (storageSourceBuilder_ == null) { + if (storageSource_ != null) { + storageSource_ = + com.google.cloud.functions.v2alpha.StorageSource.newBuilder(storageSource_) + .mergeFrom(value) + .buildPartial(); + } else { + storageSource_ = value; + } + onChanged(); + } else { + storageSourceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The location of the source code in the upload bucket.
+     * Once the archive is uploaded using the `upload_url` use this field to
+     * set the `function.build_config.source.storage_source`
+     * during CreateFunction and UpdateFunction.
+     * Generation defaults to 0, as Cloud Storage provides a new generation only
+     * upon uploading a new object or version of an object.
+     * 
+ * + * .google.cloud.functions.v2alpha.StorageSource storage_source = 2; + */ + public Builder clearStorageSource() { + if (storageSourceBuilder_ == null) { + storageSource_ = null; + onChanged(); + } else { + storageSource_ = null; + storageSourceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The location of the source code in the upload bucket.
+     * Once the archive is uploaded using the `upload_url` use this field to
+     * set the `function.build_config.source.storage_source`
+     * during CreateFunction and UpdateFunction.
+     * Generation defaults to 0, as Cloud Storage provides a new generation only
+     * upon uploading a new object or version of an object.
+     * 
+ * + * .google.cloud.functions.v2alpha.StorageSource storage_source = 2; + */ + public com.google.cloud.functions.v2alpha.StorageSource.Builder getStorageSourceBuilder() { + + onChanged(); + return getStorageSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The location of the source code in the upload bucket.
+     * Once the archive is uploaded using the `upload_url` use this field to
+     * set the `function.build_config.source.storage_source`
+     * during CreateFunction and UpdateFunction.
+     * Generation defaults to 0, as Cloud Storage provides a new generation only
+     * upon uploading a new object or version of an object.
+     * 
+ * + * .google.cloud.functions.v2alpha.StorageSource storage_source = 2; + */ + public com.google.cloud.functions.v2alpha.StorageSourceOrBuilder getStorageSourceOrBuilder() { + if (storageSourceBuilder_ != null) { + return storageSourceBuilder_.getMessageOrBuilder(); + } else { + return storageSource_ == null + ? com.google.cloud.functions.v2alpha.StorageSource.getDefaultInstance() + : storageSource_; + } + } + /** + * + * + *
+     * The location of the source code in the upload bucket.
+     * Once the archive is uploaded using the `upload_url` use this field to
+     * set the `function.build_config.source.storage_source`
+     * during CreateFunction and UpdateFunction.
+     * Generation defaults to 0, as Cloud Storage provides a new generation only
+     * upon uploading a new object or version of an object.
+     * 
+ * + * .google.cloud.functions.v2alpha.StorageSource storage_source = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2alpha.StorageSource, + com.google.cloud.functions.v2alpha.StorageSource.Builder, + com.google.cloud.functions.v2alpha.StorageSourceOrBuilder> + getStorageSourceFieldBuilder() { + if (storageSourceBuilder_ == null) { + storageSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2alpha.StorageSource, + com.google.cloud.functions.v2alpha.StorageSource.Builder, + com.google.cloud.functions.v2alpha.StorageSourceOrBuilder>( + getStorageSource(), getParentForChildren(), isClean()); + storageSource_ = null; + } + return storageSourceBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2alpha.GenerateUploadUrlResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2alpha.GenerateUploadUrlResponse) + private static final com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse(); + } + + public static com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GenerateUploadUrlResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GenerateUploadUrlResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.GenerateUploadUrlResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/GenerateUploadUrlResponseOrBuilder.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/GenerateUploadUrlResponseOrBuilder.java new file mode 100644 index 00000000..4c8c39f1 --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/GenerateUploadUrlResponseOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +public interface GenerateUploadUrlResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2alpha.GenerateUploadUrlResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The generated Google Cloud Storage signed URL that should be used for a
+   * function source code upload. The uploaded file should be a zip archive
+   * which contains a function.
+   * 
+ * + * string upload_url = 1; + * + * @return The uploadUrl. + */ + java.lang.String getUploadUrl(); + /** + * + * + *
+   * The generated Google Cloud Storage signed URL that should be used for a
+   * function source code upload. The uploaded file should be a zip archive
+   * which contains a function.
+   * 
+ * + * string upload_url = 1; + * + * @return The bytes for uploadUrl. + */ + com.google.protobuf.ByteString getUploadUrlBytes(); + + /** + * + * + *
+   * The location of the source code in the upload bucket.
+   * Once the archive is uploaded using the `upload_url` use this field to
+   * set the `function.build_config.source.storage_source`
+   * during CreateFunction and UpdateFunction.
+   * Generation defaults to 0, as Cloud Storage provides a new generation only
+   * upon uploading a new object or version of an object.
+   * 
+ * + * .google.cloud.functions.v2alpha.StorageSource storage_source = 2; + * + * @return Whether the storageSource field is set. + */ + boolean hasStorageSource(); + /** + * + * + *
+   * The location of the source code in the upload bucket.
+   * Once the archive is uploaded using the `upload_url` use this field to
+   * set the `function.build_config.source.storage_source`
+   * during CreateFunction and UpdateFunction.
+   * Generation defaults to 0, as Cloud Storage provides a new generation only
+   * upon uploading a new object or version of an object.
+   * 
+ * + * .google.cloud.functions.v2alpha.StorageSource storage_source = 2; + * + * @return The storageSource. + */ + com.google.cloud.functions.v2alpha.StorageSource getStorageSource(); + /** + * + * + *
+   * The location of the source code in the upload bucket.
+   * Once the archive is uploaded using the `upload_url` use this field to
+   * set the `function.build_config.source.storage_source`
+   * during CreateFunction and UpdateFunction.
+   * Generation defaults to 0, as Cloud Storage provides a new generation only
+   * upon uploading a new object or version of an object.
+   * 
+ * + * .google.cloud.functions.v2alpha.StorageSource storage_source = 2; + */ + com.google.cloud.functions.v2alpha.StorageSourceOrBuilder getStorageSourceOrBuilder(); +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/GetFunctionRequest.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/GetFunctionRequest.java new file mode 100644 index 00000000..8af4a3e7 --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/GetFunctionRequest.java @@ -0,0 +1,653 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +/** + * + * + *
+ * Request for the `GetFunction` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.GetFunctionRequest} + */ +public final class GetFunctionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2alpha.GetFunctionRequest) + GetFunctionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetFunctionRequest.newBuilder() to construct. + private GetFunctionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetFunctionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetFunctionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetFunctionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_GetFunctionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_GetFunctionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.GetFunctionRequest.class, + com.google.cloud.functions.v2alpha.GetFunctionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the function which details should be obtained.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the function which details should be obtained.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2alpha.GetFunctionRequest)) { + return super.equals(obj); + } + com.google.cloud.functions.v2alpha.GetFunctionRequest other = + (com.google.cloud.functions.v2alpha.GetFunctionRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2alpha.GetFunctionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.GetFunctionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.GetFunctionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.GetFunctionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.GetFunctionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.GetFunctionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.GetFunctionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.GetFunctionRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.GetFunctionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.GetFunctionRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.GetFunctionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.GetFunctionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.functions.v2alpha.GetFunctionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the `GetFunction` method.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.GetFunctionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2alpha.GetFunctionRequest) + com.google.cloud.functions.v2alpha.GetFunctionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_GetFunctionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_GetFunctionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.GetFunctionRequest.class, + com.google.cloud.functions.v2alpha.GetFunctionRequest.Builder.class); + } + + // Construct using com.google.cloud.functions.v2alpha.GetFunctionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_GetFunctionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.GetFunctionRequest getDefaultInstanceForType() { + return com.google.cloud.functions.v2alpha.GetFunctionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.GetFunctionRequest build() { + com.google.cloud.functions.v2alpha.GetFunctionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.GetFunctionRequest buildPartial() { + com.google.cloud.functions.v2alpha.GetFunctionRequest result = + new com.google.cloud.functions.v2alpha.GetFunctionRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2alpha.GetFunctionRequest) { + return mergeFrom((com.google.cloud.functions.v2alpha.GetFunctionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2alpha.GetFunctionRequest other) { + if (other == com.google.cloud.functions.v2alpha.GetFunctionRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2alpha.GetFunctionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2alpha.GetFunctionRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the function which details should be obtained.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the function which details should be obtained.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the function which details should be obtained.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the function which details should be obtained.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the function which details should be obtained.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2alpha.GetFunctionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2alpha.GetFunctionRequest) + private static final com.google.cloud.functions.v2alpha.GetFunctionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2alpha.GetFunctionRequest(); + } + + public static com.google.cloud.functions.v2alpha.GetFunctionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetFunctionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetFunctionRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.GetFunctionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/GetFunctionRequestOrBuilder.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/GetFunctionRequestOrBuilder.java new file mode 100644 index 00000000..e12f66d5 --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/GetFunctionRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +public interface GetFunctionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2alpha.GetFunctionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the function which details should be obtained.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the function which details should be obtained.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/ListFunctionsRequest.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/ListFunctionsRequest.java new file mode 100644 index 00000000..2bb71b1c --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/ListFunctionsRequest.java @@ -0,0 +1,1357 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +/** + * + * + *
+ * Request for the `ListFunctions` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.ListFunctionsRequest} + */ +public final class ListFunctionsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2alpha.ListFunctionsRequest) + ListFunctionsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListFunctionsRequest.newBuilder() to construct. + private ListFunctionsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListFunctionsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListFunctionsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListFunctionsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + orderBy_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_ListFunctionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_ListFunctionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.ListFunctionsRequest.class, + com.google.cloud.functions.v2alpha.ListFunctionsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The project and location from which the function should be listed,
+   * specified in the format `projects/*/locations/*`
+   * If you want to list functions in all locations, use "-" in place of a
+   * location. When listing functions in all locations, if one or more
+   * location(s) are unreachable, the response will contain functions from all
+   * reachable locations along with the names of any unreachable locations.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The project and location from which the function should be listed,
+   * specified in the format `projects/*/locations/*`
+   * If you want to list functions in all locations, use "-" in place of a
+   * location. When listing functions in all locations, if one or more
+   * location(s) are unreachable, the response will contain functions from all
+   * reachable locations along with the names of any unreachable locations.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * Maximum number of functions to return per call.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The value returned by the last
+   * `ListFunctionsResponse`; indicates that
+   * this is a continuation of a prior `ListFunctions` call, and that the
+   * system should return the next page of data.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The value returned by the last
+   * `ListFunctionsResponse`; indicates that
+   * this is a continuation of a prior `ListFunctions` call, and that the
+   * system should return the next page of data.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * The filter for Functions that match the filter expression,
+   * following the syntax outlined in https://google.aip.dev/160.
+   * 
+ * + * string filter = 4; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * The filter for Functions that match the filter expression,
+   * following the syntax outlined in https://google.aip.dev/160.
+   * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 5; + private volatile java.lang.Object orderBy_; + /** + * + * + *
+   * The sorting order of the resources returned. Value should be a comma
+   * separated list of fields. The default sorting oder is ascending.
+   * See https://google.aip.dev/132#ordering.
+   * 
+ * + * string order_by = 5; + * + * @return The orderBy. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * The sorting order of the resources returned. Value should be a comma
+   * separated list of fields. The default sorting oder is ascending.
+   * See https://google.aip.dev/132#ordering.
+   * 
+ * + * string order_by = 5; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, orderBy_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, orderBy_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2alpha.ListFunctionsRequest)) { + return super.equals(obj); + } + com.google.cloud.functions.v2alpha.ListFunctionsRequest other = + (com.google.cloud.functions.v2alpha.ListFunctionsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2alpha.ListFunctionsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.ListFunctionsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.ListFunctionsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.ListFunctionsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.ListFunctionsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.ListFunctionsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.ListFunctionsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.ListFunctionsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.ListFunctionsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.ListFunctionsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.ListFunctionsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.ListFunctionsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.functions.v2alpha.ListFunctionsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the `ListFunctions` method.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.ListFunctionsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2alpha.ListFunctionsRequest) + com.google.cloud.functions.v2alpha.ListFunctionsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_ListFunctionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_ListFunctionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.ListFunctionsRequest.class, + com.google.cloud.functions.v2alpha.ListFunctionsRequest.Builder.class); + } + + // Construct using com.google.cloud.functions.v2alpha.ListFunctionsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + filter_ = ""; + + orderBy_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_ListFunctionsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.ListFunctionsRequest getDefaultInstanceForType() { + return com.google.cloud.functions.v2alpha.ListFunctionsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.ListFunctionsRequest build() { + com.google.cloud.functions.v2alpha.ListFunctionsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.ListFunctionsRequest buildPartial() { + com.google.cloud.functions.v2alpha.ListFunctionsRequest result = + new com.google.cloud.functions.v2alpha.ListFunctionsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.filter_ = filter_; + result.orderBy_ = orderBy_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2alpha.ListFunctionsRequest) { + return mergeFrom((com.google.cloud.functions.v2alpha.ListFunctionsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2alpha.ListFunctionsRequest other) { + if (other == com.google.cloud.functions.v2alpha.ListFunctionsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2alpha.ListFunctionsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2alpha.ListFunctionsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The project and location from which the function should be listed,
+     * specified in the format `projects/*/locations/*`
+     * If you want to list functions in all locations, use "-" in place of a
+     * location. When listing functions in all locations, if one or more
+     * location(s) are unreachable, the response will contain functions from all
+     * reachable locations along with the names of any unreachable locations.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The project and location from which the function should be listed,
+     * specified in the format `projects/*/locations/*`
+     * If you want to list functions in all locations, use "-" in place of a
+     * location. When listing functions in all locations, if one or more
+     * location(s) are unreachable, the response will contain functions from all
+     * reachable locations along with the names of any unreachable locations.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The project and location from which the function should be listed,
+     * specified in the format `projects/*/locations/*`
+     * If you want to list functions in all locations, use "-" in place of a
+     * location. When listing functions in all locations, if one or more
+     * location(s) are unreachable, the response will contain functions from all
+     * reachable locations along with the names of any unreachable locations.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The project and location from which the function should be listed,
+     * specified in the format `projects/*/locations/*`
+     * If you want to list functions in all locations, use "-" in place of a
+     * location. When listing functions in all locations, if one or more
+     * location(s) are unreachable, the response will contain functions from all
+     * reachable locations along with the names of any unreachable locations.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The project and location from which the function should be listed,
+     * specified in the format `projects/*/locations/*`
+     * If you want to list functions in all locations, use "-" in place of a
+     * location. When listing functions in all locations, if one or more
+     * location(s) are unreachable, the response will contain functions from all
+     * reachable locations along with the names of any unreachable locations.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Maximum number of functions to return per call.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Maximum number of functions to return per call.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Maximum number of functions to return per call.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The value returned by the last
+     * `ListFunctionsResponse`; indicates that
+     * this is a continuation of a prior `ListFunctions` call, and that the
+     * system should return the next page of data.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The value returned by the last
+     * `ListFunctionsResponse`; indicates that
+     * this is a continuation of a prior `ListFunctions` call, and that the
+     * system should return the next page of data.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The value returned by the last
+     * `ListFunctionsResponse`; indicates that
+     * this is a continuation of a prior `ListFunctions` call, and that the
+     * system should return the next page of data.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The value returned by the last
+     * `ListFunctionsResponse`; indicates that
+     * this is a continuation of a prior `ListFunctions` call, and that the
+     * system should return the next page of data.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The value returned by the last
+     * `ListFunctionsResponse`; indicates that
+     * this is a continuation of a prior `ListFunctions` call, and that the
+     * system should return the next page of data.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * The filter for Functions that match the filter expression,
+     * following the syntax outlined in https://google.aip.dev/160.
+     * 
+ * + * string filter = 4; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The filter for Functions that match the filter expression,
+     * following the syntax outlined in https://google.aip.dev/160.
+     * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The filter for Functions that match the filter expression,
+     * following the syntax outlined in https://google.aip.dev/160.
+     * 
+ * + * string filter = 4; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The filter for Functions that match the filter expression,
+     * following the syntax outlined in https://google.aip.dev/160.
+     * 
+ * + * string filter = 4; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * The filter for Functions that match the filter expression,
+     * following the syntax outlined in https://google.aip.dev/160.
+     * 
+ * + * string filter = 4; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * The sorting order of the resources returned. Value should be a comma
+     * separated list of fields. The default sorting oder is ascending.
+     * See https://google.aip.dev/132#ordering.
+     * 
+ * + * string order_by = 5; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The sorting order of the resources returned. Value should be a comma
+     * separated list of fields. The default sorting oder is ascending.
+     * See https://google.aip.dev/132#ordering.
+     * 
+ * + * string order_by = 5; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The sorting order of the resources returned. Value should be a comma
+     * separated list of fields. The default sorting oder is ascending.
+     * See https://google.aip.dev/132#ordering.
+     * 
+ * + * string order_by = 5; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + orderBy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The sorting order of the resources returned. Value should be a comma
+     * separated list of fields. The default sorting oder is ascending.
+     * See https://google.aip.dev/132#ordering.
+     * 
+ * + * string order_by = 5; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + + orderBy_ = getDefaultInstance().getOrderBy(); + onChanged(); + return this; + } + /** + * + * + *
+     * The sorting order of the resources returned. Value should be a comma
+     * separated list of fields. The default sorting oder is ascending.
+     * See https://google.aip.dev/132#ordering.
+     * 
+ * + * string order_by = 5; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + orderBy_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2alpha.ListFunctionsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2alpha.ListFunctionsRequest) + private static final com.google.cloud.functions.v2alpha.ListFunctionsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2alpha.ListFunctionsRequest(); + } + + public static com.google.cloud.functions.v2alpha.ListFunctionsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListFunctionsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListFunctionsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.ListFunctionsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/ListFunctionsRequestOrBuilder.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/ListFunctionsRequestOrBuilder.java new file mode 100644 index 00000000..5d5614eb --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/ListFunctionsRequestOrBuilder.java @@ -0,0 +1,164 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +public interface ListFunctionsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2alpha.ListFunctionsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The project and location from which the function should be listed,
+   * specified in the format `projects/*/locations/*`
+   * If you want to list functions in all locations, use "-" in place of a
+   * location. When listing functions in all locations, if one or more
+   * location(s) are unreachable, the response will contain functions from all
+   * reachable locations along with the names of any unreachable locations.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The project and location from which the function should be listed,
+   * specified in the format `projects/*/locations/*`
+   * If you want to list functions in all locations, use "-" in place of a
+   * location. When listing functions in all locations, if one or more
+   * location(s) are unreachable, the response will contain functions from all
+   * reachable locations along with the names of any unreachable locations.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Maximum number of functions to return per call.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The value returned by the last
+   * `ListFunctionsResponse`; indicates that
+   * this is a continuation of a prior `ListFunctions` call, and that the
+   * system should return the next page of data.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The value returned by the last
+   * `ListFunctionsResponse`; indicates that
+   * this is a continuation of a prior `ListFunctions` call, and that the
+   * system should return the next page of data.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * The filter for Functions that match the filter expression,
+   * following the syntax outlined in https://google.aip.dev/160.
+   * 
+ * + * string filter = 4; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * The filter for Functions that match the filter expression,
+   * following the syntax outlined in https://google.aip.dev/160.
+   * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * The sorting order of the resources returned. Value should be a comma
+   * separated list of fields. The default sorting oder is ascending.
+   * See https://google.aip.dev/132#ordering.
+   * 
+ * + * string order_by = 5; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * The sorting order of the resources returned. Value should be a comma
+   * separated list of fields. The default sorting oder is ascending.
+   * See https://google.aip.dev/132#ordering.
+   * 
+ * + * string order_by = 5; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/ListFunctionsResponse.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/ListFunctionsResponse.java new file mode 100644 index 00000000..a7088f2d --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/ListFunctionsResponse.java @@ -0,0 +1,1429 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +/** + * + * + *
+ * Response for the `ListFunctions` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.ListFunctionsResponse} + */ +public final class ListFunctionsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2alpha.ListFunctionsResponse) + ListFunctionsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListFunctionsResponse.newBuilder() to construct. + private ListFunctionsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListFunctionsResponse() { + functions_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListFunctionsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListFunctionsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + functions_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + functions_.add( + input.readMessage( + com.google.cloud.functions.v2alpha.Function.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + unreachable_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + functions_ = java.util.Collections.unmodifiableList(functions_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_ListFunctionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_ListFunctionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.ListFunctionsResponse.class, + com.google.cloud.functions.v2alpha.ListFunctionsResponse.Builder.class); + } + + public static final int FUNCTIONS_FIELD_NUMBER = 1; + private java.util.List functions_; + /** + * + * + *
+   * The functions that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.Function functions = 1; + */ + @java.lang.Override + public java.util.List getFunctionsList() { + return functions_; + } + /** + * + * + *
+   * The functions that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.Function functions = 1; + */ + @java.lang.Override + public java.util.List + getFunctionsOrBuilderList() { + return functions_; + } + /** + * + * + *
+   * The functions that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.Function functions = 1; + */ + @java.lang.Override + public int getFunctionsCount() { + return functions_.size(); + } + /** + * + * + *
+   * The functions that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.Function functions = 1; + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.Function getFunctions(int index) { + return functions_.get(index); + } + /** + * + * + *
+   * The functions that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.Function functions = 1; + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.FunctionOrBuilder getFunctionsOrBuilder(int index) { + return functions_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UNREACHABLE_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList unreachable_; + /** + * + * + *
+   * Locations that could not be reached. The response does not include any
+   * functions from these locations.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * Locations that could not be reached. The response does not include any
+   * functions from these locations.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * Locations that could not be reached. The response does not include any
+   * functions from these locations.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+   * Locations that could not be reached. The response does not include any
+   * functions from these locations.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < functions_.size(); i++) { + output.writeMessage(1, functions_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < functions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, functions_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2alpha.ListFunctionsResponse)) { + return super.equals(obj); + } + com.google.cloud.functions.v2alpha.ListFunctionsResponse other = + (com.google.cloud.functions.v2alpha.ListFunctionsResponse) obj; + + if (!getFunctionsList().equals(other.getFunctionsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getFunctionsCount() > 0) { + hash = (37 * hash) + FUNCTIONS_FIELD_NUMBER; + hash = (53 * hash) + getFunctionsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2alpha.ListFunctionsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.ListFunctionsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.ListFunctionsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.ListFunctionsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.ListFunctionsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.ListFunctionsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.ListFunctionsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.ListFunctionsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.ListFunctionsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.ListFunctionsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.ListFunctionsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.ListFunctionsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.functions.v2alpha.ListFunctionsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response for the `ListFunctions` method.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.ListFunctionsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2alpha.ListFunctionsResponse) + com.google.cloud.functions.v2alpha.ListFunctionsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_ListFunctionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_ListFunctionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.ListFunctionsResponse.class, + com.google.cloud.functions.v2alpha.ListFunctionsResponse.Builder.class); + } + + // Construct using com.google.cloud.functions.v2alpha.ListFunctionsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getFunctionsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (functionsBuilder_ == null) { + functions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + functionsBuilder_.clear(); + } + nextPageToken_ = ""; + + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_ListFunctionsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.ListFunctionsResponse getDefaultInstanceForType() { + return com.google.cloud.functions.v2alpha.ListFunctionsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.ListFunctionsResponse build() { + com.google.cloud.functions.v2alpha.ListFunctionsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.ListFunctionsResponse buildPartial() { + com.google.cloud.functions.v2alpha.ListFunctionsResponse result = + new com.google.cloud.functions.v2alpha.ListFunctionsResponse(this); + int from_bitField0_ = bitField0_; + if (functionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + functions_ = java.util.Collections.unmodifiableList(functions_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.functions_ = functions_; + } else { + result.functions_ = functionsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + if (((bitField0_ & 0x00000002) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.unreachable_ = unreachable_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2alpha.ListFunctionsResponse) { + return mergeFrom((com.google.cloud.functions.v2alpha.ListFunctionsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2alpha.ListFunctionsResponse other) { + if (other == com.google.cloud.functions.v2alpha.ListFunctionsResponse.getDefaultInstance()) + return this; + if (functionsBuilder_ == null) { + if (!other.functions_.isEmpty()) { + if (functions_.isEmpty()) { + functions_ = other.functions_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureFunctionsIsMutable(); + functions_.addAll(other.functions_); + } + onChanged(); + } + } else { + if (!other.functions_.isEmpty()) { + if (functionsBuilder_.isEmpty()) { + functionsBuilder_.dispose(); + functionsBuilder_ = null; + functions_ = other.functions_; + bitField0_ = (bitField0_ & ~0x00000001); + functionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getFunctionsFieldBuilder() + : null; + } else { + functionsBuilder_.addAllMessages(other.functions_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2alpha.ListFunctionsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2alpha.ListFunctionsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List functions_ = + java.util.Collections.emptyList(); + + private void ensureFunctionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + functions_ = + new java.util.ArrayList(functions_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2alpha.Function, + com.google.cloud.functions.v2alpha.Function.Builder, + com.google.cloud.functions.v2alpha.FunctionOrBuilder> + functionsBuilder_; + + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.Function functions = 1; + */ + public java.util.List getFunctionsList() { + if (functionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(functions_); + } else { + return functionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.Function functions = 1; + */ + public int getFunctionsCount() { + if (functionsBuilder_ == null) { + return functions_.size(); + } else { + return functionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.Function functions = 1; + */ + public com.google.cloud.functions.v2alpha.Function getFunctions(int index) { + if (functionsBuilder_ == null) { + return functions_.get(index); + } else { + return functionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.Function functions = 1; + */ + public Builder setFunctions(int index, com.google.cloud.functions.v2alpha.Function value) { + if (functionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFunctionsIsMutable(); + functions_.set(index, value); + onChanged(); + } else { + functionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.Function functions = 1; + */ + public Builder setFunctions( + int index, com.google.cloud.functions.v2alpha.Function.Builder builderForValue) { + if (functionsBuilder_ == null) { + ensureFunctionsIsMutable(); + functions_.set(index, builderForValue.build()); + onChanged(); + } else { + functionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.Function functions = 1; + */ + public Builder addFunctions(com.google.cloud.functions.v2alpha.Function value) { + if (functionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFunctionsIsMutable(); + functions_.add(value); + onChanged(); + } else { + functionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.Function functions = 1; + */ + public Builder addFunctions(int index, com.google.cloud.functions.v2alpha.Function value) { + if (functionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFunctionsIsMutable(); + functions_.add(index, value); + onChanged(); + } else { + functionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.Function functions = 1; + */ + public Builder addFunctions( + com.google.cloud.functions.v2alpha.Function.Builder builderForValue) { + if (functionsBuilder_ == null) { + ensureFunctionsIsMutable(); + functions_.add(builderForValue.build()); + onChanged(); + } else { + functionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.Function functions = 1; + */ + public Builder addFunctions( + int index, com.google.cloud.functions.v2alpha.Function.Builder builderForValue) { + if (functionsBuilder_ == null) { + ensureFunctionsIsMutable(); + functions_.add(index, builderForValue.build()); + onChanged(); + } else { + functionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.Function functions = 1; + */ + public Builder addAllFunctions( + java.lang.Iterable values) { + if (functionsBuilder_ == null) { + ensureFunctionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, functions_); + onChanged(); + } else { + functionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.Function functions = 1; + */ + public Builder clearFunctions() { + if (functionsBuilder_ == null) { + functions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + functionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.Function functions = 1; + */ + public Builder removeFunctions(int index) { + if (functionsBuilder_ == null) { + ensureFunctionsIsMutable(); + functions_.remove(index); + onChanged(); + } else { + functionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.Function functions = 1; + */ + public com.google.cloud.functions.v2alpha.Function.Builder getFunctionsBuilder(int index) { + return getFunctionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.Function functions = 1; + */ + public com.google.cloud.functions.v2alpha.FunctionOrBuilder getFunctionsOrBuilder(int index) { + if (functionsBuilder_ == null) { + return functions_.get(index); + } else { + return functionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.Function functions = 1; + */ + public java.util.List + getFunctionsOrBuilderList() { + if (functionsBuilder_ != null) { + return functionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(functions_); + } + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.Function functions = 1; + */ + public com.google.cloud.functions.v2alpha.Function.Builder addFunctionsBuilder() { + return getFunctionsFieldBuilder() + .addBuilder(com.google.cloud.functions.v2alpha.Function.getDefaultInstance()); + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.Function functions = 1; + */ + public com.google.cloud.functions.v2alpha.Function.Builder addFunctionsBuilder(int index) { + return getFunctionsFieldBuilder() + .addBuilder(index, com.google.cloud.functions.v2alpha.Function.getDefaultInstance()); + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.Function functions = 1; + */ + public java.util.List + getFunctionsBuilderList() { + return getFunctionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2alpha.Function, + com.google.cloud.functions.v2alpha.Function.Builder, + com.google.cloud.functions.v2alpha.FunctionOrBuilder> + getFunctionsFieldBuilder() { + if (functionsBuilder_ == null) { + functionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2alpha.Function, + com.google.cloud.functions.v2alpha.Function.Builder, + com.google.cloud.functions.v2alpha.FunctionOrBuilder>( + functions_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + functions_ = null; + } + return functionsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList unreachable_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureUnreachableIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * Locations that could not be reached. The response does not include any
+     * functions from these locations.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_.getUnmodifiableView(); + } + /** + * + * + *
+     * Locations that could not be reached. The response does not include any
+     * functions from these locations.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * Locations that could not be reached. The response does not include any
+     * functions from these locations.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+     * Locations that could not be reached. The response does not include any
+     * functions from these locations.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + /** + * + * + *
+     * Locations that could not be reached. The response does not include any
+     * functions from these locations.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached. The response does not include any
+     * functions from these locations.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached. The response does not include any
+     * functions from these locations.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached. The response does not include any
+     * functions from these locations.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached. The response does not include any
+     * functions from these locations.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2alpha.ListFunctionsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2alpha.ListFunctionsResponse) + private static final com.google.cloud.functions.v2alpha.ListFunctionsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2alpha.ListFunctionsResponse(); + } + + public static com.google.cloud.functions.v2alpha.ListFunctionsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListFunctionsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListFunctionsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.ListFunctionsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/ListFunctionsResponseOrBuilder.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/ListFunctionsResponseOrBuilder.java new file mode 100644 index 00000000..657b00b2 --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/ListFunctionsResponseOrBuilder.java @@ -0,0 +1,159 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +public interface ListFunctionsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2alpha.ListFunctionsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The functions that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.Function functions = 1; + */ + java.util.List getFunctionsList(); + /** + * + * + *
+   * The functions that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.Function functions = 1; + */ + com.google.cloud.functions.v2alpha.Function getFunctions(int index); + /** + * + * + *
+   * The functions that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.Function functions = 1; + */ + int getFunctionsCount(); + /** + * + * + *
+   * The functions that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.Function functions = 1; + */ + java.util.List + getFunctionsOrBuilderList(); + /** + * + * + *
+   * The functions that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.Function functions = 1; + */ + com.google.cloud.functions.v2alpha.FunctionOrBuilder getFunctionsOrBuilder(int index); + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Locations that could not be reached. The response does not include any
+   * functions from these locations.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * Locations that could not be reached. The response does not include any
+   * functions from these locations.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * Locations that could not be reached. The response does not include any
+   * functions from these locations.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + /** + * + * + *
+   * Locations that could not be reached. The response does not include any
+   * functions from these locations.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/ListRuntimesRequest.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/ListRuntimesRequest.java new file mode 100644 index 00000000..1af94918 --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/ListRuntimesRequest.java @@ -0,0 +1,846 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +/** + * + * + *
+ * Request for the `ListRuntimes` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.ListRuntimesRequest} + */ +public final class ListRuntimesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2alpha.ListRuntimesRequest) + ListRuntimesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListRuntimesRequest.newBuilder() to construct. + private ListRuntimesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListRuntimesRequest() { + parent_ = ""; + filter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListRuntimesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListRuntimesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_ListRuntimesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_ListRuntimesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.ListRuntimesRequest.class, + com.google.cloud.functions.v2alpha.ListRuntimesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The project and location from which the runtimes should be listed,
+   * specified in the format `projects/*/locations/*`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The project and location from which the runtimes should be listed,
+   * specified in the format `projects/*/locations/*`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 2; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * The filter for Runtimes that match the filter expression,
+   * following the syntax outlined in https://google.aip.dev/160.
+   * 
+ * + * string filter = 2; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * The filter for Runtimes that match the filter expression,
+   * following the syntax outlined in https://google.aip.dev/160.
+   * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2alpha.ListRuntimesRequest)) { + return super.equals(obj); + } + com.google.cloud.functions.v2alpha.ListRuntimesRequest other = + (com.google.cloud.functions.v2alpha.ListRuntimesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2alpha.ListRuntimesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.ListRuntimesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.ListRuntimesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.ListRuntimesRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.ListRuntimesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.ListRuntimesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.ListRuntimesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.ListRuntimesRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.ListRuntimesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.ListRuntimesRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.ListRuntimesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.ListRuntimesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.functions.v2alpha.ListRuntimesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the `ListRuntimes` method.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.ListRuntimesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2alpha.ListRuntimesRequest) + com.google.cloud.functions.v2alpha.ListRuntimesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_ListRuntimesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_ListRuntimesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.ListRuntimesRequest.class, + com.google.cloud.functions.v2alpha.ListRuntimesRequest.Builder.class); + } + + // Construct using com.google.cloud.functions.v2alpha.ListRuntimesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + filter_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_ListRuntimesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.ListRuntimesRequest getDefaultInstanceForType() { + return com.google.cloud.functions.v2alpha.ListRuntimesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.ListRuntimesRequest build() { + com.google.cloud.functions.v2alpha.ListRuntimesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.ListRuntimesRequest buildPartial() { + com.google.cloud.functions.v2alpha.ListRuntimesRequest result = + new com.google.cloud.functions.v2alpha.ListRuntimesRequest(this); + result.parent_ = parent_; + result.filter_ = filter_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2alpha.ListRuntimesRequest) { + return mergeFrom((com.google.cloud.functions.v2alpha.ListRuntimesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2alpha.ListRuntimesRequest other) { + if (other == com.google.cloud.functions.v2alpha.ListRuntimesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2alpha.ListRuntimesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2alpha.ListRuntimesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The project and location from which the runtimes should be listed,
+     * specified in the format `projects/*/locations/*`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The project and location from which the runtimes should be listed,
+     * specified in the format `projects/*/locations/*`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The project and location from which the runtimes should be listed,
+     * specified in the format `projects/*/locations/*`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The project and location from which the runtimes should be listed,
+     * specified in the format `projects/*/locations/*`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The project and location from which the runtimes should be listed,
+     * specified in the format `projects/*/locations/*`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * The filter for Runtimes that match the filter expression,
+     * following the syntax outlined in https://google.aip.dev/160.
+     * 
+ * + * string filter = 2; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The filter for Runtimes that match the filter expression,
+     * following the syntax outlined in https://google.aip.dev/160.
+     * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The filter for Runtimes that match the filter expression,
+     * following the syntax outlined in https://google.aip.dev/160.
+     * 
+ * + * string filter = 2; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The filter for Runtimes that match the filter expression,
+     * following the syntax outlined in https://google.aip.dev/160.
+     * 
+ * + * string filter = 2; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * The filter for Runtimes that match the filter expression,
+     * following the syntax outlined in https://google.aip.dev/160.
+     * 
+ * + * string filter = 2; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2alpha.ListRuntimesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2alpha.ListRuntimesRequest) + private static final com.google.cloud.functions.v2alpha.ListRuntimesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2alpha.ListRuntimesRequest(); + } + + public static com.google.cloud.functions.v2alpha.ListRuntimesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListRuntimesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListRuntimesRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.ListRuntimesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/ListRuntimesRequestOrBuilder.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/ListRuntimesRequestOrBuilder.java new file mode 100644 index 00000000..f89529bf --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/ListRuntimesRequestOrBuilder.java @@ -0,0 +1,83 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +public interface ListRuntimesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2alpha.ListRuntimesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The project and location from which the runtimes should be listed,
+   * specified in the format `projects/*/locations/*`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The project and location from which the runtimes should be listed,
+   * specified in the format `projects/*/locations/*`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The filter for Runtimes that match the filter expression,
+   * following the syntax outlined in https://google.aip.dev/160.
+   * 
+ * + * string filter = 2; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * The filter for Runtimes that match the filter expression,
+   * following the syntax outlined in https://google.aip.dev/160.
+   * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/ListRuntimesResponse.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/ListRuntimesResponse.java new file mode 100644 index 00000000..da1813d5 --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/ListRuntimesResponse.java @@ -0,0 +1,2813 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +/** + * + * + *
+ * Response for the `ListRuntimes` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.ListRuntimesResponse} + */ +public final class ListRuntimesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2alpha.ListRuntimesResponse) + ListRuntimesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListRuntimesResponse.newBuilder() to construct. + private ListRuntimesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListRuntimesResponse() { + runtimes_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListRuntimesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListRuntimesResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + runtimes_ = + new java.util.ArrayList< + com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime>(); + mutable_bitField0_ |= 0x00000001; + } + runtimes_.add( + input.readMessage( + com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime.parser(), + extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + runtimes_ = java.util.Collections.unmodifiableList(runtimes_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_ListRuntimesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_ListRuntimesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.ListRuntimesResponse.class, + com.google.cloud.functions.v2alpha.ListRuntimesResponse.Builder.class); + } + + /** + * + * + *
+   * The various stages that a runtime can be in.
+   * 
+ * + * Protobuf enum {@code google.cloud.functions.v2alpha.ListRuntimesResponse.RuntimeStage} + */ + public enum RuntimeStage implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not specified.
+     * 
+ * + * RUNTIME_STAGE_UNSPECIFIED = 0; + */ + RUNTIME_STAGE_UNSPECIFIED(0), + /** + * + * + *
+     * The runtime is in development.
+     * 
+ * + * DEVELOPMENT = 1; + */ + DEVELOPMENT(1), + /** + * + * + *
+     * The runtime is in the Alpha stage.
+     * 
+ * + * ALPHA = 2; + */ + ALPHA(2), + /** + * + * + *
+     * The runtime is in the Beta stage.
+     * 
+ * + * BETA = 3; + */ + BETA(3), + /** + * + * + *
+     * The runtime is generally available.
+     * 
+ * + * GA = 4; + */ + GA(4), + /** + * + * + *
+     * The runtime is deprecated.
+     * 
+ * + * DEPRECATED = 5; + */ + DEPRECATED(5), + /** + * + * + *
+     * The runtime is no longer supported.
+     * 
+ * + * DECOMMISSIONED = 6; + */ + DECOMMISSIONED(6), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not specified.
+     * 
+ * + * RUNTIME_STAGE_UNSPECIFIED = 0; + */ + public static final int RUNTIME_STAGE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The runtime is in development.
+     * 
+ * + * DEVELOPMENT = 1; + */ + public static final int DEVELOPMENT_VALUE = 1; + /** + * + * + *
+     * The runtime is in the Alpha stage.
+     * 
+ * + * ALPHA = 2; + */ + public static final int ALPHA_VALUE = 2; + /** + * + * + *
+     * The runtime is in the Beta stage.
+     * 
+ * + * BETA = 3; + */ + public static final int BETA_VALUE = 3; + /** + * + * + *
+     * The runtime is generally available.
+     * 
+ * + * GA = 4; + */ + public static final int GA_VALUE = 4; + /** + * + * + *
+     * The runtime is deprecated.
+     * 
+ * + * DEPRECATED = 5; + */ + public static final int DEPRECATED_VALUE = 5; + /** + * + * + *
+     * The runtime is no longer supported.
+     * 
+ * + * DECOMMISSIONED = 6; + */ + public static final int DECOMMISSIONED_VALUE = 6; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static RuntimeStage valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static RuntimeStage forNumber(int value) { + switch (value) { + case 0: + return RUNTIME_STAGE_UNSPECIFIED; + case 1: + return DEVELOPMENT; + case 2: + return ALPHA; + case 3: + return BETA; + case 4: + return GA; + case 5: + return DEPRECATED; + case 6: + return DECOMMISSIONED; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public RuntimeStage findValueByNumber(int number) { + return RuntimeStage.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.ListRuntimesResponse.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final RuntimeStage[] VALUES = values(); + + public static RuntimeStage valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private RuntimeStage(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.functions.v2alpha.ListRuntimesResponse.RuntimeStage) + } + + public interface RuntimeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The name of the runtime, e.g., 'go113', 'nodejs12', etc.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+     * The name of the runtime, e.g., 'go113', 'nodejs12', etc.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+     * The user facing name, eg 'Go 1.13', 'Node.js 12', etc.
+     * 
+ * + * string display_name = 5; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+     * The user facing name, eg 'Go 1.13', 'Node.js 12', etc.
+     * 
+ * + * string display_name = 5; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+     * The stage of life this runtime is in, e.g., BETA, GA, etc.
+     * 
+ * + * .google.cloud.functions.v2alpha.ListRuntimesResponse.RuntimeStage stage = 2; + * + * @return The enum numeric value on the wire for stage. + */ + int getStageValue(); + /** + * + * + *
+     * The stage of life this runtime is in, e.g., BETA, GA, etc.
+     * 
+ * + * .google.cloud.functions.v2alpha.ListRuntimesResponse.RuntimeStage stage = 2; + * + * @return The stage. + */ + com.google.cloud.functions.v2alpha.ListRuntimesResponse.RuntimeStage getStage(); + + /** + * + * + *
+     * Warning messages, e.g., a deprecation warning.
+     * 
+ * + * repeated string warnings = 3; + * + * @return A list containing the warnings. + */ + java.util.List getWarningsList(); + /** + * + * + *
+     * Warning messages, e.g., a deprecation warning.
+     * 
+ * + * repeated string warnings = 3; + * + * @return The count of warnings. + */ + int getWarningsCount(); + /** + * + * + *
+     * Warning messages, e.g., a deprecation warning.
+     * 
+ * + * repeated string warnings = 3; + * + * @param index The index of the element to return. + * @return The warnings at the given index. + */ + java.lang.String getWarnings(int index); + /** + * + * + *
+     * Warning messages, e.g., a deprecation warning.
+     * 
+ * + * repeated string warnings = 3; + * + * @param index The index of the value to return. + * @return The bytes of the warnings at the given index. + */ + com.google.protobuf.ByteString getWarningsBytes(int index); + + /** + * + * + *
+     * The environment for the runtime.
+     * 
+ * + * .google.cloud.functions.v2alpha.Environment environment = 4; + * + * @return The enum numeric value on the wire for environment. + */ + int getEnvironmentValue(); + /** + * + * + *
+     * The environment for the runtime.
+     * 
+ * + * .google.cloud.functions.v2alpha.Environment environment = 4; + * + * @return The environment. + */ + com.google.cloud.functions.v2alpha.Environment getEnvironment(); + } + /** + * + * + *
+   * Describes a runtime and any special information (e.g., deprecation status)
+   * related to it.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime} + */ + public static final class Runtime extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime) + RuntimeOrBuilder { + private static final long serialVersionUID = 0L; + // Use Runtime.newBuilder() to construct. + private Runtime(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Runtime() { + name_ = ""; + displayName_ = ""; + stage_ = 0; + warnings_ = com.google.protobuf.LazyStringArrayList.EMPTY; + environment_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Runtime(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Runtime( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 16: + { + int rawValue = input.readEnum(); + + stage_ = rawValue; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + warnings_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + warnings_.add(s); + break; + } + case 32: + { + int rawValue = input.readEnum(); + + environment_ = rawValue; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + warnings_ = warnings_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_ListRuntimesResponse_Runtime_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_ListRuntimesResponse_Runtime_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime.class, + com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+     * The name of the runtime, e.g., 'go113', 'nodejs12', etc.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+     * The name of the runtime, e.g., 'go113', 'nodejs12', etc.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 5; + private volatile java.lang.Object displayName_; + /** + * + * + *
+     * The user facing name, eg 'Go 1.13', 'Node.js 12', etc.
+     * 
+ * + * string display_name = 5; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+     * The user facing name, eg 'Go 1.13', 'Node.js 12', etc.
+     * 
+ * + * string display_name = 5; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STAGE_FIELD_NUMBER = 2; + private int stage_; + /** + * + * + *
+     * The stage of life this runtime is in, e.g., BETA, GA, etc.
+     * 
+ * + * .google.cloud.functions.v2alpha.ListRuntimesResponse.RuntimeStage stage = 2; + * + * @return The enum numeric value on the wire for stage. + */ + @java.lang.Override + public int getStageValue() { + return stage_; + } + /** + * + * + *
+     * The stage of life this runtime is in, e.g., BETA, GA, etc.
+     * 
+ * + * .google.cloud.functions.v2alpha.ListRuntimesResponse.RuntimeStage stage = 2; + * + * @return The stage. + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.ListRuntimesResponse.RuntimeStage getStage() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2alpha.ListRuntimesResponse.RuntimeStage result = + com.google.cloud.functions.v2alpha.ListRuntimesResponse.RuntimeStage.valueOf(stage_); + return result == null + ? com.google.cloud.functions.v2alpha.ListRuntimesResponse.RuntimeStage.UNRECOGNIZED + : result; + } + + public static final int WARNINGS_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList warnings_; + /** + * + * + *
+     * Warning messages, e.g., a deprecation warning.
+     * 
+ * + * repeated string warnings = 3; + * + * @return A list containing the warnings. + */ + public com.google.protobuf.ProtocolStringList getWarningsList() { + return warnings_; + } + /** + * + * + *
+     * Warning messages, e.g., a deprecation warning.
+     * 
+ * + * repeated string warnings = 3; + * + * @return The count of warnings. + */ + public int getWarningsCount() { + return warnings_.size(); + } + /** + * + * + *
+     * Warning messages, e.g., a deprecation warning.
+     * 
+ * + * repeated string warnings = 3; + * + * @param index The index of the element to return. + * @return The warnings at the given index. + */ + public java.lang.String getWarnings(int index) { + return warnings_.get(index); + } + /** + * + * + *
+     * Warning messages, e.g., a deprecation warning.
+     * 
+ * + * repeated string warnings = 3; + * + * @param index The index of the value to return. + * @return The bytes of the warnings at the given index. + */ + public com.google.protobuf.ByteString getWarningsBytes(int index) { + return warnings_.getByteString(index); + } + + public static final int ENVIRONMENT_FIELD_NUMBER = 4; + private int environment_; + /** + * + * + *
+     * The environment for the runtime.
+     * 
+ * + * .google.cloud.functions.v2alpha.Environment environment = 4; + * + * @return The enum numeric value on the wire for environment. + */ + @java.lang.Override + public int getEnvironmentValue() { + return environment_; + } + /** + * + * + *
+     * The environment for the runtime.
+     * 
+ * + * .google.cloud.functions.v2alpha.Environment environment = 4; + * + * @return The environment. + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.Environment getEnvironment() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2alpha.Environment result = + com.google.cloud.functions.v2alpha.Environment.valueOf(environment_); + return result == null ? com.google.cloud.functions.v2alpha.Environment.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (stage_ + != com.google.cloud.functions.v2alpha.ListRuntimesResponse.RuntimeStage + .RUNTIME_STAGE_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, stage_); + } + for (int i = 0; i < warnings_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, warnings_.getRaw(i)); + } + if (environment_ + != com.google.cloud.functions.v2alpha.Environment.ENVIRONMENT_UNSPECIFIED.getNumber()) { + output.writeEnum(4, environment_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, displayName_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (stage_ + != com.google.cloud.functions.v2alpha.ListRuntimesResponse.RuntimeStage + .RUNTIME_STAGE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, stage_); + } + { + int dataSize = 0; + for (int i = 0; i < warnings_.size(); i++) { + dataSize += computeStringSizeNoTag(warnings_.getRaw(i)); + } + size += dataSize; + size += 1 * getWarningsList().size(); + } + if (environment_ + != com.google.cloud.functions.v2alpha.Environment.ENVIRONMENT_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, environment_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, displayName_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime)) { + return super.equals(obj); + } + com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime other = + (com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (stage_ != other.stage_) return false; + if (!getWarningsList().equals(other.getWarningsList())) return false; + if (environment_ != other.environment_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + STAGE_FIELD_NUMBER; + hash = (53 * hash) + stage_; + if (getWarningsCount() > 0) { + hash = (37 * hash) + WARNINGS_FIELD_NUMBER; + hash = (53 * hash) + getWarningsList().hashCode(); + } + hash = (37 * hash) + ENVIRONMENT_FIELD_NUMBER; + hash = (53 * hash) + environment_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Describes a runtime and any special information (e.g., deprecation status)
+     * related to it.
+     * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime) + com.google.cloud.functions.v2alpha.ListRuntimesResponse.RuntimeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_ListRuntimesResponse_Runtime_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_ListRuntimesResponse_Runtime_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime.class, + com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime.Builder.class); + } + + // Construct using + // com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + displayName_ = ""; + + stage_ = 0; + + warnings_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + environment_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_ListRuntimesResponse_Runtime_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime + getDefaultInstanceForType() { + return com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime build() { + com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime buildPartial() { + com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime result = + new com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.displayName_ = displayName_; + result.stage_ = stage_; + if (((bitField0_ & 0x00000001) != 0)) { + warnings_ = warnings_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.warnings_ = warnings_; + result.environment_ = environment_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime) { + return mergeFrom((com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime other) { + if (other + == com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (other.stage_ != 0) { + setStageValue(other.getStageValue()); + } + if (!other.warnings_.isEmpty()) { + if (warnings_.isEmpty()) { + warnings_ = other.warnings_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureWarningsIsMutable(); + warnings_.addAll(other.warnings_); + } + onChanged(); + } + if (other.environment_ != 0) { + setEnvironmentValue(other.getEnvironmentValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+       * The name of the runtime, e.g., 'go113', 'nodejs12', etc.
+       * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The name of the runtime, e.g., 'go113', 'nodejs12', etc.
+       * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The name of the runtime, e.g., 'go113', 'nodejs12', etc.
+       * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The name of the runtime, e.g., 'go113', 'nodejs12', etc.
+       * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+       * The name of the runtime, e.g., 'go113', 'nodejs12', etc.
+       * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+       * The user facing name, eg 'Go 1.13', 'Node.js 12', etc.
+       * 
+ * + * string display_name = 5; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The user facing name, eg 'Go 1.13', 'Node.js 12', etc.
+       * 
+ * + * string display_name = 5; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The user facing name, eg 'Go 1.13', 'Node.js 12', etc.
+       * 
+ * + * string display_name = 5; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The user facing name, eg 'Go 1.13', 'Node.js 12', etc.
+       * 
+ * + * string display_name = 5; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+       * The user facing name, eg 'Go 1.13', 'Node.js 12', etc.
+       * 
+ * + * string display_name = 5; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private int stage_ = 0; + /** + * + * + *
+       * The stage of life this runtime is in, e.g., BETA, GA, etc.
+       * 
+ * + * .google.cloud.functions.v2alpha.ListRuntimesResponse.RuntimeStage stage = 2; + * + * @return The enum numeric value on the wire for stage. + */ + @java.lang.Override + public int getStageValue() { + return stage_; + } + /** + * + * + *
+       * The stage of life this runtime is in, e.g., BETA, GA, etc.
+       * 
+ * + * .google.cloud.functions.v2alpha.ListRuntimesResponse.RuntimeStage stage = 2; + * + * @param value The enum numeric value on the wire for stage to set. + * @return This builder for chaining. + */ + public Builder setStageValue(int value) { + + stage_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The stage of life this runtime is in, e.g., BETA, GA, etc.
+       * 
+ * + * .google.cloud.functions.v2alpha.ListRuntimesResponse.RuntimeStage stage = 2; + * + * @return The stage. + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.ListRuntimesResponse.RuntimeStage getStage() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2alpha.ListRuntimesResponse.RuntimeStage result = + com.google.cloud.functions.v2alpha.ListRuntimesResponse.RuntimeStage.valueOf(stage_); + return result == null + ? com.google.cloud.functions.v2alpha.ListRuntimesResponse.RuntimeStage.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * The stage of life this runtime is in, e.g., BETA, GA, etc.
+       * 
+ * + * .google.cloud.functions.v2alpha.ListRuntimesResponse.RuntimeStage stage = 2; + * + * @param value The stage to set. + * @return This builder for chaining. + */ + public Builder setStage( + com.google.cloud.functions.v2alpha.ListRuntimesResponse.RuntimeStage value) { + if (value == null) { + throw new NullPointerException(); + } + + stage_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * The stage of life this runtime is in, e.g., BETA, GA, etc.
+       * 
+ * + * .google.cloud.functions.v2alpha.ListRuntimesResponse.RuntimeStage stage = 2; + * + * @return This builder for chaining. + */ + public Builder clearStage() { + + stage_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList warnings_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureWarningsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + warnings_ = new com.google.protobuf.LazyStringArrayList(warnings_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * Warning messages, e.g., a deprecation warning.
+       * 
+ * + * repeated string warnings = 3; + * + * @return A list containing the warnings. + */ + public com.google.protobuf.ProtocolStringList getWarningsList() { + return warnings_.getUnmodifiableView(); + } + /** + * + * + *
+       * Warning messages, e.g., a deprecation warning.
+       * 
+ * + * repeated string warnings = 3; + * + * @return The count of warnings. + */ + public int getWarningsCount() { + return warnings_.size(); + } + /** + * + * + *
+       * Warning messages, e.g., a deprecation warning.
+       * 
+ * + * repeated string warnings = 3; + * + * @param index The index of the element to return. + * @return The warnings at the given index. + */ + public java.lang.String getWarnings(int index) { + return warnings_.get(index); + } + /** + * + * + *
+       * Warning messages, e.g., a deprecation warning.
+       * 
+ * + * repeated string warnings = 3; + * + * @param index The index of the value to return. + * @return The bytes of the warnings at the given index. + */ + public com.google.protobuf.ByteString getWarningsBytes(int index) { + return warnings_.getByteString(index); + } + /** + * + * + *
+       * Warning messages, e.g., a deprecation warning.
+       * 
+ * + * repeated string warnings = 3; + * + * @param index The index to set the value at. + * @param value The warnings to set. + * @return This builder for chaining. + */ + public Builder setWarnings(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureWarningsIsMutable(); + warnings_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Warning messages, e.g., a deprecation warning.
+       * 
+ * + * repeated string warnings = 3; + * + * @param value The warnings to add. + * @return This builder for chaining. + */ + public Builder addWarnings(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureWarningsIsMutable(); + warnings_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Warning messages, e.g., a deprecation warning.
+       * 
+ * + * repeated string warnings = 3; + * + * @param values The warnings to add. + * @return This builder for chaining. + */ + public Builder addAllWarnings(java.lang.Iterable values) { + ensureWarningsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, warnings_); + onChanged(); + return this; + } + /** + * + * + *
+       * Warning messages, e.g., a deprecation warning.
+       * 
+ * + * repeated string warnings = 3; + * + * @return This builder for chaining. + */ + public Builder clearWarnings() { + warnings_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * Warning messages, e.g., a deprecation warning.
+       * 
+ * + * repeated string warnings = 3; + * + * @param value The bytes of the warnings to add. + * @return This builder for chaining. + */ + public Builder addWarningsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureWarningsIsMutable(); + warnings_.add(value); + onChanged(); + return this; + } + + private int environment_ = 0; + /** + * + * + *
+       * The environment for the runtime.
+       * 
+ * + * .google.cloud.functions.v2alpha.Environment environment = 4; + * + * @return The enum numeric value on the wire for environment. + */ + @java.lang.Override + public int getEnvironmentValue() { + return environment_; + } + /** + * + * + *
+       * The environment for the runtime.
+       * 
+ * + * .google.cloud.functions.v2alpha.Environment environment = 4; + * + * @param value The enum numeric value on the wire for environment to set. + * @return This builder for chaining. + */ + public Builder setEnvironmentValue(int value) { + + environment_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The environment for the runtime.
+       * 
+ * + * .google.cloud.functions.v2alpha.Environment environment = 4; + * + * @return The environment. + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.Environment getEnvironment() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2alpha.Environment result = + com.google.cloud.functions.v2alpha.Environment.valueOf(environment_); + return result == null + ? com.google.cloud.functions.v2alpha.Environment.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * The environment for the runtime.
+       * 
+ * + * .google.cloud.functions.v2alpha.Environment environment = 4; + * + * @param value The environment to set. + * @return This builder for chaining. + */ + public Builder setEnvironment(com.google.cloud.functions.v2alpha.Environment value) { + if (value == null) { + throw new NullPointerException(); + } + + environment_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * The environment for the runtime.
+       * 
+ * + * .google.cloud.functions.v2alpha.Environment environment = 4; + * + * @return This builder for chaining. + */ + public Builder clearEnvironment() { + + environment_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime) + private static final com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime(); + } + + public static com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Runtime parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Runtime(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int RUNTIMES_FIELD_NUMBER = 1; + private java.util.List runtimes_; + /** + * + * + *
+   * The runtimes that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + @java.lang.Override + public java.util.List + getRuntimesList() { + return runtimes_; + } + /** + * + * + *
+   * The runtimes that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.functions.v2alpha.ListRuntimesResponse.RuntimeOrBuilder> + getRuntimesOrBuilderList() { + return runtimes_; + } + /** + * + * + *
+   * The runtimes that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + @java.lang.Override + public int getRuntimesCount() { + return runtimes_.size(); + } + /** + * + * + *
+   * The runtimes that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime getRuntimes(int index) { + return runtimes_.get(index); + } + /** + * + * + *
+   * The runtimes that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.ListRuntimesResponse.RuntimeOrBuilder + getRuntimesOrBuilder(int index) { + return runtimes_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < runtimes_.size(); i++) { + output.writeMessage(1, runtimes_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < runtimes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, runtimes_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2alpha.ListRuntimesResponse)) { + return super.equals(obj); + } + com.google.cloud.functions.v2alpha.ListRuntimesResponse other = + (com.google.cloud.functions.v2alpha.ListRuntimesResponse) obj; + + if (!getRuntimesList().equals(other.getRuntimesList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getRuntimesCount() > 0) { + hash = (37 * hash) + RUNTIMES_FIELD_NUMBER; + hash = (53 * hash) + getRuntimesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2alpha.ListRuntimesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.ListRuntimesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.ListRuntimesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.ListRuntimesResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.ListRuntimesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.ListRuntimesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.ListRuntimesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.ListRuntimesResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.ListRuntimesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.ListRuntimesResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.ListRuntimesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.ListRuntimesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.functions.v2alpha.ListRuntimesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response for the `ListRuntimes` method.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.ListRuntimesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2alpha.ListRuntimesResponse) + com.google.cloud.functions.v2alpha.ListRuntimesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_ListRuntimesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_ListRuntimesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.ListRuntimesResponse.class, + com.google.cloud.functions.v2alpha.ListRuntimesResponse.Builder.class); + } + + // Construct using com.google.cloud.functions.v2alpha.ListRuntimesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getRuntimesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (runtimesBuilder_ == null) { + runtimes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + runtimesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_ListRuntimesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.ListRuntimesResponse getDefaultInstanceForType() { + return com.google.cloud.functions.v2alpha.ListRuntimesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.ListRuntimesResponse build() { + com.google.cloud.functions.v2alpha.ListRuntimesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.ListRuntimesResponse buildPartial() { + com.google.cloud.functions.v2alpha.ListRuntimesResponse result = + new com.google.cloud.functions.v2alpha.ListRuntimesResponse(this); + int from_bitField0_ = bitField0_; + if (runtimesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + runtimes_ = java.util.Collections.unmodifiableList(runtimes_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.runtimes_ = runtimes_; + } else { + result.runtimes_ = runtimesBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2alpha.ListRuntimesResponse) { + return mergeFrom((com.google.cloud.functions.v2alpha.ListRuntimesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2alpha.ListRuntimesResponse other) { + if (other == com.google.cloud.functions.v2alpha.ListRuntimesResponse.getDefaultInstance()) + return this; + if (runtimesBuilder_ == null) { + if (!other.runtimes_.isEmpty()) { + if (runtimes_.isEmpty()) { + runtimes_ = other.runtimes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRuntimesIsMutable(); + runtimes_.addAll(other.runtimes_); + } + onChanged(); + } + } else { + if (!other.runtimes_.isEmpty()) { + if (runtimesBuilder_.isEmpty()) { + runtimesBuilder_.dispose(); + runtimesBuilder_ = null; + runtimes_ = other.runtimes_; + bitField0_ = (bitField0_ & ~0x00000001); + runtimesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getRuntimesFieldBuilder() + : null; + } else { + runtimesBuilder_.addAllMessages(other.runtimes_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2alpha.ListRuntimesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2alpha.ListRuntimesResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List + runtimes_ = java.util.Collections.emptyList(); + + private void ensureRuntimesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + runtimes_ = + new java.util.ArrayList< + com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime>(runtimes_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime, + com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime.Builder, + com.google.cloud.functions.v2alpha.ListRuntimesResponse.RuntimeOrBuilder> + runtimesBuilder_; + + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + public java.util.List + getRuntimesList() { + if (runtimesBuilder_ == null) { + return java.util.Collections.unmodifiableList(runtimes_); + } else { + return runtimesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + public int getRuntimesCount() { + if (runtimesBuilder_ == null) { + return runtimes_.size(); + } else { + return runtimesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + public com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime getRuntimes(int index) { + if (runtimesBuilder_ == null) { + return runtimes_.get(index); + } else { + return runtimesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + public Builder setRuntimes( + int index, com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime value) { + if (runtimesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRuntimesIsMutable(); + runtimes_.set(index, value); + onChanged(); + } else { + runtimesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + public Builder setRuntimes( + int index, + com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime.Builder builderForValue) { + if (runtimesBuilder_ == null) { + ensureRuntimesIsMutable(); + runtimes_.set(index, builderForValue.build()); + onChanged(); + } else { + runtimesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + public Builder addRuntimes( + com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime value) { + if (runtimesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRuntimesIsMutable(); + runtimes_.add(value); + onChanged(); + } else { + runtimesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + public Builder addRuntimes( + int index, com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime value) { + if (runtimesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRuntimesIsMutable(); + runtimes_.add(index, value); + onChanged(); + } else { + runtimesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + public Builder addRuntimes( + com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime.Builder builderForValue) { + if (runtimesBuilder_ == null) { + ensureRuntimesIsMutable(); + runtimes_.add(builderForValue.build()); + onChanged(); + } else { + runtimesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + public Builder addRuntimes( + int index, + com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime.Builder builderForValue) { + if (runtimesBuilder_ == null) { + ensureRuntimesIsMutable(); + runtimes_.add(index, builderForValue.build()); + onChanged(); + } else { + runtimesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + public Builder addAllRuntimes( + java.lang.Iterable< + ? extends com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime> + values) { + if (runtimesBuilder_ == null) { + ensureRuntimesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, runtimes_); + onChanged(); + } else { + runtimesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + public Builder clearRuntimes() { + if (runtimesBuilder_ == null) { + runtimes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + runtimesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + public Builder removeRuntimes(int index) { + if (runtimesBuilder_ == null) { + ensureRuntimesIsMutable(); + runtimes_.remove(index); + onChanged(); + } else { + runtimesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + public com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime.Builder + getRuntimesBuilder(int index) { + return getRuntimesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + public com.google.cloud.functions.v2alpha.ListRuntimesResponse.RuntimeOrBuilder + getRuntimesOrBuilder(int index) { + if (runtimesBuilder_ == null) { + return runtimes_.get(index); + } else { + return runtimesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + public java.util.List< + ? extends com.google.cloud.functions.v2alpha.ListRuntimesResponse.RuntimeOrBuilder> + getRuntimesOrBuilderList() { + if (runtimesBuilder_ != null) { + return runtimesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(runtimes_); + } + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + public com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime.Builder + addRuntimesBuilder() { + return getRuntimesFieldBuilder() + .addBuilder( + com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime.getDefaultInstance()); + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + public com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime.Builder + addRuntimesBuilder(int index) { + return getRuntimesFieldBuilder() + .addBuilder( + index, + com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime.getDefaultInstance()); + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + public java.util.List + getRuntimesBuilderList() { + return getRuntimesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime, + com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime.Builder, + com.google.cloud.functions.v2alpha.ListRuntimesResponse.RuntimeOrBuilder> + getRuntimesFieldBuilder() { + if (runtimesBuilder_ == null) { + runtimesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime, + com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime.Builder, + com.google.cloud.functions.v2alpha.ListRuntimesResponse.RuntimeOrBuilder>( + runtimes_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + runtimes_ = null; + } + return runtimesBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2alpha.ListRuntimesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2alpha.ListRuntimesResponse) + private static final com.google.cloud.functions.v2alpha.ListRuntimesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2alpha.ListRuntimesResponse(); + } + + public static com.google.cloud.functions.v2alpha.ListRuntimesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListRuntimesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListRuntimesResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.ListRuntimesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/ListRuntimesResponseOrBuilder.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/ListRuntimesResponseOrBuilder.java new file mode 100644 index 00000000..b1312b13 --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/ListRuntimesResponseOrBuilder.java @@ -0,0 +1,83 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +public interface ListRuntimesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2alpha.ListRuntimesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The runtimes that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + java.util.List getRuntimesList(); + /** + * + * + *
+   * The runtimes that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + com.google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime getRuntimes(int index); + /** + * + * + *
+   * The runtimes that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + int getRuntimesCount(); + /** + * + * + *
+   * The runtimes that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + java.util.List + getRuntimesOrBuilderList(); + /** + * + * + *
+   * The runtimes that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + com.google.cloud.functions.v2alpha.ListRuntimesResponse.RuntimeOrBuilder getRuntimesOrBuilder( + int index); +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/LocationName.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/LocationName.java new file mode 100644 index 00000000..f767018c --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/LocationName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v2alpha; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class LocationName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + + @Deprecated + protected LocationName() { + project = null; + location = null; + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LocationName of(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build(); + } + + public static String format(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build().toString(); + } + + public static LocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION.validatedMatch( + formattedString, "LocationName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (LocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION.instantiate("project", project, "location", location); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + LocationName that = ((LocationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for projects/{project}/locations/{location}. */ + public static class Builder { + private String project; + private String location; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder(LocationName locationName) { + this.project = locationName.project; + this.location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/OperationMetadata.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/OperationMetadata.java new file mode 100644 index 00000000..1841b404 --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/OperationMetadata.java @@ -0,0 +1,2582 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +/** + * + * + *
+ * Represents the metadata of the long-running operation.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.OperationMetadata} + */ +public final class OperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2alpha.OperationMetadata) + OperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use OperationMetadata.newBuilder() to construct. + private OperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OperationMetadata() { + target_ = ""; + verb_ = ""; + statusDetail_ = ""; + apiVersion_ = ""; + stages_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OperationMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private OperationMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (endTime_ != null) { + subBuilder = endTime_.toBuilder(); + } + endTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endTime_); + endTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + target_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + verb_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + statusDetail_ = s; + break; + } + case 48: + { + cancelRequested_ = input.readBool(); + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + + apiVersion_ = s; + break; + } + case 66: + { + com.google.protobuf.Any.Builder subBuilder = null; + if (requestResource_ != null) { + subBuilder = requestResource_.toBuilder(); + } + requestResource_ = + input.readMessage(com.google.protobuf.Any.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(requestResource_); + requestResource_ = subBuilder.buildPartial(); + } + + break; + } + case 74: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + stages_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + stages_.add( + input.readMessage( + com.google.cloud.functions.v2alpha.Stage.parser(), extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + stages_ = java.util.Collections.unmodifiableList(stages_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.OperationMetadata.class, + com.google.cloud.functions.v2alpha.OperationMetadata.Builder.class); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int END_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp endTime_; + /** + * + * + *
+   * The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endTime_ != null; + } + /** + * + * + *
+   * The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+   * The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return getEndTime(); + } + + public static final int TARGET_FIELD_NUMBER = 3; + private volatile java.lang.Object target_; + /** + * + * + *
+   * Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3; + * + * @return The target. + */ + @java.lang.Override + public java.lang.String getTarget() { + java.lang.Object ref = target_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + target_ = s; + return s; + } + } + /** + * + * + *
+   * Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3; + * + * @return The bytes for target. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERB_FIELD_NUMBER = 4; + private volatile java.lang.Object verb_; + /** + * + * + *
+   * Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4; + * + * @return The verb. + */ + @java.lang.Override + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + verb_ = s; + return s; + } + } + /** + * + * + *
+   * Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4; + * + * @return The bytes for verb. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATUS_DETAIL_FIELD_NUMBER = 5; + private volatile java.lang.Object statusDetail_; + /** + * + * + *
+   * Human-readable status of the operation, if any.
+   * 
+ * + * string status_detail = 5; + * + * @return The statusDetail. + */ + @java.lang.Override + public java.lang.String getStatusDetail() { + java.lang.Object ref = statusDetail_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + statusDetail_ = s; + return s; + } + } + /** + * + * + *
+   * Human-readable status of the operation, if any.
+   * 
+ * + * string status_detail = 5; + * + * @return The bytes for statusDetail. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStatusDetailBytes() { + java.lang.Object ref = statusDetail_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusDetail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CANCEL_REQUESTED_FIELD_NUMBER = 6; + private boolean cancelRequested_; + /** + * + * + *
+   * Identifies whether the user has requested cancellation
+   * of the operation. Operations that have successfully been cancelled
+   * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+   * corresponding to `Code.CANCELLED`.
+   * 
+ * + * bool cancel_requested = 6; + * + * @return The cancelRequested. + */ + @java.lang.Override + public boolean getCancelRequested() { + return cancelRequested_; + } + + public static final int API_VERSION_FIELD_NUMBER = 7; + private volatile java.lang.Object apiVersion_; + /** + * + * + *
+   * API version used to start the operation.
+   * 
+ * + * string api_version = 7; + * + * @return The apiVersion. + */ + @java.lang.Override + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + apiVersion_ = s; + return s; + } + } + /** + * + * + *
+   * API version used to start the operation.
+   * 
+ * + * string api_version = 7; + * + * @return The bytes for apiVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUEST_RESOURCE_FIELD_NUMBER = 8; + private com.google.protobuf.Any requestResource_; + /** + * + * + *
+   * The original request that started the operation.
+   * 
+ * + * .google.protobuf.Any request_resource = 8; + * + * @return Whether the requestResource field is set. + */ + @java.lang.Override + public boolean hasRequestResource() { + return requestResource_ != null; + } + /** + * + * + *
+   * The original request that started the operation.
+   * 
+ * + * .google.protobuf.Any request_resource = 8; + * + * @return The requestResource. + */ + @java.lang.Override + public com.google.protobuf.Any getRequestResource() { + return requestResource_ == null + ? com.google.protobuf.Any.getDefaultInstance() + : requestResource_; + } + /** + * + * + *
+   * The original request that started the operation.
+   * 
+ * + * .google.protobuf.Any request_resource = 8; + */ + @java.lang.Override + public com.google.protobuf.AnyOrBuilder getRequestResourceOrBuilder() { + return getRequestResource(); + } + + public static final int STAGES_FIELD_NUMBER = 9; + private java.util.List stages_; + /** + * + * + *
+   * Mechanism for reporting in-progress stages
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.Stage stages = 9; + */ + @java.lang.Override + public java.util.List getStagesList() { + return stages_; + } + /** + * + * + *
+   * Mechanism for reporting in-progress stages
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.Stage stages = 9; + */ + @java.lang.Override + public java.util.List + getStagesOrBuilderList() { + return stages_; + } + /** + * + * + *
+   * Mechanism for reporting in-progress stages
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.Stage stages = 9; + */ + @java.lang.Override + public int getStagesCount() { + return stages_.size(); + } + /** + * + * + *
+   * Mechanism for reporting in-progress stages
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.Stage stages = 9; + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.Stage getStages(int index) { + return stages_.get(index); + } + /** + * + * + *
+   * Mechanism for reporting in-progress stages
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.Stage stages = 9; + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.StageOrBuilder getStagesOrBuilder(int index) { + return stages_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (createTime_ != null) { + output.writeMessage(1, getCreateTime()); + } + if (endTime_ != null) { + output.writeMessage(2, getEndTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(target_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, target_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(verb_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, verb_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(statusDetail_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, statusDetail_); + } + if (cancelRequested_ != false) { + output.writeBool(6, cancelRequested_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiVersion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, apiVersion_); + } + if (requestResource_ != null) { + output.writeMessage(8, getRequestResource()); + } + for (int i = 0; i < stages_.size(); i++) { + output.writeMessage(9, stages_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCreateTime()); + } + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEndTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(target_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, target_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(verb_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, verb_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(statusDetail_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, statusDetail_); + } + if (cancelRequested_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, cancelRequested_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiVersion_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, apiVersion_); + } + if (requestResource_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getRequestResource()); + } + for (int i = 0; i < stages_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, stages_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2alpha.OperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.functions.v2alpha.OperationMetadata other = + (com.google.cloud.functions.v2alpha.OperationMetadata) obj; + + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!getTarget().equals(other.getTarget())) return false; + if (!getVerb().equals(other.getVerb())) return false; + if (!getStatusDetail().equals(other.getStatusDetail())) return false; + if (getCancelRequested() != other.getCancelRequested()) return false; + if (!getApiVersion().equals(other.getApiVersion())) return false; + if (hasRequestResource() != other.hasRequestResource()) return false; + if (hasRequestResource()) { + if (!getRequestResource().equals(other.getRequestResource())) return false; + } + if (!getStagesList().equals(other.getStagesList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (37 * hash) + TARGET_FIELD_NUMBER; + hash = (53 * hash) + getTarget().hashCode(); + hash = (37 * hash) + VERB_FIELD_NUMBER; + hash = (53 * hash) + getVerb().hashCode(); + hash = (37 * hash) + STATUS_DETAIL_FIELD_NUMBER; + hash = (53 * hash) + getStatusDetail().hashCode(); + hash = (37 * hash) + CANCEL_REQUESTED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getCancelRequested()); + hash = (37 * hash) + API_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getApiVersion().hashCode(); + if (hasRequestResource()) { + hash = (37 * hash) + REQUEST_RESOURCE_FIELD_NUMBER; + hash = (53 * hash) + getRequestResource().hashCode(); + } + if (getStagesCount() > 0) { + hash = (37 * hash) + STAGES_FIELD_NUMBER; + hash = (53 * hash) + getStagesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2alpha.OperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.OperationMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.OperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.OperationMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.OperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.OperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.OperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.OperationMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.OperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.OperationMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.OperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.OperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v2alpha.OperationMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents the metadata of the long-running operation.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.OperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2alpha.OperationMetadata) + com.google.cloud.functions.v2alpha.OperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.OperationMetadata.class, + com.google.cloud.functions.v2alpha.OperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.functions.v2alpha.OperationMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getStagesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (endTimeBuilder_ == null) { + endTime_ = null; + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + target_ = ""; + + verb_ = ""; + + statusDetail_ = ""; + + cancelRequested_ = false; + + apiVersion_ = ""; + + if (requestResourceBuilder_ == null) { + requestResource_ = null; + } else { + requestResource_ = null; + requestResourceBuilder_ = null; + } + if (stagesBuilder_ == null) { + stages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + stagesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_OperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.OperationMetadata getDefaultInstanceForType() { + return com.google.cloud.functions.v2alpha.OperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.OperationMetadata build() { + com.google.cloud.functions.v2alpha.OperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.OperationMetadata buildPartial() { + com.google.cloud.functions.v2alpha.OperationMetadata result = + new com.google.cloud.functions.v2alpha.OperationMetadata(this); + int from_bitField0_ = bitField0_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (endTimeBuilder_ == null) { + result.endTime_ = endTime_; + } else { + result.endTime_ = endTimeBuilder_.build(); + } + result.target_ = target_; + result.verb_ = verb_; + result.statusDetail_ = statusDetail_; + result.cancelRequested_ = cancelRequested_; + result.apiVersion_ = apiVersion_; + if (requestResourceBuilder_ == null) { + result.requestResource_ = requestResource_; + } else { + result.requestResource_ = requestResourceBuilder_.build(); + } + if (stagesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + stages_ = java.util.Collections.unmodifiableList(stages_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.stages_ = stages_; + } else { + result.stages_ = stagesBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2alpha.OperationMetadata) { + return mergeFrom((com.google.cloud.functions.v2alpha.OperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2alpha.OperationMetadata other) { + if (other == com.google.cloud.functions.v2alpha.OperationMetadata.getDefaultInstance()) + return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (!other.getTarget().isEmpty()) { + target_ = other.target_; + onChanged(); + } + if (!other.getVerb().isEmpty()) { + verb_ = other.verb_; + onChanged(); + } + if (!other.getStatusDetail().isEmpty()) { + statusDetail_ = other.statusDetail_; + onChanged(); + } + if (other.getCancelRequested() != false) { + setCancelRequested(other.getCancelRequested()); + } + if (!other.getApiVersion().isEmpty()) { + apiVersion_ = other.apiVersion_; + onChanged(); + } + if (other.hasRequestResource()) { + mergeRequestResource(other.getRequestResource()); + } + if (stagesBuilder_ == null) { + if (!other.stages_.isEmpty()) { + if (stages_.isEmpty()) { + stages_ = other.stages_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureStagesIsMutable(); + stages_.addAll(other.stages_); + } + onChanged(); + } + } else { + if (!other.stages_.isEmpty()) { + if (stagesBuilder_.isEmpty()) { + stagesBuilder_.dispose(); + stagesBuilder_ = null; + stages_ = other.stages_; + bitField0_ = (bitField0_ & ~0x00000001); + stagesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getStagesFieldBuilder() + : null; + } else { + stagesBuilder_.addAllMessages(other.stages_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2alpha.OperationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2alpha.OperationMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return endTimeBuilder_ != null || endTime_ != null; + } + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + onChanged(); + } else { + endTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + onChanged(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (endTime_ != null) { + endTime_ = + com.google.protobuf.Timestamp.newBuilder(endTime_).mergeFrom(value).buildPartial(); + } else { + endTime_ = value; + } + onChanged(); + } else { + endTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder clearEndTime() { + if (endTimeBuilder_ == null) { + endTime_ = null; + onChanged(); + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private java.lang.Object target_ = ""; + /** + * + * + *
+     * Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3; + * + * @return The target. + */ + public java.lang.String getTarget() { + java.lang.Object ref = target_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + target_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3; + * + * @return The bytes for target. + */ + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3; + * + * @param value The target to set. + * @return This builder for chaining. + */ + public Builder setTarget(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + target_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3; + * + * @return This builder for chaining. + */ + public Builder clearTarget() { + + target_ = getDefaultInstance().getTarget(); + onChanged(); + return this; + } + /** + * + * + *
+     * Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3; + * + * @param value The bytes for target to set. + * @return This builder for chaining. + */ + public Builder setTargetBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + target_ = value; + onChanged(); + return this; + } + + private java.lang.Object verb_ = ""; + /** + * + * + *
+     * Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4; + * + * @return The verb. + */ + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + verb_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4; + * + * @return The bytes for verb. + */ + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4; + * + * @param value The verb to set. + * @return This builder for chaining. + */ + public Builder setVerb(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + verb_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4; + * + * @return This builder for chaining. + */ + public Builder clearVerb() { + + verb_ = getDefaultInstance().getVerb(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4; + * + * @param value The bytes for verb to set. + * @return This builder for chaining. + */ + public Builder setVerbBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + verb_ = value; + onChanged(); + return this; + } + + private java.lang.Object statusDetail_ = ""; + /** + * + * + *
+     * Human-readable status of the operation, if any.
+     * 
+ * + * string status_detail = 5; + * + * @return The statusDetail. + */ + public java.lang.String getStatusDetail() { + java.lang.Object ref = statusDetail_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + statusDetail_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Human-readable status of the operation, if any.
+     * 
+ * + * string status_detail = 5; + * + * @return The bytes for statusDetail. + */ + public com.google.protobuf.ByteString getStatusDetailBytes() { + java.lang.Object ref = statusDetail_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusDetail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Human-readable status of the operation, if any.
+     * 
+ * + * string status_detail = 5; + * + * @param value The statusDetail to set. + * @return This builder for chaining. + */ + public Builder setStatusDetail(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + statusDetail_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Human-readable status of the operation, if any.
+     * 
+ * + * string status_detail = 5; + * + * @return This builder for chaining. + */ + public Builder clearStatusDetail() { + + statusDetail_ = getDefaultInstance().getStatusDetail(); + onChanged(); + return this; + } + /** + * + * + *
+     * Human-readable status of the operation, if any.
+     * 
+ * + * string status_detail = 5; + * + * @param value The bytes for statusDetail to set. + * @return This builder for chaining. + */ + public Builder setStatusDetailBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + statusDetail_ = value; + onChanged(); + return this; + } + + private boolean cancelRequested_; + /** + * + * + *
+     * Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+     * corresponding to `Code.CANCELLED`.
+     * 
+ * + * bool cancel_requested = 6; + * + * @return The cancelRequested. + */ + @java.lang.Override + public boolean getCancelRequested() { + return cancelRequested_; + } + /** + * + * + *
+     * Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+     * corresponding to `Code.CANCELLED`.
+     * 
+ * + * bool cancel_requested = 6; + * + * @param value The cancelRequested to set. + * @return This builder for chaining. + */ + public Builder setCancelRequested(boolean value) { + + cancelRequested_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+     * corresponding to `Code.CANCELLED`.
+     * 
+ * + * bool cancel_requested = 6; + * + * @return This builder for chaining. + */ + public Builder clearCancelRequested() { + + cancelRequested_ = false; + onChanged(); + return this; + } + + private java.lang.Object apiVersion_ = ""; + /** + * + * + *
+     * API version used to start the operation.
+     * 
+ * + * string api_version = 7; + * + * @return The apiVersion. + */ + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + apiVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * API version used to start the operation.
+     * 
+ * + * string api_version = 7; + * + * @return The bytes for apiVersion. + */ + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * API version used to start the operation.
+     * 
+ * + * string api_version = 7; + * + * @param value The apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + apiVersion_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * API version used to start the operation.
+     * 
+ * + * string api_version = 7; + * + * @return This builder for chaining. + */ + public Builder clearApiVersion() { + + apiVersion_ = getDefaultInstance().getApiVersion(); + onChanged(); + return this; + } + /** + * + * + *
+     * API version used to start the operation.
+     * 
+ * + * string api_version = 7; + * + * @param value The bytes for apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + apiVersion_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Any requestResource_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + requestResourceBuilder_; + /** + * + * + *
+     * The original request that started the operation.
+     * 
+ * + * .google.protobuf.Any request_resource = 8; + * + * @return Whether the requestResource field is set. + */ + public boolean hasRequestResource() { + return requestResourceBuilder_ != null || requestResource_ != null; + } + /** + * + * + *
+     * The original request that started the operation.
+     * 
+ * + * .google.protobuf.Any request_resource = 8; + * + * @return The requestResource. + */ + public com.google.protobuf.Any getRequestResource() { + if (requestResourceBuilder_ == null) { + return requestResource_ == null + ? com.google.protobuf.Any.getDefaultInstance() + : requestResource_; + } else { + return requestResourceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The original request that started the operation.
+     * 
+ * + * .google.protobuf.Any request_resource = 8; + */ + public Builder setRequestResource(com.google.protobuf.Any value) { + if (requestResourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requestResource_ = value; + onChanged(); + } else { + requestResourceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The original request that started the operation.
+     * 
+ * + * .google.protobuf.Any request_resource = 8; + */ + public Builder setRequestResource(com.google.protobuf.Any.Builder builderForValue) { + if (requestResourceBuilder_ == null) { + requestResource_ = builderForValue.build(); + onChanged(); + } else { + requestResourceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The original request that started the operation.
+     * 
+ * + * .google.protobuf.Any request_resource = 8; + */ + public Builder mergeRequestResource(com.google.protobuf.Any value) { + if (requestResourceBuilder_ == null) { + if (requestResource_ != null) { + requestResource_ = + com.google.protobuf.Any.newBuilder(requestResource_).mergeFrom(value).buildPartial(); + } else { + requestResource_ = value; + } + onChanged(); + } else { + requestResourceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The original request that started the operation.
+     * 
+ * + * .google.protobuf.Any request_resource = 8; + */ + public Builder clearRequestResource() { + if (requestResourceBuilder_ == null) { + requestResource_ = null; + onChanged(); + } else { + requestResource_ = null; + requestResourceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The original request that started the operation.
+     * 
+ * + * .google.protobuf.Any request_resource = 8; + */ + public com.google.protobuf.Any.Builder getRequestResourceBuilder() { + + onChanged(); + return getRequestResourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The original request that started the operation.
+     * 
+ * + * .google.protobuf.Any request_resource = 8; + */ + public com.google.protobuf.AnyOrBuilder getRequestResourceOrBuilder() { + if (requestResourceBuilder_ != null) { + return requestResourceBuilder_.getMessageOrBuilder(); + } else { + return requestResource_ == null + ? com.google.protobuf.Any.getDefaultInstance() + : requestResource_; + } + } + /** + * + * + *
+     * The original request that started the operation.
+     * 
+ * + * .google.protobuf.Any request_resource = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + getRequestResourceFieldBuilder() { + if (requestResourceBuilder_ == null) { + requestResourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder>( + getRequestResource(), getParentForChildren(), isClean()); + requestResource_ = null; + } + return requestResourceBuilder_; + } + + private java.util.List stages_ = + java.util.Collections.emptyList(); + + private void ensureStagesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + stages_ = new java.util.ArrayList(stages_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2alpha.Stage, + com.google.cloud.functions.v2alpha.Stage.Builder, + com.google.cloud.functions.v2alpha.StageOrBuilder> + stagesBuilder_; + + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.Stage stages = 9; + */ + public java.util.List getStagesList() { + if (stagesBuilder_ == null) { + return java.util.Collections.unmodifiableList(stages_); + } else { + return stagesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.Stage stages = 9; + */ + public int getStagesCount() { + if (stagesBuilder_ == null) { + return stages_.size(); + } else { + return stagesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.Stage stages = 9; + */ + public com.google.cloud.functions.v2alpha.Stage getStages(int index) { + if (stagesBuilder_ == null) { + return stages_.get(index); + } else { + return stagesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.Stage stages = 9; + */ + public Builder setStages(int index, com.google.cloud.functions.v2alpha.Stage value) { + if (stagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStagesIsMutable(); + stages_.set(index, value); + onChanged(); + } else { + stagesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.Stage stages = 9; + */ + public Builder setStages( + int index, com.google.cloud.functions.v2alpha.Stage.Builder builderForValue) { + if (stagesBuilder_ == null) { + ensureStagesIsMutable(); + stages_.set(index, builderForValue.build()); + onChanged(); + } else { + stagesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.Stage stages = 9; + */ + public Builder addStages(com.google.cloud.functions.v2alpha.Stage value) { + if (stagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStagesIsMutable(); + stages_.add(value); + onChanged(); + } else { + stagesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.Stage stages = 9; + */ + public Builder addStages(int index, com.google.cloud.functions.v2alpha.Stage value) { + if (stagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStagesIsMutable(); + stages_.add(index, value); + onChanged(); + } else { + stagesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.Stage stages = 9; + */ + public Builder addStages(com.google.cloud.functions.v2alpha.Stage.Builder builderForValue) { + if (stagesBuilder_ == null) { + ensureStagesIsMutable(); + stages_.add(builderForValue.build()); + onChanged(); + } else { + stagesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.Stage stages = 9; + */ + public Builder addStages( + int index, com.google.cloud.functions.v2alpha.Stage.Builder builderForValue) { + if (stagesBuilder_ == null) { + ensureStagesIsMutable(); + stages_.add(index, builderForValue.build()); + onChanged(); + } else { + stagesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.Stage stages = 9; + */ + public Builder addAllStages( + java.lang.Iterable values) { + if (stagesBuilder_ == null) { + ensureStagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, stages_); + onChanged(); + } else { + stagesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.Stage stages = 9; + */ + public Builder clearStages() { + if (stagesBuilder_ == null) { + stages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + stagesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.Stage stages = 9; + */ + public Builder removeStages(int index) { + if (stagesBuilder_ == null) { + ensureStagesIsMutable(); + stages_.remove(index); + onChanged(); + } else { + stagesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.Stage stages = 9; + */ + public com.google.cloud.functions.v2alpha.Stage.Builder getStagesBuilder(int index) { + return getStagesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.Stage stages = 9; + */ + public com.google.cloud.functions.v2alpha.StageOrBuilder getStagesOrBuilder(int index) { + if (stagesBuilder_ == null) { + return stages_.get(index); + } else { + return stagesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.Stage stages = 9; + */ + public java.util.List + getStagesOrBuilderList() { + if (stagesBuilder_ != null) { + return stagesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(stages_); + } + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.Stage stages = 9; + */ + public com.google.cloud.functions.v2alpha.Stage.Builder addStagesBuilder() { + return getStagesFieldBuilder() + .addBuilder(com.google.cloud.functions.v2alpha.Stage.getDefaultInstance()); + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.Stage stages = 9; + */ + public com.google.cloud.functions.v2alpha.Stage.Builder addStagesBuilder(int index) { + return getStagesFieldBuilder() + .addBuilder(index, com.google.cloud.functions.v2alpha.Stage.getDefaultInstance()); + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.Stage stages = 9; + */ + public java.util.List getStagesBuilderList() { + return getStagesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2alpha.Stage, + com.google.cloud.functions.v2alpha.Stage.Builder, + com.google.cloud.functions.v2alpha.StageOrBuilder> + getStagesFieldBuilder() { + if (stagesBuilder_ == null) { + stagesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2alpha.Stage, + com.google.cloud.functions.v2alpha.Stage.Builder, + com.google.cloud.functions.v2alpha.StageOrBuilder>( + stages_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + stages_ = null; + } + return stagesBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2alpha.OperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2alpha.OperationMetadata) + private static final com.google.cloud.functions.v2alpha.OperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2alpha.OperationMetadata(); + } + + public static com.google.cloud.functions.v2alpha.OperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new OperationMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.OperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/OperationMetadataOrBuilder.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/OperationMetadataOrBuilder.java new file mode 100644 index 00000000..20c25953 --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/OperationMetadataOrBuilder.java @@ -0,0 +1,298 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +public interface OperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2alpha.OperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + * + * + *
+   * The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+   * The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3; + * + * @return The target. + */ + java.lang.String getTarget(); + /** + * + * + *
+   * Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3; + * + * @return The bytes for target. + */ + com.google.protobuf.ByteString getTargetBytes(); + + /** + * + * + *
+   * Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4; + * + * @return The verb. + */ + java.lang.String getVerb(); + /** + * + * + *
+   * Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4; + * + * @return The bytes for verb. + */ + com.google.protobuf.ByteString getVerbBytes(); + + /** + * + * + *
+   * Human-readable status of the operation, if any.
+   * 
+ * + * string status_detail = 5; + * + * @return The statusDetail. + */ + java.lang.String getStatusDetail(); + /** + * + * + *
+   * Human-readable status of the operation, if any.
+   * 
+ * + * string status_detail = 5; + * + * @return The bytes for statusDetail. + */ + com.google.protobuf.ByteString getStatusDetailBytes(); + + /** + * + * + *
+   * Identifies whether the user has requested cancellation
+   * of the operation. Operations that have successfully been cancelled
+   * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+   * corresponding to `Code.CANCELLED`.
+   * 
+ * + * bool cancel_requested = 6; + * + * @return The cancelRequested. + */ + boolean getCancelRequested(); + + /** + * + * + *
+   * API version used to start the operation.
+   * 
+ * + * string api_version = 7; + * + * @return The apiVersion. + */ + java.lang.String getApiVersion(); + /** + * + * + *
+   * API version used to start the operation.
+   * 
+ * + * string api_version = 7; + * + * @return The bytes for apiVersion. + */ + com.google.protobuf.ByteString getApiVersionBytes(); + + /** + * + * + *
+   * The original request that started the operation.
+   * 
+ * + * .google.protobuf.Any request_resource = 8; + * + * @return Whether the requestResource field is set. + */ + boolean hasRequestResource(); + /** + * + * + *
+   * The original request that started the operation.
+   * 
+ * + * .google.protobuf.Any request_resource = 8; + * + * @return The requestResource. + */ + com.google.protobuf.Any getRequestResource(); + /** + * + * + *
+   * The original request that started the operation.
+   * 
+ * + * .google.protobuf.Any request_resource = 8; + */ + com.google.protobuf.AnyOrBuilder getRequestResourceOrBuilder(); + + /** + * + * + *
+   * Mechanism for reporting in-progress stages
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.Stage stages = 9; + */ + java.util.List getStagesList(); + /** + * + * + *
+   * Mechanism for reporting in-progress stages
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.Stage stages = 9; + */ + com.google.cloud.functions.v2alpha.Stage getStages(int index); + /** + * + * + *
+   * Mechanism for reporting in-progress stages
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.Stage stages = 9; + */ + int getStagesCount(); + /** + * + * + *
+   * Mechanism for reporting in-progress stages
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.Stage stages = 9; + */ + java.util.List + getStagesOrBuilderList(); + /** + * + * + *
+   * Mechanism for reporting in-progress stages
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.Stage stages = 9; + */ + com.google.cloud.functions.v2alpha.StageOrBuilder getStagesOrBuilder(int index); +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/RepoSource.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/RepoSource.java new file mode 100644 index 00000000..aa51dcaa --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/RepoSource.java @@ -0,0 +1,1936 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +/** + * + * + *
+ * Location of the source in a Google Cloud Source Repository.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.RepoSource} + */ +public final class RepoSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2alpha.RepoSource) + RepoSourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use RepoSource.newBuilder() to construct. + private RepoSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RepoSource() { + projectId_ = ""; + repoName_ = ""; + dir_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RepoSource(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RepoSource( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + projectId_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + repoName_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + revisionCase_ = 3; + revision_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + revisionCase_ = 4; + revision_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + revisionCase_ = 5; + revision_ = s; + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + dir_ = s; + break; + } + case 56: + { + invertRegex_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_RepoSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_RepoSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.RepoSource.class, + com.google.cloud.functions.v2alpha.RepoSource.Builder.class); + } + + private int revisionCase_ = 0; + private java.lang.Object revision_; + + public enum RevisionCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + BRANCH_NAME(3), + TAG_NAME(4), + COMMIT_SHA(5), + REVISION_NOT_SET(0); + private final int value; + + private RevisionCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static RevisionCase valueOf(int value) { + return forNumber(value); + } + + public static RevisionCase forNumber(int value) { + switch (value) { + case 3: + return BRANCH_NAME; + case 4: + return TAG_NAME; + case 5: + return COMMIT_SHA; + case 0: + return REVISION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public RevisionCase getRevisionCase() { + return RevisionCase.forNumber(revisionCase_); + } + + public static final int BRANCH_NAME_FIELD_NUMBER = 3; + /** + * + * + *
+   * Regex matching branches to build.
+   * The syntax of the regular expressions accepted is the syntax accepted by
+   * RE2 and described at https://github.com/google/re2/wiki/Syntax
+   * 
+ * + * string branch_name = 3; + * + * @return Whether the branchName field is set. + */ + public boolean hasBranchName() { + return revisionCase_ == 3; + } + /** + * + * + *
+   * Regex matching branches to build.
+   * The syntax of the regular expressions accepted is the syntax accepted by
+   * RE2 and described at https://github.com/google/re2/wiki/Syntax
+   * 
+ * + * string branch_name = 3; + * + * @return The branchName. + */ + public java.lang.String getBranchName() { + java.lang.Object ref = ""; + if (revisionCase_ == 3) { + ref = revision_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (revisionCase_ == 3) { + revision_ = s; + } + return s; + } + } + /** + * + * + *
+   * Regex matching branches to build.
+   * The syntax of the regular expressions accepted is the syntax accepted by
+   * RE2 and described at https://github.com/google/re2/wiki/Syntax
+   * 
+ * + * string branch_name = 3; + * + * @return The bytes for branchName. + */ + public com.google.protobuf.ByteString getBranchNameBytes() { + java.lang.Object ref = ""; + if (revisionCase_ == 3) { + ref = revision_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (revisionCase_ == 3) { + revision_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TAG_NAME_FIELD_NUMBER = 4; + /** + * + * + *
+   * Regex matching tags to build.
+   * The syntax of the regular expressions accepted is the syntax accepted by
+   * RE2 and described at https://github.com/google/re2/wiki/Syntax
+   * 
+ * + * string tag_name = 4; + * + * @return Whether the tagName field is set. + */ + public boolean hasTagName() { + return revisionCase_ == 4; + } + /** + * + * + *
+   * Regex matching tags to build.
+   * The syntax of the regular expressions accepted is the syntax accepted by
+   * RE2 and described at https://github.com/google/re2/wiki/Syntax
+   * 
+ * + * string tag_name = 4; + * + * @return The tagName. + */ + public java.lang.String getTagName() { + java.lang.Object ref = ""; + if (revisionCase_ == 4) { + ref = revision_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (revisionCase_ == 4) { + revision_ = s; + } + return s; + } + } + /** + * + * + *
+   * Regex matching tags to build.
+   * The syntax of the regular expressions accepted is the syntax accepted by
+   * RE2 and described at https://github.com/google/re2/wiki/Syntax
+   * 
+ * + * string tag_name = 4; + * + * @return The bytes for tagName. + */ + public com.google.protobuf.ByteString getTagNameBytes() { + java.lang.Object ref = ""; + if (revisionCase_ == 4) { + ref = revision_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (revisionCase_ == 4) { + revision_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int COMMIT_SHA_FIELD_NUMBER = 5; + /** + * + * + *
+   * Explicit commit SHA to build.
+   * 
+ * + * string commit_sha = 5; + * + * @return Whether the commitSha field is set. + */ + public boolean hasCommitSha() { + return revisionCase_ == 5; + } + /** + * + * + *
+   * Explicit commit SHA to build.
+   * 
+ * + * string commit_sha = 5; + * + * @return The commitSha. + */ + public java.lang.String getCommitSha() { + java.lang.Object ref = ""; + if (revisionCase_ == 5) { + ref = revision_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (revisionCase_ == 5) { + revision_ = s; + } + return s; + } + } + /** + * + * + *
+   * Explicit commit SHA to build.
+   * 
+ * + * string commit_sha = 5; + * + * @return The bytes for commitSha. + */ + public com.google.protobuf.ByteString getCommitShaBytes() { + java.lang.Object ref = ""; + if (revisionCase_ == 5) { + ref = revision_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (revisionCase_ == 5) { + revision_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object projectId_; + /** + * + * + *
+   * ID of the project that owns the Cloud Source Repository. If omitted, the
+   * project ID requesting the build is assumed.
+   * 
+ * + * string project_id = 1; + * + * @return The projectId. + */ + @java.lang.Override + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + projectId_ = s; + return s; + } + } + /** + * + * + *
+   * ID of the project that owns the Cloud Source Repository. If omitted, the
+   * project ID requesting the build is assumed.
+   * 
+ * + * string project_id = 1; + * + * @return The bytes for projectId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REPO_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object repoName_; + /** + * + * + *
+   * Name of the Cloud Source Repository.
+   * 
+ * + * string repo_name = 2; + * + * @return The repoName. + */ + @java.lang.Override + public java.lang.String getRepoName() { + java.lang.Object ref = repoName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + repoName_ = s; + return s; + } + } + /** + * + * + *
+   * Name of the Cloud Source Repository.
+   * 
+ * + * string repo_name = 2; + * + * @return The bytes for repoName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRepoNameBytes() { + java.lang.Object ref = repoName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + repoName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DIR_FIELD_NUMBER = 6; + private volatile java.lang.Object dir_; + /** + * + * + *
+   * Directory, relative to the source root, in which to run the build.
+   * This must be a relative path. If a step's `dir` is specified and is an
+   * absolute path, this value is ignored for that step's execution.
+   * eg. helloworld (no leading slash allowed)
+   * 
+ * + * string dir = 6; + * + * @return The dir. + */ + @java.lang.Override + public java.lang.String getDir() { + java.lang.Object ref = dir_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dir_ = s; + return s; + } + } + /** + * + * + *
+   * Directory, relative to the source root, in which to run the build.
+   * This must be a relative path. If a step's `dir` is specified and is an
+   * absolute path, this value is ignored for that step's execution.
+   * eg. helloworld (no leading slash allowed)
+   * 
+ * + * string dir = 6; + * + * @return The bytes for dir. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDirBytes() { + java.lang.Object ref = dir_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dir_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INVERT_REGEX_FIELD_NUMBER = 7; + private boolean invertRegex_; + /** + * + * + *
+   * Only trigger a build if the revision regex does NOT match the revision
+   * regex.
+   * 
+ * + * bool invert_regex = 7; + * + * @return The invertRegex. + */ + @java.lang.Override + public boolean getInvertRegex() { + return invertRegex_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, projectId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(repoName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, repoName_); + } + if (revisionCase_ == 3) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, revision_); + } + if (revisionCase_ == 4) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, revision_); + } + if (revisionCase_ == 5) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, revision_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dir_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, dir_); + } + if (invertRegex_ != false) { + output.writeBool(7, invertRegex_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, projectId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(repoName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, repoName_); + } + if (revisionCase_ == 3) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, revision_); + } + if (revisionCase_ == 4) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, revision_); + } + if (revisionCase_ == 5) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, revision_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dir_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, dir_); + } + if (invertRegex_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(7, invertRegex_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2alpha.RepoSource)) { + return super.equals(obj); + } + com.google.cloud.functions.v2alpha.RepoSource other = + (com.google.cloud.functions.v2alpha.RepoSource) obj; + + if (!getProjectId().equals(other.getProjectId())) return false; + if (!getRepoName().equals(other.getRepoName())) return false; + if (!getDir().equals(other.getDir())) return false; + if (getInvertRegex() != other.getInvertRegex()) return false; + if (!getRevisionCase().equals(other.getRevisionCase())) return false; + switch (revisionCase_) { + case 3: + if (!getBranchName().equals(other.getBranchName())) return false; + break; + case 4: + if (!getTagName().equals(other.getTagName())) return false; + break; + case 5: + if (!getCommitSha().equals(other.getCommitSha())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PROJECT_ID_FIELD_NUMBER; + hash = (53 * hash) + getProjectId().hashCode(); + hash = (37 * hash) + REPO_NAME_FIELD_NUMBER; + hash = (53 * hash) + getRepoName().hashCode(); + hash = (37 * hash) + DIR_FIELD_NUMBER; + hash = (53 * hash) + getDir().hashCode(); + hash = (37 * hash) + INVERT_REGEX_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getInvertRegex()); + switch (revisionCase_) { + case 3: + hash = (37 * hash) + BRANCH_NAME_FIELD_NUMBER; + hash = (53 * hash) + getBranchName().hashCode(); + break; + case 4: + hash = (37 * hash) + TAG_NAME_FIELD_NUMBER; + hash = (53 * hash) + getTagName().hashCode(); + break; + case 5: + hash = (37 * hash) + COMMIT_SHA_FIELD_NUMBER; + hash = (53 * hash) + getCommitSha().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2alpha.RepoSource parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.RepoSource parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.RepoSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.RepoSource parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.RepoSource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.RepoSource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.RepoSource parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.RepoSource parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.RepoSource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.RepoSource parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.RepoSource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.RepoSource parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v2alpha.RepoSource prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Location of the source in a Google Cloud Source Repository.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.RepoSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2alpha.RepoSource) + com.google.cloud.functions.v2alpha.RepoSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_RepoSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_RepoSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.RepoSource.class, + com.google.cloud.functions.v2alpha.RepoSource.Builder.class); + } + + // Construct using com.google.cloud.functions.v2alpha.RepoSource.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + projectId_ = ""; + + repoName_ = ""; + + dir_ = ""; + + invertRegex_ = false; + + revisionCase_ = 0; + revision_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_RepoSource_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.RepoSource getDefaultInstanceForType() { + return com.google.cloud.functions.v2alpha.RepoSource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.RepoSource build() { + com.google.cloud.functions.v2alpha.RepoSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.RepoSource buildPartial() { + com.google.cloud.functions.v2alpha.RepoSource result = + new com.google.cloud.functions.v2alpha.RepoSource(this); + if (revisionCase_ == 3) { + result.revision_ = revision_; + } + if (revisionCase_ == 4) { + result.revision_ = revision_; + } + if (revisionCase_ == 5) { + result.revision_ = revision_; + } + result.projectId_ = projectId_; + result.repoName_ = repoName_; + result.dir_ = dir_; + result.invertRegex_ = invertRegex_; + result.revisionCase_ = revisionCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2alpha.RepoSource) { + return mergeFrom((com.google.cloud.functions.v2alpha.RepoSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2alpha.RepoSource other) { + if (other == com.google.cloud.functions.v2alpha.RepoSource.getDefaultInstance()) return this; + if (!other.getProjectId().isEmpty()) { + projectId_ = other.projectId_; + onChanged(); + } + if (!other.getRepoName().isEmpty()) { + repoName_ = other.repoName_; + onChanged(); + } + if (!other.getDir().isEmpty()) { + dir_ = other.dir_; + onChanged(); + } + if (other.getInvertRegex() != false) { + setInvertRegex(other.getInvertRegex()); + } + switch (other.getRevisionCase()) { + case BRANCH_NAME: + { + revisionCase_ = 3; + revision_ = other.revision_; + onChanged(); + break; + } + case TAG_NAME: + { + revisionCase_ = 4; + revision_ = other.revision_; + onChanged(); + break; + } + case COMMIT_SHA: + { + revisionCase_ = 5; + revision_ = other.revision_; + onChanged(); + break; + } + case REVISION_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2alpha.RepoSource parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v2alpha.RepoSource) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int revisionCase_ = 0; + private java.lang.Object revision_; + + public RevisionCase getRevisionCase() { + return RevisionCase.forNumber(revisionCase_); + } + + public Builder clearRevision() { + revisionCase_ = 0; + revision_ = null; + onChanged(); + return this; + } + + /** + * + * + *
+     * Regex matching branches to build.
+     * The syntax of the regular expressions accepted is the syntax accepted by
+     * RE2 and described at https://github.com/google/re2/wiki/Syntax
+     * 
+ * + * string branch_name = 3; + * + * @return Whether the branchName field is set. + */ + @java.lang.Override + public boolean hasBranchName() { + return revisionCase_ == 3; + } + /** + * + * + *
+     * Regex matching branches to build.
+     * The syntax of the regular expressions accepted is the syntax accepted by
+     * RE2 and described at https://github.com/google/re2/wiki/Syntax
+     * 
+ * + * string branch_name = 3; + * + * @return The branchName. + */ + @java.lang.Override + public java.lang.String getBranchName() { + java.lang.Object ref = ""; + if (revisionCase_ == 3) { + ref = revision_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (revisionCase_ == 3) { + revision_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Regex matching branches to build.
+     * The syntax of the regular expressions accepted is the syntax accepted by
+     * RE2 and described at https://github.com/google/re2/wiki/Syntax
+     * 
+ * + * string branch_name = 3; + * + * @return The bytes for branchName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBranchNameBytes() { + java.lang.Object ref = ""; + if (revisionCase_ == 3) { + ref = revision_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (revisionCase_ == 3) { + revision_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Regex matching branches to build.
+     * The syntax of the regular expressions accepted is the syntax accepted by
+     * RE2 and described at https://github.com/google/re2/wiki/Syntax
+     * 
+ * + * string branch_name = 3; + * + * @param value The branchName to set. + * @return This builder for chaining. + */ + public Builder setBranchName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + revisionCase_ = 3; + revision_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Regex matching branches to build.
+     * The syntax of the regular expressions accepted is the syntax accepted by
+     * RE2 and described at https://github.com/google/re2/wiki/Syntax
+     * 
+ * + * string branch_name = 3; + * + * @return This builder for chaining. + */ + public Builder clearBranchName() { + if (revisionCase_ == 3) { + revisionCase_ = 0; + revision_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Regex matching branches to build.
+     * The syntax of the regular expressions accepted is the syntax accepted by
+     * RE2 and described at https://github.com/google/re2/wiki/Syntax
+     * 
+ * + * string branch_name = 3; + * + * @param value The bytes for branchName to set. + * @return This builder for chaining. + */ + public Builder setBranchNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + revisionCase_ = 3; + revision_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Regex matching tags to build.
+     * The syntax of the regular expressions accepted is the syntax accepted by
+     * RE2 and described at https://github.com/google/re2/wiki/Syntax
+     * 
+ * + * string tag_name = 4; + * + * @return Whether the tagName field is set. + */ + @java.lang.Override + public boolean hasTagName() { + return revisionCase_ == 4; + } + /** + * + * + *
+     * Regex matching tags to build.
+     * The syntax of the regular expressions accepted is the syntax accepted by
+     * RE2 and described at https://github.com/google/re2/wiki/Syntax
+     * 
+ * + * string tag_name = 4; + * + * @return The tagName. + */ + @java.lang.Override + public java.lang.String getTagName() { + java.lang.Object ref = ""; + if (revisionCase_ == 4) { + ref = revision_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (revisionCase_ == 4) { + revision_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Regex matching tags to build.
+     * The syntax of the regular expressions accepted is the syntax accepted by
+     * RE2 and described at https://github.com/google/re2/wiki/Syntax
+     * 
+ * + * string tag_name = 4; + * + * @return The bytes for tagName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTagNameBytes() { + java.lang.Object ref = ""; + if (revisionCase_ == 4) { + ref = revision_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (revisionCase_ == 4) { + revision_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Regex matching tags to build.
+     * The syntax of the regular expressions accepted is the syntax accepted by
+     * RE2 and described at https://github.com/google/re2/wiki/Syntax
+     * 
+ * + * string tag_name = 4; + * + * @param value The tagName to set. + * @return This builder for chaining. + */ + public Builder setTagName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + revisionCase_ = 4; + revision_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Regex matching tags to build.
+     * The syntax of the regular expressions accepted is the syntax accepted by
+     * RE2 and described at https://github.com/google/re2/wiki/Syntax
+     * 
+ * + * string tag_name = 4; + * + * @return This builder for chaining. + */ + public Builder clearTagName() { + if (revisionCase_ == 4) { + revisionCase_ = 0; + revision_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Regex matching tags to build.
+     * The syntax of the regular expressions accepted is the syntax accepted by
+     * RE2 and described at https://github.com/google/re2/wiki/Syntax
+     * 
+ * + * string tag_name = 4; + * + * @param value The bytes for tagName to set. + * @return This builder for chaining. + */ + public Builder setTagNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + revisionCase_ = 4; + revision_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Explicit commit SHA to build.
+     * 
+ * + * string commit_sha = 5; + * + * @return Whether the commitSha field is set. + */ + @java.lang.Override + public boolean hasCommitSha() { + return revisionCase_ == 5; + } + /** + * + * + *
+     * Explicit commit SHA to build.
+     * 
+ * + * string commit_sha = 5; + * + * @return The commitSha. + */ + @java.lang.Override + public java.lang.String getCommitSha() { + java.lang.Object ref = ""; + if (revisionCase_ == 5) { + ref = revision_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (revisionCase_ == 5) { + revision_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Explicit commit SHA to build.
+     * 
+ * + * string commit_sha = 5; + * + * @return The bytes for commitSha. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCommitShaBytes() { + java.lang.Object ref = ""; + if (revisionCase_ == 5) { + ref = revision_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (revisionCase_ == 5) { + revision_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Explicit commit SHA to build.
+     * 
+ * + * string commit_sha = 5; + * + * @param value The commitSha to set. + * @return This builder for chaining. + */ + public Builder setCommitSha(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + revisionCase_ = 5; + revision_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Explicit commit SHA to build.
+     * 
+ * + * string commit_sha = 5; + * + * @return This builder for chaining. + */ + public Builder clearCommitSha() { + if (revisionCase_ == 5) { + revisionCase_ = 0; + revision_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Explicit commit SHA to build.
+     * 
+ * + * string commit_sha = 5; + * + * @param value The bytes for commitSha to set. + * @return This builder for chaining. + */ + public Builder setCommitShaBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + revisionCase_ = 5; + revision_ = value; + onChanged(); + return this; + } + + private java.lang.Object projectId_ = ""; + /** + * + * + *
+     * ID of the project that owns the Cloud Source Repository. If omitted, the
+     * project ID requesting the build is assumed.
+     * 
+ * + * string project_id = 1; + * + * @return The projectId. + */ + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + projectId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * ID of the project that owns the Cloud Source Repository. If omitted, the
+     * project ID requesting the build is assumed.
+     * 
+ * + * string project_id = 1; + * + * @return The bytes for projectId. + */ + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * ID of the project that owns the Cloud Source Repository. If omitted, the
+     * project ID requesting the build is assumed.
+     * 
+ * + * string project_id = 1; + * + * @param value The projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + projectId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * ID of the project that owns the Cloud Source Repository. If omitted, the
+     * project ID requesting the build is assumed.
+     * 
+ * + * string project_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearProjectId() { + + projectId_ = getDefaultInstance().getProjectId(); + onChanged(); + return this; + } + /** + * + * + *
+     * ID of the project that owns the Cloud Source Repository. If omitted, the
+     * project ID requesting the build is assumed.
+     * 
+ * + * string project_id = 1; + * + * @param value The bytes for projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + projectId_ = value; + onChanged(); + return this; + } + + private java.lang.Object repoName_ = ""; + /** + * + * + *
+     * Name of the Cloud Source Repository.
+     * 
+ * + * string repo_name = 2; + * + * @return The repoName. + */ + public java.lang.String getRepoName() { + java.lang.Object ref = repoName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + repoName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the Cloud Source Repository.
+     * 
+ * + * string repo_name = 2; + * + * @return The bytes for repoName. + */ + public com.google.protobuf.ByteString getRepoNameBytes() { + java.lang.Object ref = repoName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + repoName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the Cloud Source Repository.
+     * 
+ * + * string repo_name = 2; + * + * @param value The repoName to set. + * @return This builder for chaining. + */ + public Builder setRepoName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + repoName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the Cloud Source Repository.
+     * 
+ * + * string repo_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearRepoName() { + + repoName_ = getDefaultInstance().getRepoName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the Cloud Source Repository.
+     * 
+ * + * string repo_name = 2; + * + * @param value The bytes for repoName to set. + * @return This builder for chaining. + */ + public Builder setRepoNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + repoName_ = value; + onChanged(); + return this; + } + + private java.lang.Object dir_ = ""; + /** + * + * + *
+     * Directory, relative to the source root, in which to run the build.
+     * This must be a relative path. If a step's `dir` is specified and is an
+     * absolute path, this value is ignored for that step's execution.
+     * eg. helloworld (no leading slash allowed)
+     * 
+ * + * string dir = 6; + * + * @return The dir. + */ + public java.lang.String getDir() { + java.lang.Object ref = dir_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dir_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Directory, relative to the source root, in which to run the build.
+     * This must be a relative path. If a step's `dir` is specified and is an
+     * absolute path, this value is ignored for that step's execution.
+     * eg. helloworld (no leading slash allowed)
+     * 
+ * + * string dir = 6; + * + * @return The bytes for dir. + */ + public com.google.protobuf.ByteString getDirBytes() { + java.lang.Object ref = dir_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dir_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Directory, relative to the source root, in which to run the build.
+     * This must be a relative path. If a step's `dir` is specified and is an
+     * absolute path, this value is ignored for that step's execution.
+     * eg. helloworld (no leading slash allowed)
+     * 
+ * + * string dir = 6; + * + * @param value The dir to set. + * @return This builder for chaining. + */ + public Builder setDir(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + dir_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Directory, relative to the source root, in which to run the build.
+     * This must be a relative path. If a step's `dir` is specified and is an
+     * absolute path, this value is ignored for that step's execution.
+     * eg. helloworld (no leading slash allowed)
+     * 
+ * + * string dir = 6; + * + * @return This builder for chaining. + */ + public Builder clearDir() { + + dir_ = getDefaultInstance().getDir(); + onChanged(); + return this; + } + /** + * + * + *
+     * Directory, relative to the source root, in which to run the build.
+     * This must be a relative path. If a step's `dir` is specified and is an
+     * absolute path, this value is ignored for that step's execution.
+     * eg. helloworld (no leading slash allowed)
+     * 
+ * + * string dir = 6; + * + * @param value The bytes for dir to set. + * @return This builder for chaining. + */ + public Builder setDirBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + dir_ = value; + onChanged(); + return this; + } + + private boolean invertRegex_; + /** + * + * + *
+     * Only trigger a build if the revision regex does NOT match the revision
+     * regex.
+     * 
+ * + * bool invert_regex = 7; + * + * @return The invertRegex. + */ + @java.lang.Override + public boolean getInvertRegex() { + return invertRegex_; + } + /** + * + * + *
+     * Only trigger a build if the revision regex does NOT match the revision
+     * regex.
+     * 
+ * + * bool invert_regex = 7; + * + * @param value The invertRegex to set. + * @return This builder for chaining. + */ + public Builder setInvertRegex(boolean value) { + + invertRegex_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Only trigger a build if the revision regex does NOT match the revision
+     * regex.
+     * 
+ * + * bool invert_regex = 7; + * + * @return This builder for chaining. + */ + public Builder clearInvertRegex() { + + invertRegex_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2alpha.RepoSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2alpha.RepoSource) + private static final com.google.cloud.functions.v2alpha.RepoSource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2alpha.RepoSource(); + } + + public static com.google.cloud.functions.v2alpha.RepoSource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RepoSource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RepoSource(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.RepoSource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/RepoSourceOrBuilder.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/RepoSourceOrBuilder.java new file mode 100644 index 00000000..3c91711f --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/RepoSourceOrBuilder.java @@ -0,0 +1,247 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +public interface RepoSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2alpha.RepoSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Regex matching branches to build.
+   * The syntax of the regular expressions accepted is the syntax accepted by
+   * RE2 and described at https://github.com/google/re2/wiki/Syntax
+   * 
+ * + * string branch_name = 3; + * + * @return Whether the branchName field is set. + */ + boolean hasBranchName(); + /** + * + * + *
+   * Regex matching branches to build.
+   * The syntax of the regular expressions accepted is the syntax accepted by
+   * RE2 and described at https://github.com/google/re2/wiki/Syntax
+   * 
+ * + * string branch_name = 3; + * + * @return The branchName. + */ + java.lang.String getBranchName(); + /** + * + * + *
+   * Regex matching branches to build.
+   * The syntax of the regular expressions accepted is the syntax accepted by
+   * RE2 and described at https://github.com/google/re2/wiki/Syntax
+   * 
+ * + * string branch_name = 3; + * + * @return The bytes for branchName. + */ + com.google.protobuf.ByteString getBranchNameBytes(); + + /** + * + * + *
+   * Regex matching tags to build.
+   * The syntax of the regular expressions accepted is the syntax accepted by
+   * RE2 and described at https://github.com/google/re2/wiki/Syntax
+   * 
+ * + * string tag_name = 4; + * + * @return Whether the tagName field is set. + */ + boolean hasTagName(); + /** + * + * + *
+   * Regex matching tags to build.
+   * The syntax of the regular expressions accepted is the syntax accepted by
+   * RE2 and described at https://github.com/google/re2/wiki/Syntax
+   * 
+ * + * string tag_name = 4; + * + * @return The tagName. + */ + java.lang.String getTagName(); + /** + * + * + *
+   * Regex matching tags to build.
+   * The syntax of the regular expressions accepted is the syntax accepted by
+   * RE2 and described at https://github.com/google/re2/wiki/Syntax
+   * 
+ * + * string tag_name = 4; + * + * @return The bytes for tagName. + */ + com.google.protobuf.ByteString getTagNameBytes(); + + /** + * + * + *
+   * Explicit commit SHA to build.
+   * 
+ * + * string commit_sha = 5; + * + * @return Whether the commitSha field is set. + */ + boolean hasCommitSha(); + /** + * + * + *
+   * Explicit commit SHA to build.
+   * 
+ * + * string commit_sha = 5; + * + * @return The commitSha. + */ + java.lang.String getCommitSha(); + /** + * + * + *
+   * Explicit commit SHA to build.
+   * 
+ * + * string commit_sha = 5; + * + * @return The bytes for commitSha. + */ + com.google.protobuf.ByteString getCommitShaBytes(); + + /** + * + * + *
+   * ID of the project that owns the Cloud Source Repository. If omitted, the
+   * project ID requesting the build is assumed.
+   * 
+ * + * string project_id = 1; + * + * @return The projectId. + */ + java.lang.String getProjectId(); + /** + * + * + *
+   * ID of the project that owns the Cloud Source Repository. If omitted, the
+   * project ID requesting the build is assumed.
+   * 
+ * + * string project_id = 1; + * + * @return The bytes for projectId. + */ + com.google.protobuf.ByteString getProjectIdBytes(); + + /** + * + * + *
+   * Name of the Cloud Source Repository.
+   * 
+ * + * string repo_name = 2; + * + * @return The repoName. + */ + java.lang.String getRepoName(); + /** + * + * + *
+   * Name of the Cloud Source Repository.
+   * 
+ * + * string repo_name = 2; + * + * @return The bytes for repoName. + */ + com.google.protobuf.ByteString getRepoNameBytes(); + + /** + * + * + *
+   * Directory, relative to the source root, in which to run the build.
+   * This must be a relative path. If a step's `dir` is specified and is an
+   * absolute path, this value is ignored for that step's execution.
+   * eg. helloworld (no leading slash allowed)
+   * 
+ * + * string dir = 6; + * + * @return The dir. + */ + java.lang.String getDir(); + /** + * + * + *
+   * Directory, relative to the source root, in which to run the build.
+   * This must be a relative path. If a step's `dir` is specified and is an
+   * absolute path, this value is ignored for that step's execution.
+   * eg. helloworld (no leading slash allowed)
+   * 
+ * + * string dir = 6; + * + * @return The bytes for dir. + */ + com.google.protobuf.ByteString getDirBytes(); + + /** + * + * + *
+   * Only trigger a build if the revision regex does NOT match the revision
+   * regex.
+   * 
+ * + * bool invert_regex = 7; + * + * @return The invertRegex. + */ + boolean getInvertRegex(); + + public com.google.cloud.functions.v2alpha.RepoSource.RevisionCase getRevisionCase(); +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/SecretEnvVar.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/SecretEnvVar.java new file mode 100644 index 00000000..be76c360 --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/SecretEnvVar.java @@ -0,0 +1,1213 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +/** + * + * + *
+ * Configuration for a secret environment variable. It has the information
+ * necessary to fetch the secret value from secret manager and expose it as an
+ * environment variable.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.SecretEnvVar} + */ +public final class SecretEnvVar extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2alpha.SecretEnvVar) + SecretEnvVarOrBuilder { + private static final long serialVersionUID = 0L; + // Use SecretEnvVar.newBuilder() to construct. + private SecretEnvVar(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SecretEnvVar() { + key_ = ""; + projectId_ = ""; + secret_ = ""; + version_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SecretEnvVar(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SecretEnvVar( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + key_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + projectId_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + secret_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + version_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_SecretEnvVar_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_SecretEnvVar_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.SecretEnvVar.class, + com.google.cloud.functions.v2alpha.SecretEnvVar.Builder.class); + } + + public static final int KEY_FIELD_NUMBER = 1; + private volatile java.lang.Object key_; + /** + * + * + *
+   * Name of the environment variable.
+   * 
+ * + * string key = 1; + * + * @return The key. + */ + @java.lang.Override + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } + } + /** + * + * + *
+   * Name of the environment variable.
+   * 
+ * + * string key = 1; + * + * @return The bytes for key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object projectId_; + /** + * + * + *
+   * Project identifier (preferably project number but can also be the
+   * project ID) of the project that contains the secret. If not set, it is
+   * assumed that the secret is in the same project as the function.
+   * 
+ * + * string project_id = 2; + * + * @return The projectId. + */ + @java.lang.Override + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + projectId_ = s; + return s; + } + } + /** + * + * + *
+   * Project identifier (preferably project number but can also be the
+   * project ID) of the project that contains the secret. If not set, it is
+   * assumed that the secret is in the same project as the function.
+   * 
+ * + * string project_id = 2; + * + * @return The bytes for projectId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SECRET_FIELD_NUMBER = 3; + private volatile java.lang.Object secret_; + /** + * + * + *
+   * Name of the secret in secret manager (not the full resource name).
+   * 
+ * + * string secret = 3; + * + * @return The secret. + */ + @java.lang.Override + public java.lang.String getSecret() { + java.lang.Object ref = secret_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + secret_ = s; + return s; + } + } + /** + * + * + *
+   * Name of the secret in secret manager (not the full resource name).
+   * 
+ * + * string secret = 3; + * + * @return The bytes for secret. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSecretBytes() { + java.lang.Object ref = secret_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + secret_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERSION_FIELD_NUMBER = 4; + private volatile java.lang.Object version_; + /** + * + * + *
+   * Version of the secret (version number or the string 'latest'). It is
+   * recommended to use a numeric version for secret environment variables as
+   * any updates to the secret value is not reflected until new instances
+   * start.
+   * 
+ * + * string version = 4; + * + * @return The version. + */ + @java.lang.Override + public java.lang.String getVersion() { + java.lang.Object ref = version_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + version_ = s; + return s; + } + } + /** + * + * + *
+   * Version of the secret (version number or the string 'latest'). It is
+   * recommended to use a numeric version for secret environment variables as
+   * any updates to the secret value is not reflected until new instances
+   * start.
+   * 
+ * + * string version = 4; + * + * @return The bytes for version. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(key_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, projectId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(secret_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, secret_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(version_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, version_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(key_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, projectId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(secret_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, secret_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(version_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, version_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2alpha.SecretEnvVar)) { + return super.equals(obj); + } + com.google.cloud.functions.v2alpha.SecretEnvVar other = + (com.google.cloud.functions.v2alpha.SecretEnvVar) obj; + + if (!getKey().equals(other.getKey())) return false; + if (!getProjectId().equals(other.getProjectId())) return false; + if (!getSecret().equals(other.getSecret())) return false; + if (!getVersion().equals(other.getVersion())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + hash = (37 * hash) + PROJECT_ID_FIELD_NUMBER; + hash = (53 * hash) + getProjectId().hashCode(); + hash = (37 * hash) + SECRET_FIELD_NUMBER; + hash = (53 * hash) + getSecret().hashCode(); + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2alpha.SecretEnvVar parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.SecretEnvVar parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.SecretEnvVar parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.SecretEnvVar parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.SecretEnvVar parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.SecretEnvVar parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.SecretEnvVar parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.SecretEnvVar parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.SecretEnvVar parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.SecretEnvVar parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.SecretEnvVar parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.SecretEnvVar parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v2alpha.SecretEnvVar prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Configuration for a secret environment variable. It has the information
+   * necessary to fetch the secret value from secret manager and expose it as an
+   * environment variable.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.SecretEnvVar} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2alpha.SecretEnvVar) + com.google.cloud.functions.v2alpha.SecretEnvVarOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_SecretEnvVar_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_SecretEnvVar_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.SecretEnvVar.class, + com.google.cloud.functions.v2alpha.SecretEnvVar.Builder.class); + } + + // Construct using com.google.cloud.functions.v2alpha.SecretEnvVar.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + key_ = ""; + + projectId_ = ""; + + secret_ = ""; + + version_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_SecretEnvVar_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.SecretEnvVar getDefaultInstanceForType() { + return com.google.cloud.functions.v2alpha.SecretEnvVar.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.SecretEnvVar build() { + com.google.cloud.functions.v2alpha.SecretEnvVar result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.SecretEnvVar buildPartial() { + com.google.cloud.functions.v2alpha.SecretEnvVar result = + new com.google.cloud.functions.v2alpha.SecretEnvVar(this); + result.key_ = key_; + result.projectId_ = projectId_; + result.secret_ = secret_; + result.version_ = version_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2alpha.SecretEnvVar) { + return mergeFrom((com.google.cloud.functions.v2alpha.SecretEnvVar) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2alpha.SecretEnvVar other) { + if (other == com.google.cloud.functions.v2alpha.SecretEnvVar.getDefaultInstance()) + return this; + if (!other.getKey().isEmpty()) { + key_ = other.key_; + onChanged(); + } + if (!other.getProjectId().isEmpty()) { + projectId_ = other.projectId_; + onChanged(); + } + if (!other.getSecret().isEmpty()) { + secret_ = other.secret_; + onChanged(); + } + if (!other.getVersion().isEmpty()) { + version_ = other.version_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2alpha.SecretEnvVar parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v2alpha.SecretEnvVar) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object key_ = ""; + /** + * + * + *
+     * Name of the environment variable.
+     * 
+ * + * string key = 1; + * + * @return The key. + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the environment variable.
+     * 
+ * + * string key = 1; + * + * @return The bytes for key. + */ + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the environment variable.
+     * 
+ * + * string key = 1; + * + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + key_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the environment variable.
+     * 
+ * + * string key = 1; + * + * @return This builder for chaining. + */ + public Builder clearKey() { + + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the environment variable.
+     * 
+ * + * string key = 1; + * + * @param value The bytes for key to set. + * @return This builder for chaining. + */ + public Builder setKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + key_ = value; + onChanged(); + return this; + } + + private java.lang.Object projectId_ = ""; + /** + * + * + *
+     * Project identifier (preferably project number but can also be the
+     * project ID) of the project that contains the secret. If not set, it is
+     * assumed that the secret is in the same project as the function.
+     * 
+ * + * string project_id = 2; + * + * @return The projectId. + */ + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + projectId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Project identifier (preferably project number but can also be the
+     * project ID) of the project that contains the secret. If not set, it is
+     * assumed that the secret is in the same project as the function.
+     * 
+ * + * string project_id = 2; + * + * @return The bytes for projectId. + */ + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Project identifier (preferably project number but can also be the
+     * project ID) of the project that contains the secret. If not set, it is
+     * assumed that the secret is in the same project as the function.
+     * 
+ * + * string project_id = 2; + * + * @param value The projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + projectId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Project identifier (preferably project number but can also be the
+     * project ID) of the project that contains the secret. If not set, it is
+     * assumed that the secret is in the same project as the function.
+     * 
+ * + * string project_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearProjectId() { + + projectId_ = getDefaultInstance().getProjectId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Project identifier (preferably project number but can also be the
+     * project ID) of the project that contains the secret. If not set, it is
+     * assumed that the secret is in the same project as the function.
+     * 
+ * + * string project_id = 2; + * + * @param value The bytes for projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + projectId_ = value; + onChanged(); + return this; + } + + private java.lang.Object secret_ = ""; + /** + * + * + *
+     * Name of the secret in secret manager (not the full resource name).
+     * 
+ * + * string secret = 3; + * + * @return The secret. + */ + public java.lang.String getSecret() { + java.lang.Object ref = secret_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + secret_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the secret in secret manager (not the full resource name).
+     * 
+ * + * string secret = 3; + * + * @return The bytes for secret. + */ + public com.google.protobuf.ByteString getSecretBytes() { + java.lang.Object ref = secret_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + secret_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the secret in secret manager (not the full resource name).
+     * 
+ * + * string secret = 3; + * + * @param value The secret to set. + * @return This builder for chaining. + */ + public Builder setSecret(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + secret_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the secret in secret manager (not the full resource name).
+     * 
+ * + * string secret = 3; + * + * @return This builder for chaining. + */ + public Builder clearSecret() { + + secret_ = getDefaultInstance().getSecret(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the secret in secret manager (not the full resource name).
+     * 
+ * + * string secret = 3; + * + * @param value The bytes for secret to set. + * @return This builder for chaining. + */ + public Builder setSecretBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + secret_ = value; + onChanged(); + return this; + } + + private java.lang.Object version_ = ""; + /** + * + * + *
+     * Version of the secret (version number or the string 'latest'). It is
+     * recommended to use a numeric version for secret environment variables as
+     * any updates to the secret value is not reflected until new instances
+     * start.
+     * 
+ * + * string version = 4; + * + * @return The version. + */ + public java.lang.String getVersion() { + java.lang.Object ref = version_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + version_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Version of the secret (version number or the string 'latest'). It is
+     * recommended to use a numeric version for secret environment variables as
+     * any updates to the secret value is not reflected until new instances
+     * start.
+     * 
+ * + * string version = 4; + * + * @return The bytes for version. + */ + public com.google.protobuf.ByteString getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Version of the secret (version number or the string 'latest'). It is
+     * recommended to use a numeric version for secret environment variables as
+     * any updates to the secret value is not reflected until new instances
+     * start.
+     * 
+ * + * string version = 4; + * + * @param value The version to set. + * @return This builder for chaining. + */ + public Builder setVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + version_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Version of the secret (version number or the string 'latest'). It is
+     * recommended to use a numeric version for secret environment variables as
+     * any updates to the secret value is not reflected until new instances
+     * start.
+     * 
+ * + * string version = 4; + * + * @return This builder for chaining. + */ + public Builder clearVersion() { + + version_ = getDefaultInstance().getVersion(); + onChanged(); + return this; + } + /** + * + * + *
+     * Version of the secret (version number or the string 'latest'). It is
+     * recommended to use a numeric version for secret environment variables as
+     * any updates to the secret value is not reflected until new instances
+     * start.
+     * 
+ * + * string version = 4; + * + * @param value The bytes for version to set. + * @return This builder for chaining. + */ + public Builder setVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + version_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2alpha.SecretEnvVar) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2alpha.SecretEnvVar) + private static final com.google.cloud.functions.v2alpha.SecretEnvVar DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2alpha.SecretEnvVar(); + } + + public static com.google.cloud.functions.v2alpha.SecretEnvVar getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SecretEnvVar parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SecretEnvVar(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.SecretEnvVar getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/SecretEnvVarOrBuilder.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/SecretEnvVarOrBuilder.java new file mode 100644 index 00000000..4464f7be --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/SecretEnvVarOrBuilder.java @@ -0,0 +1,135 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +public interface SecretEnvVarOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2alpha.SecretEnvVar) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of the environment variable.
+   * 
+ * + * string key = 1; + * + * @return The key. + */ + java.lang.String getKey(); + /** + * + * + *
+   * Name of the environment variable.
+   * 
+ * + * string key = 1; + * + * @return The bytes for key. + */ + com.google.protobuf.ByteString getKeyBytes(); + + /** + * + * + *
+   * Project identifier (preferably project number but can also be the
+   * project ID) of the project that contains the secret. If not set, it is
+   * assumed that the secret is in the same project as the function.
+   * 
+ * + * string project_id = 2; + * + * @return The projectId. + */ + java.lang.String getProjectId(); + /** + * + * + *
+   * Project identifier (preferably project number but can also be the
+   * project ID) of the project that contains the secret. If not set, it is
+   * assumed that the secret is in the same project as the function.
+   * 
+ * + * string project_id = 2; + * + * @return The bytes for projectId. + */ + com.google.protobuf.ByteString getProjectIdBytes(); + + /** + * + * + *
+   * Name of the secret in secret manager (not the full resource name).
+   * 
+ * + * string secret = 3; + * + * @return The secret. + */ + java.lang.String getSecret(); + /** + * + * + *
+   * Name of the secret in secret manager (not the full resource name).
+   * 
+ * + * string secret = 3; + * + * @return The bytes for secret. + */ + com.google.protobuf.ByteString getSecretBytes(); + + /** + * + * + *
+   * Version of the secret (version number or the string 'latest'). It is
+   * recommended to use a numeric version for secret environment variables as
+   * any updates to the secret value is not reflected until new instances
+   * start.
+   * 
+ * + * string version = 4; + * + * @return The version. + */ + java.lang.String getVersion(); + /** + * + * + *
+   * Version of the secret (version number or the string 'latest'). It is
+   * recommended to use a numeric version for secret environment variables as
+   * any updates to the secret value is not reflected until new instances
+   * start.
+   * 
+ * + * string version = 4; + * + * @return The bytes for version. + */ + com.google.protobuf.ByteString getVersionBytes(); +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/SecretVolume.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/SecretVolume.java new file mode 100644 index 00000000..46554421 --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/SecretVolume.java @@ -0,0 +1,2532 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +/** + * + * + *
+ * Configuration for a secret volume. It has the information necessary to fetch
+ * the secret value from secret manager and make it available as files mounted
+ * at the requested paths within the application container.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.SecretVolume} + */ +public final class SecretVolume extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2alpha.SecretVolume) + SecretVolumeOrBuilder { + private static final long serialVersionUID = 0L; + // Use SecretVolume.newBuilder() to construct. + private SecretVolume(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SecretVolume() { + mountPath_ = ""; + projectId_ = ""; + secret_ = ""; + versions_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SecretVolume(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SecretVolume( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + mountPath_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + projectId_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + secret_ = s; + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + versions_ = + new java.util.ArrayList< + com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion>(); + mutable_bitField0_ |= 0x00000001; + } + versions_.add( + input.readMessage( + com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion.parser(), + extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + versions_ = java.util.Collections.unmodifiableList(versions_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_SecretVolume_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_SecretVolume_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.SecretVolume.class, + com.google.cloud.functions.v2alpha.SecretVolume.Builder.class); + } + + public interface SecretVersionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2alpha.SecretVolume.SecretVersion) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Version of the secret (version number or the string 'latest'). It is
+     * preferable to use `latest` version with secret volumes as secret value
+     * changes are reflected immediately.
+     * 
+ * + * string version = 1; + * + * @return The version. + */ + java.lang.String getVersion(); + /** + * + * + *
+     * Version of the secret (version number or the string 'latest'). It is
+     * preferable to use `latest` version with secret volumes as secret value
+     * changes are reflected immediately.
+     * 
+ * + * string version = 1; + * + * @return The bytes for version. + */ + com.google.protobuf.ByteString getVersionBytes(); + + /** + * + * + *
+     * Relative path of the file under the mount path where the secret value for
+     * this version will be fetched and made available. For example, setting the
+     * mount_path as '/etc/secrets' and path as `secret_foo` would mount the
+     * secret value file at `/etc/secrets/secret_foo`.
+     * 
+ * + * string path = 2; + * + * @return The path. + */ + java.lang.String getPath(); + /** + * + * + *
+     * Relative path of the file under the mount path where the secret value for
+     * this version will be fetched and made available. For example, setting the
+     * mount_path as '/etc/secrets' and path as `secret_foo` would mount the
+     * secret value file at `/etc/secrets/secret_foo`.
+     * 
+ * + * string path = 2; + * + * @return The bytes for path. + */ + com.google.protobuf.ByteString getPathBytes(); + } + /** + * + * + *
+   * Configuration for a single version.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.SecretVolume.SecretVersion} + */ + public static final class SecretVersion extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2alpha.SecretVolume.SecretVersion) + SecretVersionOrBuilder { + private static final long serialVersionUID = 0L; + // Use SecretVersion.newBuilder() to construct. + private SecretVersion(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SecretVersion() { + version_ = ""; + path_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SecretVersion(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SecretVersion( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + version_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + path_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_SecretVolume_SecretVersion_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_SecretVolume_SecretVersion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion.class, + com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion.Builder.class); + } + + public static final int VERSION_FIELD_NUMBER = 1; + private volatile java.lang.Object version_; + /** + * + * + *
+     * Version of the secret (version number or the string 'latest'). It is
+     * preferable to use `latest` version with secret volumes as secret value
+     * changes are reflected immediately.
+     * 
+ * + * string version = 1; + * + * @return The version. + */ + @java.lang.Override + public java.lang.String getVersion() { + java.lang.Object ref = version_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + version_ = s; + return s; + } + } + /** + * + * + *
+     * Version of the secret (version number or the string 'latest'). It is
+     * preferable to use `latest` version with secret volumes as secret value
+     * changes are reflected immediately.
+     * 
+ * + * string version = 1; + * + * @return The bytes for version. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PATH_FIELD_NUMBER = 2; + private volatile java.lang.Object path_; + /** + * + * + *
+     * Relative path of the file under the mount path where the secret value for
+     * this version will be fetched and made available. For example, setting the
+     * mount_path as '/etc/secrets' and path as `secret_foo` would mount the
+     * secret value file at `/etc/secrets/secret_foo`.
+     * 
+ * + * string path = 2; + * + * @return The path. + */ + @java.lang.Override + public java.lang.String getPath() { + java.lang.Object ref = path_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + path_ = s; + return s; + } + } + /** + * + * + *
+     * Relative path of the file under the mount path where the secret value for
+     * this version will be fetched and made available. For example, setting the
+     * mount_path as '/etc/secrets' and path as `secret_foo` would mount the
+     * secret value file at `/etc/secrets/secret_foo`.
+     * 
+ * + * string path = 2; + * + * @return The bytes for path. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPathBytes() { + java.lang.Object ref = path_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + path_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(version_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, version_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(path_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, path_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(version_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, version_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(path_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, path_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion)) { + return super.equals(obj); + } + com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion other = + (com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion) obj; + + if (!getVersion().equals(other.getVersion())) return false; + if (!getPath().equals(other.getPath())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion().hashCode(); + hash = (37 * hash) + PATH_FIELD_NUMBER; + hash = (53 * hash) + getPath().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Configuration for a single version.
+     * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.SecretVolume.SecretVersion} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2alpha.SecretVolume.SecretVersion) + com.google.cloud.functions.v2alpha.SecretVolume.SecretVersionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_SecretVolume_SecretVersion_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_SecretVolume_SecretVersion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion.class, + com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion.Builder.class); + } + + // Construct using com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + version_ = ""; + + path_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_SecretVolume_SecretVersion_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion + getDefaultInstanceForType() { + return com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion build() { + com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion buildPartial() { + com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion result = + new com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion(this); + result.version_ = version_; + result.path_ = path_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion) { + return mergeFrom((com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion other) { + if (other + == com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion.getDefaultInstance()) + return this; + if (!other.getVersion().isEmpty()) { + version_ = other.version_; + onChanged(); + } + if (!other.getPath().isEmpty()) { + path_ = other.path_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object version_ = ""; + /** + * + * + *
+       * Version of the secret (version number or the string 'latest'). It is
+       * preferable to use `latest` version with secret volumes as secret value
+       * changes are reflected immediately.
+       * 
+ * + * string version = 1; + * + * @return The version. + */ + public java.lang.String getVersion() { + java.lang.Object ref = version_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + version_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Version of the secret (version number or the string 'latest'). It is
+       * preferable to use `latest` version with secret volumes as secret value
+       * changes are reflected immediately.
+       * 
+ * + * string version = 1; + * + * @return The bytes for version. + */ + public com.google.protobuf.ByteString getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Version of the secret (version number or the string 'latest'). It is
+       * preferable to use `latest` version with secret volumes as secret value
+       * changes are reflected immediately.
+       * 
+ * + * string version = 1; + * + * @param value The version to set. + * @return This builder for chaining. + */ + public Builder setVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + version_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Version of the secret (version number or the string 'latest'). It is
+       * preferable to use `latest` version with secret volumes as secret value
+       * changes are reflected immediately.
+       * 
+ * + * string version = 1; + * + * @return This builder for chaining. + */ + public Builder clearVersion() { + + version_ = getDefaultInstance().getVersion(); + onChanged(); + return this; + } + /** + * + * + *
+       * Version of the secret (version number or the string 'latest'). It is
+       * preferable to use `latest` version with secret volumes as secret value
+       * changes are reflected immediately.
+       * 
+ * + * string version = 1; + * + * @param value The bytes for version to set. + * @return This builder for chaining. + */ + public Builder setVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + version_ = value; + onChanged(); + return this; + } + + private java.lang.Object path_ = ""; + /** + * + * + *
+       * Relative path of the file under the mount path where the secret value for
+       * this version will be fetched and made available. For example, setting the
+       * mount_path as '/etc/secrets' and path as `secret_foo` would mount the
+       * secret value file at `/etc/secrets/secret_foo`.
+       * 
+ * + * string path = 2; + * + * @return The path. + */ + public java.lang.String getPath() { + java.lang.Object ref = path_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + path_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Relative path of the file under the mount path where the secret value for
+       * this version will be fetched and made available. For example, setting the
+       * mount_path as '/etc/secrets' and path as `secret_foo` would mount the
+       * secret value file at `/etc/secrets/secret_foo`.
+       * 
+ * + * string path = 2; + * + * @return The bytes for path. + */ + public com.google.protobuf.ByteString getPathBytes() { + java.lang.Object ref = path_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + path_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Relative path of the file under the mount path where the secret value for
+       * this version will be fetched and made available. For example, setting the
+       * mount_path as '/etc/secrets' and path as `secret_foo` would mount the
+       * secret value file at `/etc/secrets/secret_foo`.
+       * 
+ * + * string path = 2; + * + * @param value The path to set. + * @return This builder for chaining. + */ + public Builder setPath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + path_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Relative path of the file under the mount path where the secret value for
+       * this version will be fetched and made available. For example, setting the
+       * mount_path as '/etc/secrets' and path as `secret_foo` would mount the
+       * secret value file at `/etc/secrets/secret_foo`.
+       * 
+ * + * string path = 2; + * + * @return This builder for chaining. + */ + public Builder clearPath() { + + path_ = getDefaultInstance().getPath(); + onChanged(); + return this; + } + /** + * + * + *
+       * Relative path of the file under the mount path where the secret value for
+       * this version will be fetched and made available. For example, setting the
+       * mount_path as '/etc/secrets' and path as `secret_foo` would mount the
+       * secret value file at `/etc/secrets/secret_foo`.
+       * 
+ * + * string path = 2; + * + * @param value The bytes for path to set. + * @return This builder for chaining. + */ + public Builder setPathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + path_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2alpha.SecretVolume.SecretVersion) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2alpha.SecretVolume.SecretVersion) + private static final com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion(); + } + + public static com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SecretVersion parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SecretVersion(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int MOUNT_PATH_FIELD_NUMBER = 1; + private volatile java.lang.Object mountPath_; + /** + * + * + *
+   * The path within the container to mount the secret volume. For example,
+   * setting the mount_path as `/etc/secrets` would mount the secret value files
+   * under the `/etc/secrets` directory. This directory will also be completely
+   * shadowed and unavailable to mount any other secrets.
+   * Recommended mount path: /etc/secrets
+   * 
+ * + * string mount_path = 1; + * + * @return The mountPath. + */ + @java.lang.Override + public java.lang.String getMountPath() { + java.lang.Object ref = mountPath_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mountPath_ = s; + return s; + } + } + /** + * + * + *
+   * The path within the container to mount the secret volume. For example,
+   * setting the mount_path as `/etc/secrets` would mount the secret value files
+   * under the `/etc/secrets` directory. This directory will also be completely
+   * shadowed and unavailable to mount any other secrets.
+   * Recommended mount path: /etc/secrets
+   * 
+ * + * string mount_path = 1; + * + * @return The bytes for mountPath. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMountPathBytes() { + java.lang.Object ref = mountPath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + mountPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object projectId_; + /** + * + * + *
+   * Project identifier (preferably project number but can also be the project
+   * ID) of the project that contains the secret. If not set, it is
+   * assumed that the secret is in the same project as the function.
+   * 
+ * + * string project_id = 2; + * + * @return The projectId. + */ + @java.lang.Override + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + projectId_ = s; + return s; + } + } + /** + * + * + *
+   * Project identifier (preferably project number but can also be the project
+   * ID) of the project that contains the secret. If not set, it is
+   * assumed that the secret is in the same project as the function.
+   * 
+ * + * string project_id = 2; + * + * @return The bytes for projectId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SECRET_FIELD_NUMBER = 3; + private volatile java.lang.Object secret_; + /** + * + * + *
+   * Name of the secret in secret manager (not the full resource name).
+   * 
+ * + * string secret = 3; + * + * @return The secret. + */ + @java.lang.Override + public java.lang.String getSecret() { + java.lang.Object ref = secret_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + secret_ = s; + return s; + } + } + /** + * + * + *
+   * Name of the secret in secret manager (not the full resource name).
+   * 
+ * + * string secret = 3; + * + * @return The bytes for secret. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSecretBytes() { + java.lang.Object ref = secret_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + secret_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERSIONS_FIELD_NUMBER = 4; + private java.util.List versions_; + /** + * + * + *
+   * List of secret versions to mount for this secret. If empty, the `latest`
+   * version of the secret will be made available in a file named after the
+   * secret under the mount point.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume.SecretVersion versions = 4; + */ + @java.lang.Override + public java.util.List + getVersionsList() { + return versions_; + } + /** + * + * + *
+   * List of secret versions to mount for this secret. If empty, the `latest`
+   * version of the secret will be made available in a file named after the
+   * secret under the mount point.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume.SecretVersion versions = 4; + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.functions.v2alpha.SecretVolume.SecretVersionOrBuilder> + getVersionsOrBuilderList() { + return versions_; + } + /** + * + * + *
+   * List of secret versions to mount for this secret. If empty, the `latest`
+   * version of the secret will be made available in a file named after the
+   * secret under the mount point.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume.SecretVersion versions = 4; + */ + @java.lang.Override + public int getVersionsCount() { + return versions_.size(); + } + /** + * + * + *
+   * List of secret versions to mount for this secret. If empty, the `latest`
+   * version of the secret will be made available in a file named after the
+   * secret under the mount point.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume.SecretVersion versions = 4; + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion getVersions(int index) { + return versions_.get(index); + } + /** + * + * + *
+   * List of secret versions to mount for this secret. If empty, the `latest`
+   * version of the secret will be made available in a file named after the
+   * secret under the mount point.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume.SecretVersion versions = 4; + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.SecretVolume.SecretVersionOrBuilder + getVersionsOrBuilder(int index) { + return versions_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(mountPath_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, mountPath_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, projectId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(secret_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, secret_); + } + for (int i = 0; i < versions_.size(); i++) { + output.writeMessage(4, versions_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(mountPath_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, mountPath_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, projectId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(secret_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, secret_); + } + for (int i = 0; i < versions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, versions_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2alpha.SecretVolume)) { + return super.equals(obj); + } + com.google.cloud.functions.v2alpha.SecretVolume other = + (com.google.cloud.functions.v2alpha.SecretVolume) obj; + + if (!getMountPath().equals(other.getMountPath())) return false; + if (!getProjectId().equals(other.getProjectId())) return false; + if (!getSecret().equals(other.getSecret())) return false; + if (!getVersionsList().equals(other.getVersionsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MOUNT_PATH_FIELD_NUMBER; + hash = (53 * hash) + getMountPath().hashCode(); + hash = (37 * hash) + PROJECT_ID_FIELD_NUMBER; + hash = (53 * hash) + getProjectId().hashCode(); + hash = (37 * hash) + SECRET_FIELD_NUMBER; + hash = (53 * hash) + getSecret().hashCode(); + if (getVersionsCount() > 0) { + hash = (37 * hash) + VERSIONS_FIELD_NUMBER; + hash = (53 * hash) + getVersionsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2alpha.SecretVolume parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.SecretVolume parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.SecretVolume parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.SecretVolume parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.SecretVolume parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.SecretVolume parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.SecretVolume parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.SecretVolume parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.SecretVolume parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.SecretVolume parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.SecretVolume parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.SecretVolume parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v2alpha.SecretVolume prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Configuration for a secret volume. It has the information necessary to fetch
+   * the secret value from secret manager and make it available as files mounted
+   * at the requested paths within the application container.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.SecretVolume} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2alpha.SecretVolume) + com.google.cloud.functions.v2alpha.SecretVolumeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_SecretVolume_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_SecretVolume_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.SecretVolume.class, + com.google.cloud.functions.v2alpha.SecretVolume.Builder.class); + } + + // Construct using com.google.cloud.functions.v2alpha.SecretVolume.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getVersionsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + mountPath_ = ""; + + projectId_ = ""; + + secret_ = ""; + + if (versionsBuilder_ == null) { + versions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + versionsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_SecretVolume_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.SecretVolume getDefaultInstanceForType() { + return com.google.cloud.functions.v2alpha.SecretVolume.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.SecretVolume build() { + com.google.cloud.functions.v2alpha.SecretVolume result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.SecretVolume buildPartial() { + com.google.cloud.functions.v2alpha.SecretVolume result = + new com.google.cloud.functions.v2alpha.SecretVolume(this); + int from_bitField0_ = bitField0_; + result.mountPath_ = mountPath_; + result.projectId_ = projectId_; + result.secret_ = secret_; + if (versionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + versions_ = java.util.Collections.unmodifiableList(versions_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.versions_ = versions_; + } else { + result.versions_ = versionsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2alpha.SecretVolume) { + return mergeFrom((com.google.cloud.functions.v2alpha.SecretVolume) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2alpha.SecretVolume other) { + if (other == com.google.cloud.functions.v2alpha.SecretVolume.getDefaultInstance()) + return this; + if (!other.getMountPath().isEmpty()) { + mountPath_ = other.mountPath_; + onChanged(); + } + if (!other.getProjectId().isEmpty()) { + projectId_ = other.projectId_; + onChanged(); + } + if (!other.getSecret().isEmpty()) { + secret_ = other.secret_; + onChanged(); + } + if (versionsBuilder_ == null) { + if (!other.versions_.isEmpty()) { + if (versions_.isEmpty()) { + versions_ = other.versions_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureVersionsIsMutable(); + versions_.addAll(other.versions_); + } + onChanged(); + } + } else { + if (!other.versions_.isEmpty()) { + if (versionsBuilder_.isEmpty()) { + versionsBuilder_.dispose(); + versionsBuilder_ = null; + versions_ = other.versions_; + bitField0_ = (bitField0_ & ~0x00000001); + versionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getVersionsFieldBuilder() + : null; + } else { + versionsBuilder_.addAllMessages(other.versions_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2alpha.SecretVolume parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v2alpha.SecretVolume) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object mountPath_ = ""; + /** + * + * + *
+     * The path within the container to mount the secret volume. For example,
+     * setting the mount_path as `/etc/secrets` would mount the secret value files
+     * under the `/etc/secrets` directory. This directory will also be completely
+     * shadowed and unavailable to mount any other secrets.
+     * Recommended mount path: /etc/secrets
+     * 
+ * + * string mount_path = 1; + * + * @return The mountPath. + */ + public java.lang.String getMountPath() { + java.lang.Object ref = mountPath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mountPath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The path within the container to mount the secret volume. For example,
+     * setting the mount_path as `/etc/secrets` would mount the secret value files
+     * under the `/etc/secrets` directory. This directory will also be completely
+     * shadowed and unavailable to mount any other secrets.
+     * Recommended mount path: /etc/secrets
+     * 
+ * + * string mount_path = 1; + * + * @return The bytes for mountPath. + */ + public com.google.protobuf.ByteString getMountPathBytes() { + java.lang.Object ref = mountPath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + mountPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The path within the container to mount the secret volume. For example,
+     * setting the mount_path as `/etc/secrets` would mount the secret value files
+     * under the `/etc/secrets` directory. This directory will also be completely
+     * shadowed and unavailable to mount any other secrets.
+     * Recommended mount path: /etc/secrets
+     * 
+ * + * string mount_path = 1; + * + * @param value The mountPath to set. + * @return This builder for chaining. + */ + public Builder setMountPath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + mountPath_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The path within the container to mount the secret volume. For example,
+     * setting the mount_path as `/etc/secrets` would mount the secret value files
+     * under the `/etc/secrets` directory. This directory will also be completely
+     * shadowed and unavailable to mount any other secrets.
+     * Recommended mount path: /etc/secrets
+     * 
+ * + * string mount_path = 1; + * + * @return This builder for chaining. + */ + public Builder clearMountPath() { + + mountPath_ = getDefaultInstance().getMountPath(); + onChanged(); + return this; + } + /** + * + * + *
+     * The path within the container to mount the secret volume. For example,
+     * setting the mount_path as `/etc/secrets` would mount the secret value files
+     * under the `/etc/secrets` directory. This directory will also be completely
+     * shadowed and unavailable to mount any other secrets.
+     * Recommended mount path: /etc/secrets
+     * 
+ * + * string mount_path = 1; + * + * @param value The bytes for mountPath to set. + * @return This builder for chaining. + */ + public Builder setMountPathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + mountPath_ = value; + onChanged(); + return this; + } + + private java.lang.Object projectId_ = ""; + /** + * + * + *
+     * Project identifier (preferably project number but can also be the project
+     * ID) of the project that contains the secret. If not set, it is
+     * assumed that the secret is in the same project as the function.
+     * 
+ * + * string project_id = 2; + * + * @return The projectId. + */ + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + projectId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Project identifier (preferably project number but can also be the project
+     * ID) of the project that contains the secret. If not set, it is
+     * assumed that the secret is in the same project as the function.
+     * 
+ * + * string project_id = 2; + * + * @return The bytes for projectId. + */ + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Project identifier (preferably project number but can also be the project
+     * ID) of the project that contains the secret. If not set, it is
+     * assumed that the secret is in the same project as the function.
+     * 
+ * + * string project_id = 2; + * + * @param value The projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + projectId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Project identifier (preferably project number but can also be the project
+     * ID) of the project that contains the secret. If not set, it is
+     * assumed that the secret is in the same project as the function.
+     * 
+ * + * string project_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearProjectId() { + + projectId_ = getDefaultInstance().getProjectId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Project identifier (preferably project number but can also be the project
+     * ID) of the project that contains the secret. If not set, it is
+     * assumed that the secret is in the same project as the function.
+     * 
+ * + * string project_id = 2; + * + * @param value The bytes for projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + projectId_ = value; + onChanged(); + return this; + } + + private java.lang.Object secret_ = ""; + /** + * + * + *
+     * Name of the secret in secret manager (not the full resource name).
+     * 
+ * + * string secret = 3; + * + * @return The secret. + */ + public java.lang.String getSecret() { + java.lang.Object ref = secret_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + secret_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the secret in secret manager (not the full resource name).
+     * 
+ * + * string secret = 3; + * + * @return The bytes for secret. + */ + public com.google.protobuf.ByteString getSecretBytes() { + java.lang.Object ref = secret_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + secret_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the secret in secret manager (not the full resource name).
+     * 
+ * + * string secret = 3; + * + * @param value The secret to set. + * @return This builder for chaining. + */ + public Builder setSecret(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + secret_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the secret in secret manager (not the full resource name).
+     * 
+ * + * string secret = 3; + * + * @return This builder for chaining. + */ + public Builder clearSecret() { + + secret_ = getDefaultInstance().getSecret(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the secret in secret manager (not the full resource name).
+     * 
+ * + * string secret = 3; + * + * @param value The bytes for secret to set. + * @return This builder for chaining. + */ + public Builder setSecretBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + secret_ = value; + onChanged(); + return this; + } + + private java.util.List + versions_ = java.util.Collections.emptyList(); + + private void ensureVersionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + versions_ = + new java.util.ArrayList( + versions_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion, + com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion.Builder, + com.google.cloud.functions.v2alpha.SecretVolume.SecretVersionOrBuilder> + versionsBuilder_; + + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume.SecretVersion versions = 4; + * + */ + public java.util.List + getVersionsList() { + if (versionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(versions_); + } else { + return versionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume.SecretVersion versions = 4; + * + */ + public int getVersionsCount() { + if (versionsBuilder_ == null) { + return versions_.size(); + } else { + return versionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume.SecretVersion versions = 4; + * + */ + public com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion getVersions(int index) { + if (versionsBuilder_ == null) { + return versions_.get(index); + } else { + return versionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume.SecretVersion versions = 4; + * + */ + public Builder setVersions( + int index, com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion value) { + if (versionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVersionsIsMutable(); + versions_.set(index, value); + onChanged(); + } else { + versionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume.SecretVersion versions = 4; + * + */ + public Builder setVersions( + int index, + com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion.Builder builderForValue) { + if (versionsBuilder_ == null) { + ensureVersionsIsMutable(); + versions_.set(index, builderForValue.build()); + onChanged(); + } else { + versionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume.SecretVersion versions = 4; + * + */ + public Builder addVersions( + com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion value) { + if (versionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVersionsIsMutable(); + versions_.add(value); + onChanged(); + } else { + versionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume.SecretVersion versions = 4; + * + */ + public Builder addVersions( + int index, com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion value) { + if (versionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVersionsIsMutable(); + versions_.add(index, value); + onChanged(); + } else { + versionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume.SecretVersion versions = 4; + * + */ + public Builder addVersions( + com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion.Builder builderForValue) { + if (versionsBuilder_ == null) { + ensureVersionsIsMutable(); + versions_.add(builderForValue.build()); + onChanged(); + } else { + versionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume.SecretVersion versions = 4; + * + */ + public Builder addVersions( + int index, + com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion.Builder builderForValue) { + if (versionsBuilder_ == null) { + ensureVersionsIsMutable(); + versions_.add(index, builderForValue.build()); + onChanged(); + } else { + versionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume.SecretVersion versions = 4; + * + */ + public Builder addAllVersions( + java.lang.Iterable + values) { + if (versionsBuilder_ == null) { + ensureVersionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, versions_); + onChanged(); + } else { + versionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume.SecretVersion versions = 4; + * + */ + public Builder clearVersions() { + if (versionsBuilder_ == null) { + versions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + versionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume.SecretVersion versions = 4; + * + */ + public Builder removeVersions(int index) { + if (versionsBuilder_ == null) { + ensureVersionsIsMutable(); + versions_.remove(index); + onChanged(); + } else { + versionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume.SecretVersion versions = 4; + * + */ + public com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion.Builder getVersionsBuilder( + int index) { + return getVersionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume.SecretVersion versions = 4; + * + */ + public com.google.cloud.functions.v2alpha.SecretVolume.SecretVersionOrBuilder + getVersionsOrBuilder(int index) { + if (versionsBuilder_ == null) { + return versions_.get(index); + } else { + return versionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume.SecretVersion versions = 4; + * + */ + public java.util.List< + ? extends com.google.cloud.functions.v2alpha.SecretVolume.SecretVersionOrBuilder> + getVersionsOrBuilderList() { + if (versionsBuilder_ != null) { + return versionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(versions_); + } + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume.SecretVersion versions = 4; + * + */ + public com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion.Builder + addVersionsBuilder() { + return getVersionsFieldBuilder() + .addBuilder( + com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion.getDefaultInstance()); + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume.SecretVersion versions = 4; + * + */ + public com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion.Builder addVersionsBuilder( + int index) { + return getVersionsFieldBuilder() + .addBuilder( + index, + com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion.getDefaultInstance()); + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume.SecretVersion versions = 4; + * + */ + public java.util.List + getVersionsBuilderList() { + return getVersionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion, + com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion.Builder, + com.google.cloud.functions.v2alpha.SecretVolume.SecretVersionOrBuilder> + getVersionsFieldBuilder() { + if (versionsBuilder_ == null) { + versionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion, + com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion.Builder, + com.google.cloud.functions.v2alpha.SecretVolume.SecretVersionOrBuilder>( + versions_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + versions_ = null; + } + return versionsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2alpha.SecretVolume) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2alpha.SecretVolume) + private static final com.google.cloud.functions.v2alpha.SecretVolume DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2alpha.SecretVolume(); + } + + public static com.google.cloud.functions.v2alpha.SecretVolume getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SecretVolume parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SecretVolume(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.SecretVolume getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/SecretVolumeOrBuilder.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/SecretVolumeOrBuilder.java new file mode 100644 index 00000000..c07d985b --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/SecretVolumeOrBuilder.java @@ -0,0 +1,175 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +public interface SecretVolumeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2alpha.SecretVolume) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The path within the container to mount the secret volume. For example,
+   * setting the mount_path as `/etc/secrets` would mount the secret value files
+   * under the `/etc/secrets` directory. This directory will also be completely
+   * shadowed and unavailable to mount any other secrets.
+   * Recommended mount path: /etc/secrets
+   * 
+ * + * string mount_path = 1; + * + * @return The mountPath. + */ + java.lang.String getMountPath(); + /** + * + * + *
+   * The path within the container to mount the secret volume. For example,
+   * setting the mount_path as `/etc/secrets` would mount the secret value files
+   * under the `/etc/secrets` directory. This directory will also be completely
+   * shadowed and unavailable to mount any other secrets.
+   * Recommended mount path: /etc/secrets
+   * 
+ * + * string mount_path = 1; + * + * @return The bytes for mountPath. + */ + com.google.protobuf.ByteString getMountPathBytes(); + + /** + * + * + *
+   * Project identifier (preferably project number but can also be the project
+   * ID) of the project that contains the secret. If not set, it is
+   * assumed that the secret is in the same project as the function.
+   * 
+ * + * string project_id = 2; + * + * @return The projectId. + */ + java.lang.String getProjectId(); + /** + * + * + *
+   * Project identifier (preferably project number but can also be the project
+   * ID) of the project that contains the secret. If not set, it is
+   * assumed that the secret is in the same project as the function.
+   * 
+ * + * string project_id = 2; + * + * @return The bytes for projectId. + */ + com.google.protobuf.ByteString getProjectIdBytes(); + + /** + * + * + *
+   * Name of the secret in secret manager (not the full resource name).
+   * 
+ * + * string secret = 3; + * + * @return The secret. + */ + java.lang.String getSecret(); + /** + * + * + *
+   * Name of the secret in secret manager (not the full resource name).
+   * 
+ * + * string secret = 3; + * + * @return The bytes for secret. + */ + com.google.protobuf.ByteString getSecretBytes(); + + /** + * + * + *
+   * List of secret versions to mount for this secret. If empty, the `latest`
+   * version of the secret will be made available in a file named after the
+   * secret under the mount point.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume.SecretVersion versions = 4; + */ + java.util.List getVersionsList(); + /** + * + * + *
+   * List of secret versions to mount for this secret. If empty, the `latest`
+   * version of the secret will be made available in a file named after the
+   * secret under the mount point.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume.SecretVersion versions = 4; + */ + com.google.cloud.functions.v2alpha.SecretVolume.SecretVersion getVersions(int index); + /** + * + * + *
+   * List of secret versions to mount for this secret. If empty, the `latest`
+   * version of the secret will be made available in a file named after the
+   * secret under the mount point.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume.SecretVersion versions = 4; + */ + int getVersionsCount(); + /** + * + * + *
+   * List of secret versions to mount for this secret. If empty, the `latest`
+   * version of the secret will be made available in a file named after the
+   * secret under the mount point.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume.SecretVersion versions = 4; + */ + java.util.List + getVersionsOrBuilderList(); + /** + * + * + *
+   * List of secret versions to mount for this secret. If empty, the `latest`
+   * version of the secret will be made available in a file named after the
+   * secret under the mount point.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume.SecretVersion versions = 4; + */ + com.google.cloud.functions.v2alpha.SecretVolume.SecretVersionOrBuilder getVersionsOrBuilder( + int index); +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/ServiceConfig.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/ServiceConfig.java new file mode 100644 index 00000000..e3cb0b63 --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/ServiceConfig.java @@ -0,0 +1,4168 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +/** + * + * + *
+ * Describes the Service being deployed.
+ * Currently Supported : Cloud Run (fully managed).
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.ServiceConfig} + */ +public final class ServiceConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2alpha.ServiceConfig) + ServiceConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use ServiceConfig.newBuilder() to construct. + private ServiceConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ServiceConfig() { + service_ = ""; + availableMemory_ = ""; + vpcConnector_ = ""; + vpcConnectorEgressSettings_ = 0; + ingressSettings_ = 0; + uri_ = ""; + serviceAccountEmail_ = ""; + secretEnvironmentVariables_ = java.util.Collections.emptyList(); + secretVolumes_ = java.util.Collections.emptyList(); + revision_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ServiceConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ServiceConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + service_ = s; + break; + } + case 16: + { + timeoutSeconds_ = input.readInt32(); + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + environmentVariables_ = + com.google.protobuf.MapField.newMapField( + EnvironmentVariablesDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry + environmentVariables__ = + input.readMessage( + EnvironmentVariablesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + environmentVariables_ + .getMutableMap() + .put(environmentVariables__.getKey(), environmentVariables__.getValue()); + break; + } + case 40: + { + maxInstanceCount_ = input.readInt32(); + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + vpcConnector_ = s; + break; + } + case 56: + { + int rawValue = input.readEnum(); + + vpcConnectorEgressSettings_ = rawValue; + break; + } + case 64: + { + int rawValue = input.readEnum(); + + ingressSettings_ = rawValue; + break; + } + case 74: + { + java.lang.String s = input.readStringRequireUtf8(); + + uri_ = s; + break; + } + case 82: + { + java.lang.String s = input.readStringRequireUtf8(); + + serviceAccountEmail_ = s; + break; + } + case 96: + { + minInstanceCount_ = input.readInt32(); + break; + } + case 106: + { + java.lang.String s = input.readStringRequireUtf8(); + + availableMemory_ = s; + break; + } + case 128: + { + allTrafficOnLatestRevision_ = input.readBool(); + break; + } + case 138: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + secretEnvironmentVariables_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + secretEnvironmentVariables_.add( + input.readMessage( + com.google.cloud.functions.v2alpha.SecretEnvVar.parser(), extensionRegistry)); + break; + } + case 146: + { + java.lang.String s = input.readStringRequireUtf8(); + + revision_ = s; + break; + } + case 154: + { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + secretVolumes_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + secretVolumes_.add( + input.readMessage( + com.google.cloud.functions.v2alpha.SecretVolume.parser(), extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) != 0)) { + secretEnvironmentVariables_ = + java.util.Collections.unmodifiableList(secretEnvironmentVariables_); + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + secretVolumes_ = java.util.Collections.unmodifiableList(secretVolumes_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_ServiceConfig_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetEnvironmentVariables(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_ServiceConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.ServiceConfig.class, + com.google.cloud.functions.v2alpha.ServiceConfig.Builder.class); + } + + /** + * + * + *
+   * Available egress settings.
+   * This controls what traffic is diverted through the VPC Access Connector
+   * resource. By default PRIVATE_RANGES_ONLY will be used.
+   * 
+ * + * Protobuf enum {@code google.cloud.functions.v2alpha.ServiceConfig.VpcConnectorEgressSettings} + */ + public enum VpcConnectorEgressSettings implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified.
+     * 
+ * + * VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED = 0; + */ + VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED(0), + /** + * + * + *
+     * Use the VPC Access Connector only for private IP space from RFC1918.
+     * 
+ * + * PRIVATE_RANGES_ONLY = 1; + */ + PRIVATE_RANGES_ONLY(1), + /** + * + * + *
+     * Force the use of VPC Access Connector for all egress traffic from the
+     * function.
+     * 
+ * + * ALL_TRAFFIC = 2; + */ + ALL_TRAFFIC(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified.
+     * 
+ * + * VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED = 0; + */ + public static final int VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Use the VPC Access Connector only for private IP space from RFC1918.
+     * 
+ * + * PRIVATE_RANGES_ONLY = 1; + */ + public static final int PRIVATE_RANGES_ONLY_VALUE = 1; + /** + * + * + *
+     * Force the use of VPC Access Connector for all egress traffic from the
+     * function.
+     * 
+ * + * ALL_TRAFFIC = 2; + */ + public static final int ALL_TRAFFIC_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static VpcConnectorEgressSettings valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static VpcConnectorEgressSettings forNumber(int value) { + switch (value) { + case 0: + return VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED; + case 1: + return PRIVATE_RANGES_ONLY; + case 2: + return ALL_TRAFFIC; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public VpcConnectorEgressSettings findValueByNumber(int number) { + return VpcConnectorEgressSettings.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.ServiceConfig.getDescriptor().getEnumTypes().get(0); + } + + private static final VpcConnectorEgressSettings[] VALUES = values(); + + public static VpcConnectorEgressSettings valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private VpcConnectorEgressSettings(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.functions.v2alpha.ServiceConfig.VpcConnectorEgressSettings) + } + + /** + * + * + *
+   * Available ingress settings.
+   * This controls what traffic can reach the function.
+   * If unspecified, ALLOW_ALL will be used.
+   * 
+ * + * Protobuf enum {@code google.cloud.functions.v2alpha.ServiceConfig.IngressSettings} + */ + public enum IngressSettings implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified.
+     * 
+ * + * INGRESS_SETTINGS_UNSPECIFIED = 0; + */ + INGRESS_SETTINGS_UNSPECIFIED(0), + /** + * + * + *
+     * Allow HTTP traffic from public and private sources.
+     * 
+ * + * ALLOW_ALL = 1; + */ + ALLOW_ALL(1), + /** + * + * + *
+     * Allow HTTP traffic from only private VPC sources.
+     * 
+ * + * ALLOW_INTERNAL_ONLY = 2; + */ + ALLOW_INTERNAL_ONLY(2), + /** + * + * + *
+     * Allow HTTP traffic from private VPC sources and through GCLB.
+     * 
+ * + * ALLOW_INTERNAL_AND_GCLB = 3; + */ + ALLOW_INTERNAL_AND_GCLB(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified.
+     * 
+ * + * INGRESS_SETTINGS_UNSPECIFIED = 0; + */ + public static final int INGRESS_SETTINGS_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Allow HTTP traffic from public and private sources.
+     * 
+ * + * ALLOW_ALL = 1; + */ + public static final int ALLOW_ALL_VALUE = 1; + /** + * + * + *
+     * Allow HTTP traffic from only private VPC sources.
+     * 
+ * + * ALLOW_INTERNAL_ONLY = 2; + */ + public static final int ALLOW_INTERNAL_ONLY_VALUE = 2; + /** + * + * + *
+     * Allow HTTP traffic from private VPC sources and through GCLB.
+     * 
+ * + * ALLOW_INTERNAL_AND_GCLB = 3; + */ + public static final int ALLOW_INTERNAL_AND_GCLB_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static IngressSettings valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static IngressSettings forNumber(int value) { + switch (value) { + case 0: + return INGRESS_SETTINGS_UNSPECIFIED; + case 1: + return ALLOW_ALL; + case 2: + return ALLOW_INTERNAL_ONLY; + case 3: + return ALLOW_INTERNAL_AND_GCLB; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public IngressSettings findValueByNumber(int number) { + return IngressSettings.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.ServiceConfig.getDescriptor().getEnumTypes().get(1); + } + + private static final IngressSettings[] VALUES = values(); + + public static IngressSettings valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private IngressSettings(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.functions.v2alpha.ServiceConfig.IngressSettings) + } + + public static final int SERVICE_FIELD_NUMBER = 1; + private volatile java.lang.Object service_; + /** + * + * + *
+   * Output only. Name of the service associated with a Function.
+   * The format of this field is
+   * `projects/{project}/locations/{region}/services/{service}`
+   * 
+ * + * + * string service = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The service. + */ + @java.lang.Override + public java.lang.String getService() { + java.lang.Object ref = service_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + service_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Name of the service associated with a Function.
+   * The format of this field is
+   * `projects/{project}/locations/{region}/services/{service}`
+   * 
+ * + * + * string service = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for service. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceBytes() { + java.lang.Object ref = service_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + service_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TIMEOUT_SECONDS_FIELD_NUMBER = 2; + private int timeoutSeconds_; + /** + * + * + *
+   * The function execution timeout. Execution is considered failed and
+   * can be terminated if the function is not completed at the end of the
+   * timeout period. Defaults to 60 seconds.
+   * 
+ * + * int32 timeout_seconds = 2; + * + * @return The timeoutSeconds. + */ + @java.lang.Override + public int getTimeoutSeconds() { + return timeoutSeconds_; + } + + public static final int AVAILABLE_MEMORY_FIELD_NUMBER = 13; + private volatile java.lang.Object availableMemory_; + /** + * + * + *
+   * The amount of memory available for a function.
+   * Defaults to 256M. Supported units are k, M, G, Mi, Gi. If no unit is
+   * supplied the value is interpreted as bytes.
+   * See
+   * https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go
+   * a full description.
+   * 
+ * + * string available_memory = 13; + * + * @return The availableMemory. + */ + @java.lang.Override + public java.lang.String getAvailableMemory() { + java.lang.Object ref = availableMemory_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + availableMemory_ = s; + return s; + } + } + /** + * + * + *
+   * The amount of memory available for a function.
+   * Defaults to 256M. Supported units are k, M, G, Mi, Gi. If no unit is
+   * supplied the value is interpreted as bytes.
+   * See
+   * https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go
+   * a full description.
+   * 
+ * + * string available_memory = 13; + * + * @return The bytes for availableMemory. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAvailableMemoryBytes() { + java.lang.Object ref = availableMemory_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + availableMemory_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENVIRONMENT_VARIABLES_FIELD_NUMBER = 4; + + private static final class EnvironmentVariablesDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_ServiceConfig_EnvironmentVariablesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField environmentVariables_; + + private com.google.protobuf.MapField + internalGetEnvironmentVariables() { + if (environmentVariables_ == null) { + return com.google.protobuf.MapField.emptyMapField( + EnvironmentVariablesDefaultEntryHolder.defaultEntry); + } + return environmentVariables_; + } + + public int getEnvironmentVariablesCount() { + return internalGetEnvironmentVariables().getMap().size(); + } + /** + * + * + *
+   * Environment variables that shall be available during function execution.
+   * 
+ * + * map<string, string> environment_variables = 4; + */ + @java.lang.Override + public boolean containsEnvironmentVariables(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetEnvironmentVariables().getMap().containsKey(key); + } + /** Use {@link #getEnvironmentVariablesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getEnvironmentVariables() { + return getEnvironmentVariablesMap(); + } + /** + * + * + *
+   * Environment variables that shall be available during function execution.
+   * 
+ * + * map<string, string> environment_variables = 4; + */ + @java.lang.Override + public java.util.Map getEnvironmentVariablesMap() { + return internalGetEnvironmentVariables().getMap(); + } + /** + * + * + *
+   * Environment variables that shall be available during function execution.
+   * 
+ * + * map<string, string> environment_variables = 4; + */ + @java.lang.Override + public java.lang.String getEnvironmentVariablesOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetEnvironmentVariables().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Environment variables that shall be available during function execution.
+   * 
+ * + * map<string, string> environment_variables = 4; + */ + @java.lang.Override + public java.lang.String getEnvironmentVariablesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetEnvironmentVariables().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int MAX_INSTANCE_COUNT_FIELD_NUMBER = 5; + private int maxInstanceCount_; + /** + * + * + *
+   * The limit on the maximum number of function instances that may coexist at a
+   * given time.
+   * In some cases, such as rapid traffic surges, Cloud Functions may, for a
+   * short period of time, create more instances than the specified max
+   * instances limit. If your function cannot tolerate this temporary behavior,
+   * you may want to factor in a safety margin and set a lower max instances
+   * value than your function can tolerate.
+   * See the [Max
+   * Instances](https://cloud.google.com/functions/docs/max-instances) Guide for
+   * more details.
+   * 
+ * + * int32 max_instance_count = 5; + * + * @return The maxInstanceCount. + */ + @java.lang.Override + public int getMaxInstanceCount() { + return maxInstanceCount_; + } + + public static final int MIN_INSTANCE_COUNT_FIELD_NUMBER = 12; + private int minInstanceCount_; + /** + * + * + *
+   * The limit on the minimum number of function instances that may coexist at a
+   * given time.
+   * Function instances are kept in idle state for a short period after they
+   * finished executing the request to reduce cold start time for subsequent
+   * requests. Setting a minimum instance count will ensure that the given
+   * number of instances are kept running in idle state always. This can help
+   * with cold start times when jump in incoming request count occurs after the
+   * idle instance would have been stopped in the default case.
+   * 
+ * + * int32 min_instance_count = 12; + * + * @return The minInstanceCount. + */ + @java.lang.Override + public int getMinInstanceCount() { + return minInstanceCount_; + } + + public static final int VPC_CONNECTOR_FIELD_NUMBER = 6; + private volatile java.lang.Object vpcConnector_; + /** + * + * + *
+   * The Serverless VPC Access connector that this cloud function can connect
+   * to. The format of this field is `projects/*/locations/*/connectors/*`.
+   * 
+ * + * string vpc_connector = 6 [(.google.api.resource_reference) = { ... } + * + * @return The vpcConnector. + */ + @java.lang.Override + public java.lang.String getVpcConnector() { + java.lang.Object ref = vpcConnector_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + vpcConnector_ = s; + return s; + } + } + /** + * + * + *
+   * The Serverless VPC Access connector that this cloud function can connect
+   * to. The format of this field is `projects/*/locations/*/connectors/*`.
+   * 
+ * + * string vpc_connector = 6 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for vpcConnector. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVpcConnectorBytes() { + java.lang.Object ref = vpcConnector_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + vpcConnector_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VPC_CONNECTOR_EGRESS_SETTINGS_FIELD_NUMBER = 7; + private int vpcConnectorEgressSettings_; + /** + * + * + *
+   * The egress settings for the connector, controlling what traffic is diverted
+   * through it.
+   * 
+ * + * + * .google.cloud.functions.v2alpha.ServiceConfig.VpcConnectorEgressSettings vpc_connector_egress_settings = 7; + * + * + * @return The enum numeric value on the wire for vpcConnectorEgressSettings. + */ + @java.lang.Override + public int getVpcConnectorEgressSettingsValue() { + return vpcConnectorEgressSettings_; + } + /** + * + * + *
+   * The egress settings for the connector, controlling what traffic is diverted
+   * through it.
+   * 
+ * + * + * .google.cloud.functions.v2alpha.ServiceConfig.VpcConnectorEgressSettings vpc_connector_egress_settings = 7; + * + * + * @return The vpcConnectorEgressSettings. + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.ServiceConfig.VpcConnectorEgressSettings + getVpcConnectorEgressSettings() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2alpha.ServiceConfig.VpcConnectorEgressSettings result = + com.google.cloud.functions.v2alpha.ServiceConfig.VpcConnectorEgressSettings.valueOf( + vpcConnectorEgressSettings_); + return result == null + ? com.google.cloud.functions.v2alpha.ServiceConfig.VpcConnectorEgressSettings.UNRECOGNIZED + : result; + } + + public static final int INGRESS_SETTINGS_FIELD_NUMBER = 8; + private int ingressSettings_; + /** + * + * + *
+   * The ingress settings for the function, controlling what traffic can reach
+   * it.
+   * 
+ * + * .google.cloud.functions.v2alpha.ServiceConfig.IngressSettings ingress_settings = 8; + * + * + * @return The enum numeric value on the wire for ingressSettings. + */ + @java.lang.Override + public int getIngressSettingsValue() { + return ingressSettings_; + } + /** + * + * + *
+   * The ingress settings for the function, controlling what traffic can reach
+   * it.
+   * 
+ * + * .google.cloud.functions.v2alpha.ServiceConfig.IngressSettings ingress_settings = 8; + * + * + * @return The ingressSettings. + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.ServiceConfig.IngressSettings getIngressSettings() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2alpha.ServiceConfig.IngressSettings result = + com.google.cloud.functions.v2alpha.ServiceConfig.IngressSettings.valueOf(ingressSettings_); + return result == null + ? com.google.cloud.functions.v2alpha.ServiceConfig.IngressSettings.UNRECOGNIZED + : result; + } + + public static final int URI_FIELD_NUMBER = 9; + private volatile java.lang.Object uri_; + /** + * + * + *
+   * Output only. URI of the Service deployed.
+   * 
+ * + * string uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uri. + */ + @java.lang.Override + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. URI of the Service deployed.
+   * 
+ * + * string uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVICE_ACCOUNT_EMAIL_FIELD_NUMBER = 10; + private volatile java.lang.Object serviceAccountEmail_; + /** + * + * + *
+   * The email of the service's service account. If empty, defaults to
+   * `{project_number}-compute@developer.gserviceaccount.com`.
+   * 
+ * + * string service_account_email = 10; + * + * @return The serviceAccountEmail. + */ + @java.lang.Override + public java.lang.String getServiceAccountEmail() { + java.lang.Object ref = serviceAccountEmail_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAccountEmail_ = s; + return s; + } + } + /** + * + * + *
+   * The email of the service's service account. If empty, defaults to
+   * `{project_number}-compute@developer.gserviceaccount.com`.
+   * 
+ * + * string service_account_email = 10; + * + * @return The bytes for serviceAccountEmail. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceAccountEmailBytes() { + java.lang.Object ref = serviceAccountEmail_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAccountEmail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ALL_TRAFFIC_ON_LATEST_REVISION_FIELD_NUMBER = 16; + private boolean allTrafficOnLatestRevision_; + /** + * + * + *
+   * Whether 100% of traffic is routed to the latest revision.
+   * On CreateFunction and UpdateFunction, when set to true, the revision being
+   * deployed will serve 100% of traffic, ignoring any traffic split settings,
+   * if any. On GetFunction, true will be returned if the latest revision is
+   * serving 100% of traffic.
+   * 
+ * + * bool all_traffic_on_latest_revision = 16; + * + * @return The allTrafficOnLatestRevision. + */ + @java.lang.Override + public boolean getAllTrafficOnLatestRevision() { + return allTrafficOnLatestRevision_; + } + + public static final int SECRET_ENVIRONMENT_VARIABLES_FIELD_NUMBER = 17; + private java.util.List + secretEnvironmentVariables_; + /** + * + * + *
+   * Secret environment variables configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretEnvVar secret_environment_variables = 17; + * + */ + @java.lang.Override + public java.util.List + getSecretEnvironmentVariablesList() { + return secretEnvironmentVariables_; + } + /** + * + * + *
+   * Secret environment variables configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretEnvVar secret_environment_variables = 17; + * + */ + @java.lang.Override + public java.util.List + getSecretEnvironmentVariablesOrBuilderList() { + return secretEnvironmentVariables_; + } + /** + * + * + *
+   * Secret environment variables configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretEnvVar secret_environment_variables = 17; + * + */ + @java.lang.Override + public int getSecretEnvironmentVariablesCount() { + return secretEnvironmentVariables_.size(); + } + /** + * + * + *
+   * Secret environment variables configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretEnvVar secret_environment_variables = 17; + * + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.SecretEnvVar getSecretEnvironmentVariables(int index) { + return secretEnvironmentVariables_.get(index); + } + /** + * + * + *
+   * Secret environment variables configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretEnvVar secret_environment_variables = 17; + * + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.SecretEnvVarOrBuilder + getSecretEnvironmentVariablesOrBuilder(int index) { + return secretEnvironmentVariables_.get(index); + } + + public static final int SECRET_VOLUMES_FIELD_NUMBER = 19; + private java.util.List secretVolumes_; + /** + * + * + *
+   * Secret volumes configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume secret_volumes = 19; + */ + @java.lang.Override + public java.util.List getSecretVolumesList() { + return secretVolumes_; + } + /** + * + * + *
+   * Secret volumes configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume secret_volumes = 19; + */ + @java.lang.Override + public java.util.List + getSecretVolumesOrBuilderList() { + return secretVolumes_; + } + /** + * + * + *
+   * Secret volumes configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume secret_volumes = 19; + */ + @java.lang.Override + public int getSecretVolumesCount() { + return secretVolumes_.size(); + } + /** + * + * + *
+   * Secret volumes configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume secret_volumes = 19; + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.SecretVolume getSecretVolumes(int index) { + return secretVolumes_.get(index); + } + /** + * + * + *
+   * Secret volumes configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume secret_volumes = 19; + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.SecretVolumeOrBuilder getSecretVolumesOrBuilder( + int index) { + return secretVolumes_.get(index); + } + + public static final int REVISION_FIELD_NUMBER = 18; + private volatile java.lang.Object revision_; + /** + * + * + *
+   * Output only. The name of service revision.
+   * 
+ * + * string revision = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The revision. + */ + @java.lang.Override + public java.lang.String getRevision() { + java.lang.Object ref = revision_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + revision_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The name of service revision.
+   * 
+ * + * string revision = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for revision. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRevisionBytes() { + java.lang.Object ref = revision_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + revision_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(service_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, service_); + } + if (timeoutSeconds_ != 0) { + output.writeInt32(2, timeoutSeconds_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, + internalGetEnvironmentVariables(), + EnvironmentVariablesDefaultEntryHolder.defaultEntry, + 4); + if (maxInstanceCount_ != 0) { + output.writeInt32(5, maxInstanceCount_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(vpcConnector_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, vpcConnector_); + } + if (vpcConnectorEgressSettings_ + != com.google.cloud.functions.v2alpha.ServiceConfig.VpcConnectorEgressSettings + .VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED + .getNumber()) { + output.writeEnum(7, vpcConnectorEgressSettings_); + } + if (ingressSettings_ + != com.google.cloud.functions.v2alpha.ServiceConfig.IngressSettings + .INGRESS_SETTINGS_UNSPECIFIED + .getNumber()) { + output.writeEnum(8, ingressSettings_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, uri_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccountEmail_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, serviceAccountEmail_); + } + if (minInstanceCount_ != 0) { + output.writeInt32(12, minInstanceCount_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(availableMemory_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 13, availableMemory_); + } + if (allTrafficOnLatestRevision_ != false) { + output.writeBool(16, allTrafficOnLatestRevision_); + } + for (int i = 0; i < secretEnvironmentVariables_.size(); i++) { + output.writeMessage(17, secretEnvironmentVariables_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(revision_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 18, revision_); + } + for (int i = 0; i < secretVolumes_.size(); i++) { + output.writeMessage(19, secretVolumes_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(service_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, service_); + } + if (timeoutSeconds_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, timeoutSeconds_); + } + for (java.util.Map.Entry entry : + internalGetEnvironmentVariables().getMap().entrySet()) { + com.google.protobuf.MapEntry environmentVariables__ = + EnvironmentVariablesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, environmentVariables__); + } + if (maxInstanceCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(5, maxInstanceCount_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(vpcConnector_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, vpcConnector_); + } + if (vpcConnectorEgressSettings_ + != com.google.cloud.functions.v2alpha.ServiceConfig.VpcConnectorEgressSettings + .VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, vpcConnectorEgressSettings_); + } + if (ingressSettings_ + != com.google.cloud.functions.v2alpha.ServiceConfig.IngressSettings + .INGRESS_SETTINGS_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, ingressSettings_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, uri_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccountEmail_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, serviceAccountEmail_); + } + if (minInstanceCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(12, minInstanceCount_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(availableMemory_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, availableMemory_); + } + if (allTrafficOnLatestRevision_ != false) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize(16, allTrafficOnLatestRevision_); + } + for (int i = 0; i < secretEnvironmentVariables_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 17, secretEnvironmentVariables_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(revision_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(18, revision_); + } + for (int i = 0; i < secretVolumes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(19, secretVolumes_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2alpha.ServiceConfig)) { + return super.equals(obj); + } + com.google.cloud.functions.v2alpha.ServiceConfig other = + (com.google.cloud.functions.v2alpha.ServiceConfig) obj; + + if (!getService().equals(other.getService())) return false; + if (getTimeoutSeconds() != other.getTimeoutSeconds()) return false; + if (!getAvailableMemory().equals(other.getAvailableMemory())) return false; + if (!internalGetEnvironmentVariables().equals(other.internalGetEnvironmentVariables())) + return false; + if (getMaxInstanceCount() != other.getMaxInstanceCount()) return false; + if (getMinInstanceCount() != other.getMinInstanceCount()) return false; + if (!getVpcConnector().equals(other.getVpcConnector())) return false; + if (vpcConnectorEgressSettings_ != other.vpcConnectorEgressSettings_) return false; + if (ingressSettings_ != other.ingressSettings_) return false; + if (!getUri().equals(other.getUri())) return false; + if (!getServiceAccountEmail().equals(other.getServiceAccountEmail())) return false; + if (getAllTrafficOnLatestRevision() != other.getAllTrafficOnLatestRevision()) return false; + if (!getSecretEnvironmentVariablesList().equals(other.getSecretEnvironmentVariablesList())) + return false; + if (!getSecretVolumesList().equals(other.getSecretVolumesList())) return false; + if (!getRevision().equals(other.getRevision())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SERVICE_FIELD_NUMBER; + hash = (53 * hash) + getService().hashCode(); + hash = (37 * hash) + TIMEOUT_SECONDS_FIELD_NUMBER; + hash = (53 * hash) + getTimeoutSeconds(); + hash = (37 * hash) + AVAILABLE_MEMORY_FIELD_NUMBER; + hash = (53 * hash) + getAvailableMemory().hashCode(); + if (!internalGetEnvironmentVariables().getMap().isEmpty()) { + hash = (37 * hash) + ENVIRONMENT_VARIABLES_FIELD_NUMBER; + hash = (53 * hash) + internalGetEnvironmentVariables().hashCode(); + } + hash = (37 * hash) + MAX_INSTANCE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getMaxInstanceCount(); + hash = (37 * hash) + MIN_INSTANCE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getMinInstanceCount(); + hash = (37 * hash) + VPC_CONNECTOR_FIELD_NUMBER; + hash = (53 * hash) + getVpcConnector().hashCode(); + hash = (37 * hash) + VPC_CONNECTOR_EGRESS_SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + vpcConnectorEgressSettings_; + hash = (37 * hash) + INGRESS_SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + ingressSettings_; + hash = (37 * hash) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + hash = (37 * hash) + SERVICE_ACCOUNT_EMAIL_FIELD_NUMBER; + hash = (53 * hash) + getServiceAccountEmail().hashCode(); + hash = (37 * hash) + ALL_TRAFFIC_ON_LATEST_REVISION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllTrafficOnLatestRevision()); + if (getSecretEnvironmentVariablesCount() > 0) { + hash = (37 * hash) + SECRET_ENVIRONMENT_VARIABLES_FIELD_NUMBER; + hash = (53 * hash) + getSecretEnvironmentVariablesList().hashCode(); + } + if (getSecretVolumesCount() > 0) { + hash = (37 * hash) + SECRET_VOLUMES_FIELD_NUMBER; + hash = (53 * hash) + getSecretVolumesList().hashCode(); + } + hash = (37 * hash) + REVISION_FIELD_NUMBER; + hash = (53 * hash) + getRevision().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2alpha.ServiceConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.ServiceConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.ServiceConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.ServiceConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.ServiceConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.ServiceConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.ServiceConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.ServiceConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.ServiceConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.ServiceConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.ServiceConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.ServiceConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v2alpha.ServiceConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Describes the Service being deployed.
+   * Currently Supported : Cloud Run (fully managed).
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.ServiceConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2alpha.ServiceConfig) + com.google.cloud.functions.v2alpha.ServiceConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_ServiceConfig_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetEnvironmentVariables(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 4: + return internalGetMutableEnvironmentVariables(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_ServiceConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.ServiceConfig.class, + com.google.cloud.functions.v2alpha.ServiceConfig.Builder.class); + } + + // Construct using com.google.cloud.functions.v2alpha.ServiceConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getSecretEnvironmentVariablesFieldBuilder(); + getSecretVolumesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + service_ = ""; + + timeoutSeconds_ = 0; + + availableMemory_ = ""; + + internalGetMutableEnvironmentVariables().clear(); + maxInstanceCount_ = 0; + + minInstanceCount_ = 0; + + vpcConnector_ = ""; + + vpcConnectorEgressSettings_ = 0; + + ingressSettings_ = 0; + + uri_ = ""; + + serviceAccountEmail_ = ""; + + allTrafficOnLatestRevision_ = false; + + if (secretEnvironmentVariablesBuilder_ == null) { + secretEnvironmentVariables_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + secretEnvironmentVariablesBuilder_.clear(); + } + if (secretVolumesBuilder_ == null) { + secretVolumes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + secretVolumesBuilder_.clear(); + } + revision_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_ServiceConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.ServiceConfig getDefaultInstanceForType() { + return com.google.cloud.functions.v2alpha.ServiceConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.ServiceConfig build() { + com.google.cloud.functions.v2alpha.ServiceConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.ServiceConfig buildPartial() { + com.google.cloud.functions.v2alpha.ServiceConfig result = + new com.google.cloud.functions.v2alpha.ServiceConfig(this); + int from_bitField0_ = bitField0_; + result.service_ = service_; + result.timeoutSeconds_ = timeoutSeconds_; + result.availableMemory_ = availableMemory_; + result.environmentVariables_ = internalGetEnvironmentVariables(); + result.environmentVariables_.makeImmutable(); + result.maxInstanceCount_ = maxInstanceCount_; + result.minInstanceCount_ = minInstanceCount_; + result.vpcConnector_ = vpcConnector_; + result.vpcConnectorEgressSettings_ = vpcConnectorEgressSettings_; + result.ingressSettings_ = ingressSettings_; + result.uri_ = uri_; + result.serviceAccountEmail_ = serviceAccountEmail_; + result.allTrafficOnLatestRevision_ = allTrafficOnLatestRevision_; + if (secretEnvironmentVariablesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + secretEnvironmentVariables_ = + java.util.Collections.unmodifiableList(secretEnvironmentVariables_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.secretEnvironmentVariables_ = secretEnvironmentVariables_; + } else { + result.secretEnvironmentVariables_ = secretEnvironmentVariablesBuilder_.build(); + } + if (secretVolumesBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + secretVolumes_ = java.util.Collections.unmodifiableList(secretVolumes_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.secretVolumes_ = secretVolumes_; + } else { + result.secretVolumes_ = secretVolumesBuilder_.build(); + } + result.revision_ = revision_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2alpha.ServiceConfig) { + return mergeFrom((com.google.cloud.functions.v2alpha.ServiceConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2alpha.ServiceConfig other) { + if (other == com.google.cloud.functions.v2alpha.ServiceConfig.getDefaultInstance()) + return this; + if (!other.getService().isEmpty()) { + service_ = other.service_; + onChanged(); + } + if (other.getTimeoutSeconds() != 0) { + setTimeoutSeconds(other.getTimeoutSeconds()); + } + if (!other.getAvailableMemory().isEmpty()) { + availableMemory_ = other.availableMemory_; + onChanged(); + } + internalGetMutableEnvironmentVariables().mergeFrom(other.internalGetEnvironmentVariables()); + if (other.getMaxInstanceCount() != 0) { + setMaxInstanceCount(other.getMaxInstanceCount()); + } + if (other.getMinInstanceCount() != 0) { + setMinInstanceCount(other.getMinInstanceCount()); + } + if (!other.getVpcConnector().isEmpty()) { + vpcConnector_ = other.vpcConnector_; + onChanged(); + } + if (other.vpcConnectorEgressSettings_ != 0) { + setVpcConnectorEgressSettingsValue(other.getVpcConnectorEgressSettingsValue()); + } + if (other.ingressSettings_ != 0) { + setIngressSettingsValue(other.getIngressSettingsValue()); + } + if (!other.getUri().isEmpty()) { + uri_ = other.uri_; + onChanged(); + } + if (!other.getServiceAccountEmail().isEmpty()) { + serviceAccountEmail_ = other.serviceAccountEmail_; + onChanged(); + } + if (other.getAllTrafficOnLatestRevision() != false) { + setAllTrafficOnLatestRevision(other.getAllTrafficOnLatestRevision()); + } + if (secretEnvironmentVariablesBuilder_ == null) { + if (!other.secretEnvironmentVariables_.isEmpty()) { + if (secretEnvironmentVariables_.isEmpty()) { + secretEnvironmentVariables_ = other.secretEnvironmentVariables_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureSecretEnvironmentVariablesIsMutable(); + secretEnvironmentVariables_.addAll(other.secretEnvironmentVariables_); + } + onChanged(); + } + } else { + if (!other.secretEnvironmentVariables_.isEmpty()) { + if (secretEnvironmentVariablesBuilder_.isEmpty()) { + secretEnvironmentVariablesBuilder_.dispose(); + secretEnvironmentVariablesBuilder_ = null; + secretEnvironmentVariables_ = other.secretEnvironmentVariables_; + bitField0_ = (bitField0_ & ~0x00000002); + secretEnvironmentVariablesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSecretEnvironmentVariablesFieldBuilder() + : null; + } else { + secretEnvironmentVariablesBuilder_.addAllMessages(other.secretEnvironmentVariables_); + } + } + } + if (secretVolumesBuilder_ == null) { + if (!other.secretVolumes_.isEmpty()) { + if (secretVolumes_.isEmpty()) { + secretVolumes_ = other.secretVolumes_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureSecretVolumesIsMutable(); + secretVolumes_.addAll(other.secretVolumes_); + } + onChanged(); + } + } else { + if (!other.secretVolumes_.isEmpty()) { + if (secretVolumesBuilder_.isEmpty()) { + secretVolumesBuilder_.dispose(); + secretVolumesBuilder_ = null; + secretVolumes_ = other.secretVolumes_; + bitField0_ = (bitField0_ & ~0x00000004); + secretVolumesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSecretVolumesFieldBuilder() + : null; + } else { + secretVolumesBuilder_.addAllMessages(other.secretVolumes_); + } + } + } + if (!other.getRevision().isEmpty()) { + revision_ = other.revision_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2alpha.ServiceConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v2alpha.ServiceConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object service_ = ""; + /** + * + * + *
+     * Output only. Name of the service associated with a Function.
+     * The format of this field is
+     * `projects/{project}/locations/{region}/services/{service}`
+     * 
+ * + * + * string service = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The service. + */ + public java.lang.String getService() { + java.lang.Object ref = service_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + service_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Name of the service associated with a Function.
+     * The format of this field is
+     * `projects/{project}/locations/{region}/services/{service}`
+     * 
+ * + * + * string service = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for service. + */ + public com.google.protobuf.ByteString getServiceBytes() { + java.lang.Object ref = service_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + service_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Name of the service associated with a Function.
+     * The format of this field is
+     * `projects/{project}/locations/{region}/services/{service}`
+     * 
+ * + * + * string service = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The service to set. + * @return This builder for chaining. + */ + public Builder setService(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + service_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the service associated with a Function.
+     * The format of this field is
+     * `projects/{project}/locations/{region}/services/{service}`
+     * 
+ * + * + * string service = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearService() { + + service_ = getDefaultInstance().getService(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the service associated with a Function.
+     * The format of this field is
+     * `projects/{project}/locations/{region}/services/{service}`
+     * 
+ * + * + * string service = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for service to set. + * @return This builder for chaining. + */ + public Builder setServiceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + service_ = value; + onChanged(); + return this; + } + + private int timeoutSeconds_; + /** + * + * + *
+     * The function execution timeout. Execution is considered failed and
+     * can be terminated if the function is not completed at the end of the
+     * timeout period. Defaults to 60 seconds.
+     * 
+ * + * int32 timeout_seconds = 2; + * + * @return The timeoutSeconds. + */ + @java.lang.Override + public int getTimeoutSeconds() { + return timeoutSeconds_; + } + /** + * + * + *
+     * The function execution timeout. Execution is considered failed and
+     * can be terminated if the function is not completed at the end of the
+     * timeout period. Defaults to 60 seconds.
+     * 
+ * + * int32 timeout_seconds = 2; + * + * @param value The timeoutSeconds to set. + * @return This builder for chaining. + */ + public Builder setTimeoutSeconds(int value) { + + timeoutSeconds_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The function execution timeout. Execution is considered failed and
+     * can be terminated if the function is not completed at the end of the
+     * timeout period. Defaults to 60 seconds.
+     * 
+ * + * int32 timeout_seconds = 2; + * + * @return This builder for chaining. + */ + public Builder clearTimeoutSeconds() { + + timeoutSeconds_ = 0; + onChanged(); + return this; + } + + private java.lang.Object availableMemory_ = ""; + /** + * + * + *
+     * The amount of memory available for a function.
+     * Defaults to 256M. Supported units are k, M, G, Mi, Gi. If no unit is
+     * supplied the value is interpreted as bytes.
+     * See
+     * https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go
+     * a full description.
+     * 
+ * + * string available_memory = 13; + * + * @return The availableMemory. + */ + public java.lang.String getAvailableMemory() { + java.lang.Object ref = availableMemory_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + availableMemory_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The amount of memory available for a function.
+     * Defaults to 256M. Supported units are k, M, G, Mi, Gi. If no unit is
+     * supplied the value is interpreted as bytes.
+     * See
+     * https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go
+     * a full description.
+     * 
+ * + * string available_memory = 13; + * + * @return The bytes for availableMemory. + */ + public com.google.protobuf.ByteString getAvailableMemoryBytes() { + java.lang.Object ref = availableMemory_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + availableMemory_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The amount of memory available for a function.
+     * Defaults to 256M. Supported units are k, M, G, Mi, Gi. If no unit is
+     * supplied the value is interpreted as bytes.
+     * See
+     * https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go
+     * a full description.
+     * 
+ * + * string available_memory = 13; + * + * @param value The availableMemory to set. + * @return This builder for chaining. + */ + public Builder setAvailableMemory(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + availableMemory_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The amount of memory available for a function.
+     * Defaults to 256M. Supported units are k, M, G, Mi, Gi. If no unit is
+     * supplied the value is interpreted as bytes.
+     * See
+     * https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go
+     * a full description.
+     * 
+ * + * string available_memory = 13; + * + * @return This builder for chaining. + */ + public Builder clearAvailableMemory() { + + availableMemory_ = getDefaultInstance().getAvailableMemory(); + onChanged(); + return this; + } + /** + * + * + *
+     * The amount of memory available for a function.
+     * Defaults to 256M. Supported units are k, M, G, Mi, Gi. If no unit is
+     * supplied the value is interpreted as bytes.
+     * See
+     * https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go
+     * a full description.
+     * 
+ * + * string available_memory = 13; + * + * @param value The bytes for availableMemory to set. + * @return This builder for chaining. + */ + public Builder setAvailableMemoryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + availableMemory_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField environmentVariables_; + + private com.google.protobuf.MapField + internalGetEnvironmentVariables() { + if (environmentVariables_ == null) { + return com.google.protobuf.MapField.emptyMapField( + EnvironmentVariablesDefaultEntryHolder.defaultEntry); + } + return environmentVariables_; + } + + private com.google.protobuf.MapField + internalGetMutableEnvironmentVariables() { + onChanged(); + ; + if (environmentVariables_ == null) { + environmentVariables_ = + com.google.protobuf.MapField.newMapField( + EnvironmentVariablesDefaultEntryHolder.defaultEntry); + } + if (!environmentVariables_.isMutable()) { + environmentVariables_ = environmentVariables_.copy(); + } + return environmentVariables_; + } + + public int getEnvironmentVariablesCount() { + return internalGetEnvironmentVariables().getMap().size(); + } + /** + * + * + *
+     * Environment variables that shall be available during function execution.
+     * 
+ * + * map<string, string> environment_variables = 4; + */ + @java.lang.Override + public boolean containsEnvironmentVariables(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetEnvironmentVariables().getMap().containsKey(key); + } + /** Use {@link #getEnvironmentVariablesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getEnvironmentVariables() { + return getEnvironmentVariablesMap(); + } + /** + * + * + *
+     * Environment variables that shall be available during function execution.
+     * 
+ * + * map<string, string> environment_variables = 4; + */ + @java.lang.Override + public java.util.Map getEnvironmentVariablesMap() { + return internalGetEnvironmentVariables().getMap(); + } + /** + * + * + *
+     * Environment variables that shall be available during function execution.
+     * 
+ * + * map<string, string> environment_variables = 4; + */ + @java.lang.Override + public java.lang.String getEnvironmentVariablesOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetEnvironmentVariables().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Environment variables that shall be available during function execution.
+     * 
+ * + * map<string, string> environment_variables = 4; + */ + @java.lang.Override + public java.lang.String getEnvironmentVariablesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetEnvironmentVariables().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearEnvironmentVariables() { + internalGetMutableEnvironmentVariables().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Environment variables that shall be available during function execution.
+     * 
+ * + * map<string, string> environment_variables = 4; + */ + public Builder removeEnvironmentVariables(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableEnvironmentVariables().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableEnvironmentVariables() { + return internalGetMutableEnvironmentVariables().getMutableMap(); + } + /** + * + * + *
+     * Environment variables that shall be available during function execution.
+     * 
+ * + * map<string, string> environment_variables = 4; + */ + public Builder putEnvironmentVariables(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableEnvironmentVariables().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Environment variables that shall be available during function execution.
+     * 
+ * + * map<string, string> environment_variables = 4; + */ + public Builder putAllEnvironmentVariables( + java.util.Map values) { + internalGetMutableEnvironmentVariables().getMutableMap().putAll(values); + return this; + } + + private int maxInstanceCount_; + /** + * + * + *
+     * The limit on the maximum number of function instances that may coexist at a
+     * given time.
+     * In some cases, such as rapid traffic surges, Cloud Functions may, for a
+     * short period of time, create more instances than the specified max
+     * instances limit. If your function cannot tolerate this temporary behavior,
+     * you may want to factor in a safety margin and set a lower max instances
+     * value than your function can tolerate.
+     * See the [Max
+     * Instances](https://cloud.google.com/functions/docs/max-instances) Guide for
+     * more details.
+     * 
+ * + * int32 max_instance_count = 5; + * + * @return The maxInstanceCount. + */ + @java.lang.Override + public int getMaxInstanceCount() { + return maxInstanceCount_; + } + /** + * + * + *
+     * The limit on the maximum number of function instances that may coexist at a
+     * given time.
+     * In some cases, such as rapid traffic surges, Cloud Functions may, for a
+     * short period of time, create more instances than the specified max
+     * instances limit. If your function cannot tolerate this temporary behavior,
+     * you may want to factor in a safety margin and set a lower max instances
+     * value than your function can tolerate.
+     * See the [Max
+     * Instances](https://cloud.google.com/functions/docs/max-instances) Guide for
+     * more details.
+     * 
+ * + * int32 max_instance_count = 5; + * + * @param value The maxInstanceCount to set. + * @return This builder for chaining. + */ + public Builder setMaxInstanceCount(int value) { + + maxInstanceCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The limit on the maximum number of function instances that may coexist at a
+     * given time.
+     * In some cases, such as rapid traffic surges, Cloud Functions may, for a
+     * short period of time, create more instances than the specified max
+     * instances limit. If your function cannot tolerate this temporary behavior,
+     * you may want to factor in a safety margin and set a lower max instances
+     * value than your function can tolerate.
+     * See the [Max
+     * Instances](https://cloud.google.com/functions/docs/max-instances) Guide for
+     * more details.
+     * 
+ * + * int32 max_instance_count = 5; + * + * @return This builder for chaining. + */ + public Builder clearMaxInstanceCount() { + + maxInstanceCount_ = 0; + onChanged(); + return this; + } + + private int minInstanceCount_; + /** + * + * + *
+     * The limit on the minimum number of function instances that may coexist at a
+     * given time.
+     * Function instances are kept in idle state for a short period after they
+     * finished executing the request to reduce cold start time for subsequent
+     * requests. Setting a minimum instance count will ensure that the given
+     * number of instances are kept running in idle state always. This can help
+     * with cold start times when jump in incoming request count occurs after the
+     * idle instance would have been stopped in the default case.
+     * 
+ * + * int32 min_instance_count = 12; + * + * @return The minInstanceCount. + */ + @java.lang.Override + public int getMinInstanceCount() { + return minInstanceCount_; + } + /** + * + * + *
+     * The limit on the minimum number of function instances that may coexist at a
+     * given time.
+     * Function instances are kept in idle state for a short period after they
+     * finished executing the request to reduce cold start time for subsequent
+     * requests. Setting a minimum instance count will ensure that the given
+     * number of instances are kept running in idle state always. This can help
+     * with cold start times when jump in incoming request count occurs after the
+     * idle instance would have been stopped in the default case.
+     * 
+ * + * int32 min_instance_count = 12; + * + * @param value The minInstanceCount to set. + * @return This builder for chaining. + */ + public Builder setMinInstanceCount(int value) { + + minInstanceCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The limit on the minimum number of function instances that may coexist at a
+     * given time.
+     * Function instances are kept in idle state for a short period after they
+     * finished executing the request to reduce cold start time for subsequent
+     * requests. Setting a minimum instance count will ensure that the given
+     * number of instances are kept running in idle state always. This can help
+     * with cold start times when jump in incoming request count occurs after the
+     * idle instance would have been stopped in the default case.
+     * 
+ * + * int32 min_instance_count = 12; + * + * @return This builder for chaining. + */ + public Builder clearMinInstanceCount() { + + minInstanceCount_ = 0; + onChanged(); + return this; + } + + private java.lang.Object vpcConnector_ = ""; + /** + * + * + *
+     * The Serverless VPC Access connector that this cloud function can connect
+     * to. The format of this field is `projects/*/locations/*/connectors/*`.
+     * 
+ * + * string vpc_connector = 6 [(.google.api.resource_reference) = { ... } + * + * @return The vpcConnector. + */ + public java.lang.String getVpcConnector() { + java.lang.Object ref = vpcConnector_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + vpcConnector_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The Serverless VPC Access connector that this cloud function can connect
+     * to. The format of this field is `projects/*/locations/*/connectors/*`.
+     * 
+ * + * string vpc_connector = 6 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for vpcConnector. + */ + public com.google.protobuf.ByteString getVpcConnectorBytes() { + java.lang.Object ref = vpcConnector_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + vpcConnector_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The Serverless VPC Access connector that this cloud function can connect
+     * to. The format of this field is `projects/*/locations/*/connectors/*`.
+     * 
+ * + * string vpc_connector = 6 [(.google.api.resource_reference) = { ... } + * + * @param value The vpcConnector to set. + * @return This builder for chaining. + */ + public Builder setVpcConnector(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + vpcConnector_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The Serverless VPC Access connector that this cloud function can connect
+     * to. The format of this field is `projects/*/locations/*/connectors/*`.
+     * 
+ * + * string vpc_connector = 6 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearVpcConnector() { + + vpcConnector_ = getDefaultInstance().getVpcConnector(); + onChanged(); + return this; + } + /** + * + * + *
+     * The Serverless VPC Access connector that this cloud function can connect
+     * to. The format of this field is `projects/*/locations/*/connectors/*`.
+     * 
+ * + * string vpc_connector = 6 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for vpcConnector to set. + * @return This builder for chaining. + */ + public Builder setVpcConnectorBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + vpcConnector_ = value; + onChanged(); + return this; + } + + private int vpcConnectorEgressSettings_ = 0; + /** + * + * + *
+     * The egress settings for the connector, controlling what traffic is diverted
+     * through it.
+     * 
+ * + * + * .google.cloud.functions.v2alpha.ServiceConfig.VpcConnectorEgressSettings vpc_connector_egress_settings = 7; + * + * + * @return The enum numeric value on the wire for vpcConnectorEgressSettings. + */ + @java.lang.Override + public int getVpcConnectorEgressSettingsValue() { + return vpcConnectorEgressSettings_; + } + /** + * + * + *
+     * The egress settings for the connector, controlling what traffic is diverted
+     * through it.
+     * 
+ * + * + * .google.cloud.functions.v2alpha.ServiceConfig.VpcConnectorEgressSettings vpc_connector_egress_settings = 7; + * + * + * @param value The enum numeric value on the wire for vpcConnectorEgressSettings to set. + * @return This builder for chaining. + */ + public Builder setVpcConnectorEgressSettingsValue(int value) { + + vpcConnectorEgressSettings_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The egress settings for the connector, controlling what traffic is diverted
+     * through it.
+     * 
+ * + * + * .google.cloud.functions.v2alpha.ServiceConfig.VpcConnectorEgressSettings vpc_connector_egress_settings = 7; + * + * + * @return The vpcConnectorEgressSettings. + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.ServiceConfig.VpcConnectorEgressSettings + getVpcConnectorEgressSettings() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2alpha.ServiceConfig.VpcConnectorEgressSettings result = + com.google.cloud.functions.v2alpha.ServiceConfig.VpcConnectorEgressSettings.valueOf( + vpcConnectorEgressSettings_); + return result == null + ? com.google.cloud.functions.v2alpha.ServiceConfig.VpcConnectorEgressSettings.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The egress settings for the connector, controlling what traffic is diverted
+     * through it.
+     * 
+ * + * + * .google.cloud.functions.v2alpha.ServiceConfig.VpcConnectorEgressSettings vpc_connector_egress_settings = 7; + * + * + * @param value The vpcConnectorEgressSettings to set. + * @return This builder for chaining. + */ + public Builder setVpcConnectorEgressSettings( + com.google.cloud.functions.v2alpha.ServiceConfig.VpcConnectorEgressSettings value) { + if (value == null) { + throw new NullPointerException(); + } + + vpcConnectorEgressSettings_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The egress settings for the connector, controlling what traffic is diverted
+     * through it.
+     * 
+ * + * + * .google.cloud.functions.v2alpha.ServiceConfig.VpcConnectorEgressSettings vpc_connector_egress_settings = 7; + * + * + * @return This builder for chaining. + */ + public Builder clearVpcConnectorEgressSettings() { + + vpcConnectorEgressSettings_ = 0; + onChanged(); + return this; + } + + private int ingressSettings_ = 0; + /** + * + * + *
+     * The ingress settings for the function, controlling what traffic can reach
+     * it.
+     * 
+ * + * .google.cloud.functions.v2alpha.ServiceConfig.IngressSettings ingress_settings = 8; + * + * + * @return The enum numeric value on the wire for ingressSettings. + */ + @java.lang.Override + public int getIngressSettingsValue() { + return ingressSettings_; + } + /** + * + * + *
+     * The ingress settings for the function, controlling what traffic can reach
+     * it.
+     * 
+ * + * .google.cloud.functions.v2alpha.ServiceConfig.IngressSettings ingress_settings = 8; + * + * + * @param value The enum numeric value on the wire for ingressSettings to set. + * @return This builder for chaining. + */ + public Builder setIngressSettingsValue(int value) { + + ingressSettings_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The ingress settings for the function, controlling what traffic can reach
+     * it.
+     * 
+ * + * .google.cloud.functions.v2alpha.ServiceConfig.IngressSettings ingress_settings = 8; + * + * + * @return The ingressSettings. + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.ServiceConfig.IngressSettings getIngressSettings() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2alpha.ServiceConfig.IngressSettings result = + com.google.cloud.functions.v2alpha.ServiceConfig.IngressSettings.valueOf( + ingressSettings_); + return result == null + ? com.google.cloud.functions.v2alpha.ServiceConfig.IngressSettings.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The ingress settings for the function, controlling what traffic can reach
+     * it.
+     * 
+ * + * .google.cloud.functions.v2alpha.ServiceConfig.IngressSettings ingress_settings = 8; + * + * + * @param value The ingressSettings to set. + * @return This builder for chaining. + */ + public Builder setIngressSettings( + com.google.cloud.functions.v2alpha.ServiceConfig.IngressSettings value) { + if (value == null) { + throw new NullPointerException(); + } + + ingressSettings_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The ingress settings for the function, controlling what traffic can reach
+     * it.
+     * 
+ * + * .google.cloud.functions.v2alpha.ServiceConfig.IngressSettings ingress_settings = 8; + * + * + * @return This builder for chaining. + */ + public Builder clearIngressSettings() { + + ingressSettings_ = 0; + onChanged(); + return this; + } + + private java.lang.Object uri_ = ""; + /** + * + * + *
+     * Output only. URI of the Service deployed.
+     * 
+ * + * string uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. URI of the Service deployed.
+     * 
+ * + * string uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. URI of the Service deployed.
+     * 
+ * + * string uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The uri to set. + * @return This builder for chaining. + */ + public Builder setUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + uri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. URI of the Service deployed.
+     * 
+ * + * string uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearUri() { + + uri_ = getDefaultInstance().getUri(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. URI of the Service deployed.
+     * 
+ * + * string uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for uri to set. + * @return This builder for chaining. + */ + public Builder setUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + uri_ = value; + onChanged(); + return this; + } + + private java.lang.Object serviceAccountEmail_ = ""; + /** + * + * + *
+     * The email of the service's service account. If empty, defaults to
+     * `{project_number}-compute@developer.gserviceaccount.com`.
+     * 
+ * + * string service_account_email = 10; + * + * @return The serviceAccountEmail. + */ + public java.lang.String getServiceAccountEmail() { + java.lang.Object ref = serviceAccountEmail_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAccountEmail_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The email of the service's service account. If empty, defaults to
+     * `{project_number}-compute@developer.gserviceaccount.com`.
+     * 
+ * + * string service_account_email = 10; + * + * @return The bytes for serviceAccountEmail. + */ + public com.google.protobuf.ByteString getServiceAccountEmailBytes() { + java.lang.Object ref = serviceAccountEmail_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAccountEmail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The email of the service's service account. If empty, defaults to
+     * `{project_number}-compute@developer.gserviceaccount.com`.
+     * 
+ * + * string service_account_email = 10; + * + * @param value The serviceAccountEmail to set. + * @return This builder for chaining. + */ + public Builder setServiceAccountEmail(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + serviceAccountEmail_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The email of the service's service account. If empty, defaults to
+     * `{project_number}-compute@developer.gserviceaccount.com`.
+     * 
+ * + * string service_account_email = 10; + * + * @return This builder for chaining. + */ + public Builder clearServiceAccountEmail() { + + serviceAccountEmail_ = getDefaultInstance().getServiceAccountEmail(); + onChanged(); + return this; + } + /** + * + * + *
+     * The email of the service's service account. If empty, defaults to
+     * `{project_number}-compute@developer.gserviceaccount.com`.
+     * 
+ * + * string service_account_email = 10; + * + * @param value The bytes for serviceAccountEmail to set. + * @return This builder for chaining. + */ + public Builder setServiceAccountEmailBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + serviceAccountEmail_ = value; + onChanged(); + return this; + } + + private boolean allTrafficOnLatestRevision_; + /** + * + * + *
+     * Whether 100% of traffic is routed to the latest revision.
+     * On CreateFunction and UpdateFunction, when set to true, the revision being
+     * deployed will serve 100% of traffic, ignoring any traffic split settings,
+     * if any. On GetFunction, true will be returned if the latest revision is
+     * serving 100% of traffic.
+     * 
+ * + * bool all_traffic_on_latest_revision = 16; + * + * @return The allTrafficOnLatestRevision. + */ + @java.lang.Override + public boolean getAllTrafficOnLatestRevision() { + return allTrafficOnLatestRevision_; + } + /** + * + * + *
+     * Whether 100% of traffic is routed to the latest revision.
+     * On CreateFunction and UpdateFunction, when set to true, the revision being
+     * deployed will serve 100% of traffic, ignoring any traffic split settings,
+     * if any. On GetFunction, true will be returned if the latest revision is
+     * serving 100% of traffic.
+     * 
+ * + * bool all_traffic_on_latest_revision = 16; + * + * @param value The allTrafficOnLatestRevision to set. + * @return This builder for chaining. + */ + public Builder setAllTrafficOnLatestRevision(boolean value) { + + allTrafficOnLatestRevision_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether 100% of traffic is routed to the latest revision.
+     * On CreateFunction and UpdateFunction, when set to true, the revision being
+     * deployed will serve 100% of traffic, ignoring any traffic split settings,
+     * if any. On GetFunction, true will be returned if the latest revision is
+     * serving 100% of traffic.
+     * 
+ * + * bool all_traffic_on_latest_revision = 16; + * + * @return This builder for chaining. + */ + public Builder clearAllTrafficOnLatestRevision() { + + allTrafficOnLatestRevision_ = false; + onChanged(); + return this; + } + + private java.util.List + secretEnvironmentVariables_ = java.util.Collections.emptyList(); + + private void ensureSecretEnvironmentVariablesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + secretEnvironmentVariables_ = + new java.util.ArrayList( + secretEnvironmentVariables_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2alpha.SecretEnvVar, + com.google.cloud.functions.v2alpha.SecretEnvVar.Builder, + com.google.cloud.functions.v2alpha.SecretEnvVarOrBuilder> + secretEnvironmentVariablesBuilder_; + + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * + * repeated .google.cloud.functions.v2alpha.SecretEnvVar secret_environment_variables = 17; + * + */ + public java.util.List + getSecretEnvironmentVariablesList() { + if (secretEnvironmentVariablesBuilder_ == null) { + return java.util.Collections.unmodifiableList(secretEnvironmentVariables_); + } else { + return secretEnvironmentVariablesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * + * repeated .google.cloud.functions.v2alpha.SecretEnvVar secret_environment_variables = 17; + * + */ + public int getSecretEnvironmentVariablesCount() { + if (secretEnvironmentVariablesBuilder_ == null) { + return secretEnvironmentVariables_.size(); + } else { + return secretEnvironmentVariablesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * + * repeated .google.cloud.functions.v2alpha.SecretEnvVar secret_environment_variables = 17; + * + */ + public com.google.cloud.functions.v2alpha.SecretEnvVar getSecretEnvironmentVariables( + int index) { + if (secretEnvironmentVariablesBuilder_ == null) { + return secretEnvironmentVariables_.get(index); + } else { + return secretEnvironmentVariablesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * + * repeated .google.cloud.functions.v2alpha.SecretEnvVar secret_environment_variables = 17; + * + */ + public Builder setSecretEnvironmentVariables( + int index, com.google.cloud.functions.v2alpha.SecretEnvVar value) { + if (secretEnvironmentVariablesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSecretEnvironmentVariablesIsMutable(); + secretEnvironmentVariables_.set(index, value); + onChanged(); + } else { + secretEnvironmentVariablesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * + * repeated .google.cloud.functions.v2alpha.SecretEnvVar secret_environment_variables = 17; + * + */ + public Builder setSecretEnvironmentVariables( + int index, com.google.cloud.functions.v2alpha.SecretEnvVar.Builder builderForValue) { + if (secretEnvironmentVariablesBuilder_ == null) { + ensureSecretEnvironmentVariablesIsMutable(); + secretEnvironmentVariables_.set(index, builderForValue.build()); + onChanged(); + } else { + secretEnvironmentVariablesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * + * repeated .google.cloud.functions.v2alpha.SecretEnvVar secret_environment_variables = 17; + * + */ + public Builder addSecretEnvironmentVariables( + com.google.cloud.functions.v2alpha.SecretEnvVar value) { + if (secretEnvironmentVariablesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSecretEnvironmentVariablesIsMutable(); + secretEnvironmentVariables_.add(value); + onChanged(); + } else { + secretEnvironmentVariablesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * + * repeated .google.cloud.functions.v2alpha.SecretEnvVar secret_environment_variables = 17; + * + */ + public Builder addSecretEnvironmentVariables( + int index, com.google.cloud.functions.v2alpha.SecretEnvVar value) { + if (secretEnvironmentVariablesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSecretEnvironmentVariablesIsMutable(); + secretEnvironmentVariables_.add(index, value); + onChanged(); + } else { + secretEnvironmentVariablesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * + * repeated .google.cloud.functions.v2alpha.SecretEnvVar secret_environment_variables = 17; + * + */ + public Builder addSecretEnvironmentVariables( + com.google.cloud.functions.v2alpha.SecretEnvVar.Builder builderForValue) { + if (secretEnvironmentVariablesBuilder_ == null) { + ensureSecretEnvironmentVariablesIsMutable(); + secretEnvironmentVariables_.add(builderForValue.build()); + onChanged(); + } else { + secretEnvironmentVariablesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * + * repeated .google.cloud.functions.v2alpha.SecretEnvVar secret_environment_variables = 17; + * + */ + public Builder addSecretEnvironmentVariables( + int index, com.google.cloud.functions.v2alpha.SecretEnvVar.Builder builderForValue) { + if (secretEnvironmentVariablesBuilder_ == null) { + ensureSecretEnvironmentVariablesIsMutable(); + secretEnvironmentVariables_.add(index, builderForValue.build()); + onChanged(); + } else { + secretEnvironmentVariablesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * + * repeated .google.cloud.functions.v2alpha.SecretEnvVar secret_environment_variables = 17; + * + */ + public Builder addAllSecretEnvironmentVariables( + java.lang.Iterable values) { + if (secretEnvironmentVariablesBuilder_ == null) { + ensureSecretEnvironmentVariablesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, secretEnvironmentVariables_); + onChanged(); + } else { + secretEnvironmentVariablesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * + * repeated .google.cloud.functions.v2alpha.SecretEnvVar secret_environment_variables = 17; + * + */ + public Builder clearSecretEnvironmentVariables() { + if (secretEnvironmentVariablesBuilder_ == null) { + secretEnvironmentVariables_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + secretEnvironmentVariablesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * + * repeated .google.cloud.functions.v2alpha.SecretEnvVar secret_environment_variables = 17; + * + */ + public Builder removeSecretEnvironmentVariables(int index) { + if (secretEnvironmentVariablesBuilder_ == null) { + ensureSecretEnvironmentVariablesIsMutable(); + secretEnvironmentVariables_.remove(index); + onChanged(); + } else { + secretEnvironmentVariablesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * + * repeated .google.cloud.functions.v2alpha.SecretEnvVar secret_environment_variables = 17; + * + */ + public com.google.cloud.functions.v2alpha.SecretEnvVar.Builder + getSecretEnvironmentVariablesBuilder(int index) { + return getSecretEnvironmentVariablesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * + * repeated .google.cloud.functions.v2alpha.SecretEnvVar secret_environment_variables = 17; + * + */ + public com.google.cloud.functions.v2alpha.SecretEnvVarOrBuilder + getSecretEnvironmentVariablesOrBuilder(int index) { + if (secretEnvironmentVariablesBuilder_ == null) { + return secretEnvironmentVariables_.get(index); + } else { + return secretEnvironmentVariablesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * + * repeated .google.cloud.functions.v2alpha.SecretEnvVar secret_environment_variables = 17; + * + */ + public java.util.List + getSecretEnvironmentVariablesOrBuilderList() { + if (secretEnvironmentVariablesBuilder_ != null) { + return secretEnvironmentVariablesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(secretEnvironmentVariables_); + } + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * + * repeated .google.cloud.functions.v2alpha.SecretEnvVar secret_environment_variables = 17; + * + */ + public com.google.cloud.functions.v2alpha.SecretEnvVar.Builder + addSecretEnvironmentVariablesBuilder() { + return getSecretEnvironmentVariablesFieldBuilder() + .addBuilder(com.google.cloud.functions.v2alpha.SecretEnvVar.getDefaultInstance()); + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * + * repeated .google.cloud.functions.v2alpha.SecretEnvVar secret_environment_variables = 17; + * + */ + public com.google.cloud.functions.v2alpha.SecretEnvVar.Builder + addSecretEnvironmentVariablesBuilder(int index) { + return getSecretEnvironmentVariablesFieldBuilder() + .addBuilder(index, com.google.cloud.functions.v2alpha.SecretEnvVar.getDefaultInstance()); + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * + * repeated .google.cloud.functions.v2alpha.SecretEnvVar secret_environment_variables = 17; + * + */ + public java.util.List + getSecretEnvironmentVariablesBuilderList() { + return getSecretEnvironmentVariablesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2alpha.SecretEnvVar, + com.google.cloud.functions.v2alpha.SecretEnvVar.Builder, + com.google.cloud.functions.v2alpha.SecretEnvVarOrBuilder> + getSecretEnvironmentVariablesFieldBuilder() { + if (secretEnvironmentVariablesBuilder_ == null) { + secretEnvironmentVariablesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2alpha.SecretEnvVar, + com.google.cloud.functions.v2alpha.SecretEnvVar.Builder, + com.google.cloud.functions.v2alpha.SecretEnvVarOrBuilder>( + secretEnvironmentVariables_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + secretEnvironmentVariables_ = null; + } + return secretEnvironmentVariablesBuilder_; + } + + private java.util.List secretVolumes_ = + java.util.Collections.emptyList(); + + private void ensureSecretVolumesIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + secretVolumes_ = + new java.util.ArrayList( + secretVolumes_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2alpha.SecretVolume, + com.google.cloud.functions.v2alpha.SecretVolume.Builder, + com.google.cloud.functions.v2alpha.SecretVolumeOrBuilder> + secretVolumesBuilder_; + + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume secret_volumes = 19; + */ + public java.util.List getSecretVolumesList() { + if (secretVolumesBuilder_ == null) { + return java.util.Collections.unmodifiableList(secretVolumes_); + } else { + return secretVolumesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume secret_volumes = 19; + */ + public int getSecretVolumesCount() { + if (secretVolumesBuilder_ == null) { + return secretVolumes_.size(); + } else { + return secretVolumesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume secret_volumes = 19; + */ + public com.google.cloud.functions.v2alpha.SecretVolume getSecretVolumes(int index) { + if (secretVolumesBuilder_ == null) { + return secretVolumes_.get(index); + } else { + return secretVolumesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume secret_volumes = 19; + */ + public Builder setSecretVolumes( + int index, com.google.cloud.functions.v2alpha.SecretVolume value) { + if (secretVolumesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSecretVolumesIsMutable(); + secretVolumes_.set(index, value); + onChanged(); + } else { + secretVolumesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume secret_volumes = 19; + */ + public Builder setSecretVolumes( + int index, com.google.cloud.functions.v2alpha.SecretVolume.Builder builderForValue) { + if (secretVolumesBuilder_ == null) { + ensureSecretVolumesIsMutable(); + secretVolumes_.set(index, builderForValue.build()); + onChanged(); + } else { + secretVolumesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume secret_volumes = 19; + */ + public Builder addSecretVolumes(com.google.cloud.functions.v2alpha.SecretVolume value) { + if (secretVolumesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSecretVolumesIsMutable(); + secretVolumes_.add(value); + onChanged(); + } else { + secretVolumesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume secret_volumes = 19; + */ + public Builder addSecretVolumes( + int index, com.google.cloud.functions.v2alpha.SecretVolume value) { + if (secretVolumesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSecretVolumesIsMutable(); + secretVolumes_.add(index, value); + onChanged(); + } else { + secretVolumesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume secret_volumes = 19; + */ + public Builder addSecretVolumes( + com.google.cloud.functions.v2alpha.SecretVolume.Builder builderForValue) { + if (secretVolumesBuilder_ == null) { + ensureSecretVolumesIsMutable(); + secretVolumes_.add(builderForValue.build()); + onChanged(); + } else { + secretVolumesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume secret_volumes = 19; + */ + public Builder addSecretVolumes( + int index, com.google.cloud.functions.v2alpha.SecretVolume.Builder builderForValue) { + if (secretVolumesBuilder_ == null) { + ensureSecretVolumesIsMutable(); + secretVolumes_.add(index, builderForValue.build()); + onChanged(); + } else { + secretVolumesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume secret_volumes = 19; + */ + public Builder addAllSecretVolumes( + java.lang.Iterable values) { + if (secretVolumesBuilder_ == null) { + ensureSecretVolumesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, secretVolumes_); + onChanged(); + } else { + secretVolumesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume secret_volumes = 19; + */ + public Builder clearSecretVolumes() { + if (secretVolumesBuilder_ == null) { + secretVolumes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + secretVolumesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume secret_volumes = 19; + */ + public Builder removeSecretVolumes(int index) { + if (secretVolumesBuilder_ == null) { + ensureSecretVolumesIsMutable(); + secretVolumes_.remove(index); + onChanged(); + } else { + secretVolumesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume secret_volumes = 19; + */ + public com.google.cloud.functions.v2alpha.SecretVolume.Builder getSecretVolumesBuilder( + int index) { + return getSecretVolumesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume secret_volumes = 19; + */ + public com.google.cloud.functions.v2alpha.SecretVolumeOrBuilder getSecretVolumesOrBuilder( + int index) { + if (secretVolumesBuilder_ == null) { + return secretVolumes_.get(index); + } else { + return secretVolumesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume secret_volumes = 19; + */ + public java.util.List + getSecretVolumesOrBuilderList() { + if (secretVolumesBuilder_ != null) { + return secretVolumesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(secretVolumes_); + } + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume secret_volumes = 19; + */ + public com.google.cloud.functions.v2alpha.SecretVolume.Builder addSecretVolumesBuilder() { + return getSecretVolumesFieldBuilder() + .addBuilder(com.google.cloud.functions.v2alpha.SecretVolume.getDefaultInstance()); + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume secret_volumes = 19; + */ + public com.google.cloud.functions.v2alpha.SecretVolume.Builder addSecretVolumesBuilder( + int index) { + return getSecretVolumesFieldBuilder() + .addBuilder(index, com.google.cloud.functions.v2alpha.SecretVolume.getDefaultInstance()); + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume secret_volumes = 19; + */ + public java.util.List + getSecretVolumesBuilderList() { + return getSecretVolumesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2alpha.SecretVolume, + com.google.cloud.functions.v2alpha.SecretVolume.Builder, + com.google.cloud.functions.v2alpha.SecretVolumeOrBuilder> + getSecretVolumesFieldBuilder() { + if (secretVolumesBuilder_ == null) { + secretVolumesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2alpha.SecretVolume, + com.google.cloud.functions.v2alpha.SecretVolume.Builder, + com.google.cloud.functions.v2alpha.SecretVolumeOrBuilder>( + secretVolumes_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + secretVolumes_ = null; + } + return secretVolumesBuilder_; + } + + private java.lang.Object revision_ = ""; + /** + * + * + *
+     * Output only. The name of service revision.
+     * 
+ * + * string revision = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The revision. + */ + public java.lang.String getRevision() { + java.lang.Object ref = revision_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + revision_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The name of service revision.
+     * 
+ * + * string revision = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for revision. + */ + public com.google.protobuf.ByteString getRevisionBytes() { + java.lang.Object ref = revision_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + revision_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The name of service revision.
+     * 
+ * + * string revision = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The revision to set. + * @return This builder for chaining. + */ + public Builder setRevision(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + revision_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of service revision.
+     * 
+ * + * string revision = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearRevision() { + + revision_ = getDefaultInstance().getRevision(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of service revision.
+     * 
+ * + * string revision = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for revision to set. + * @return This builder for chaining. + */ + public Builder setRevisionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + revision_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2alpha.ServiceConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2alpha.ServiceConfig) + private static final com.google.cloud.functions.v2alpha.ServiceConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2alpha.ServiceConfig(); + } + + public static com.google.cloud.functions.v2alpha.ServiceConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ServiceConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ServiceConfig(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.ServiceConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/ServiceConfigOrBuilder.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/ServiceConfigOrBuilder.java new file mode 100644 index 00000000..4d576c0e --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/ServiceConfigOrBuilder.java @@ -0,0 +1,502 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +public interface ServiceConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2alpha.ServiceConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Name of the service associated with a Function.
+   * The format of this field is
+   * `projects/{project}/locations/{region}/services/{service}`
+   * 
+ * + * + * string service = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The service. + */ + java.lang.String getService(); + /** + * + * + *
+   * Output only. Name of the service associated with a Function.
+   * The format of this field is
+   * `projects/{project}/locations/{region}/services/{service}`
+   * 
+ * + * + * string service = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for service. + */ + com.google.protobuf.ByteString getServiceBytes(); + + /** + * + * + *
+   * The function execution timeout. Execution is considered failed and
+   * can be terminated if the function is not completed at the end of the
+   * timeout period. Defaults to 60 seconds.
+   * 
+ * + * int32 timeout_seconds = 2; + * + * @return The timeoutSeconds. + */ + int getTimeoutSeconds(); + + /** + * + * + *
+   * The amount of memory available for a function.
+   * Defaults to 256M. Supported units are k, M, G, Mi, Gi. If no unit is
+   * supplied the value is interpreted as bytes.
+   * See
+   * https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go
+   * a full description.
+   * 
+ * + * string available_memory = 13; + * + * @return The availableMemory. + */ + java.lang.String getAvailableMemory(); + /** + * + * + *
+   * The amount of memory available for a function.
+   * Defaults to 256M. Supported units are k, M, G, Mi, Gi. If no unit is
+   * supplied the value is interpreted as bytes.
+   * See
+   * https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go
+   * a full description.
+   * 
+ * + * string available_memory = 13; + * + * @return The bytes for availableMemory. + */ + com.google.protobuf.ByteString getAvailableMemoryBytes(); + + /** + * + * + *
+   * Environment variables that shall be available during function execution.
+   * 
+ * + * map<string, string> environment_variables = 4; + */ + int getEnvironmentVariablesCount(); + /** + * + * + *
+   * Environment variables that shall be available during function execution.
+   * 
+ * + * map<string, string> environment_variables = 4; + */ + boolean containsEnvironmentVariables(java.lang.String key); + /** Use {@link #getEnvironmentVariablesMap()} instead. */ + @java.lang.Deprecated + java.util.Map getEnvironmentVariables(); + /** + * + * + *
+   * Environment variables that shall be available during function execution.
+   * 
+ * + * map<string, string> environment_variables = 4; + */ + java.util.Map getEnvironmentVariablesMap(); + /** + * + * + *
+   * Environment variables that shall be available during function execution.
+   * 
+ * + * map<string, string> environment_variables = 4; + */ + + /* nullable */ + java.lang.String getEnvironmentVariablesOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Environment variables that shall be available during function execution.
+   * 
+ * + * map<string, string> environment_variables = 4; + */ + java.lang.String getEnvironmentVariablesOrThrow(java.lang.String key); + + /** + * + * + *
+   * The limit on the maximum number of function instances that may coexist at a
+   * given time.
+   * In some cases, such as rapid traffic surges, Cloud Functions may, for a
+   * short period of time, create more instances than the specified max
+   * instances limit. If your function cannot tolerate this temporary behavior,
+   * you may want to factor in a safety margin and set a lower max instances
+   * value than your function can tolerate.
+   * See the [Max
+   * Instances](https://cloud.google.com/functions/docs/max-instances) Guide for
+   * more details.
+   * 
+ * + * int32 max_instance_count = 5; + * + * @return The maxInstanceCount. + */ + int getMaxInstanceCount(); + + /** + * + * + *
+   * The limit on the minimum number of function instances that may coexist at a
+   * given time.
+   * Function instances are kept in idle state for a short period after they
+   * finished executing the request to reduce cold start time for subsequent
+   * requests. Setting a minimum instance count will ensure that the given
+   * number of instances are kept running in idle state always. This can help
+   * with cold start times when jump in incoming request count occurs after the
+   * idle instance would have been stopped in the default case.
+   * 
+ * + * int32 min_instance_count = 12; + * + * @return The minInstanceCount. + */ + int getMinInstanceCount(); + + /** + * + * + *
+   * The Serverless VPC Access connector that this cloud function can connect
+   * to. The format of this field is `projects/*/locations/*/connectors/*`.
+   * 
+ * + * string vpc_connector = 6 [(.google.api.resource_reference) = { ... } + * + * @return The vpcConnector. + */ + java.lang.String getVpcConnector(); + /** + * + * + *
+   * The Serverless VPC Access connector that this cloud function can connect
+   * to. The format of this field is `projects/*/locations/*/connectors/*`.
+   * 
+ * + * string vpc_connector = 6 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for vpcConnector. + */ + com.google.protobuf.ByteString getVpcConnectorBytes(); + + /** + * + * + *
+   * The egress settings for the connector, controlling what traffic is diverted
+   * through it.
+   * 
+ * + * + * .google.cloud.functions.v2alpha.ServiceConfig.VpcConnectorEgressSettings vpc_connector_egress_settings = 7; + * + * + * @return The enum numeric value on the wire for vpcConnectorEgressSettings. + */ + int getVpcConnectorEgressSettingsValue(); + /** + * + * + *
+   * The egress settings for the connector, controlling what traffic is diverted
+   * through it.
+   * 
+ * + * + * .google.cloud.functions.v2alpha.ServiceConfig.VpcConnectorEgressSettings vpc_connector_egress_settings = 7; + * + * + * @return The vpcConnectorEgressSettings. + */ + com.google.cloud.functions.v2alpha.ServiceConfig.VpcConnectorEgressSettings + getVpcConnectorEgressSettings(); + + /** + * + * + *
+   * The ingress settings for the function, controlling what traffic can reach
+   * it.
+   * 
+ * + * .google.cloud.functions.v2alpha.ServiceConfig.IngressSettings ingress_settings = 8; + * + * + * @return The enum numeric value on the wire for ingressSettings. + */ + int getIngressSettingsValue(); + /** + * + * + *
+   * The ingress settings for the function, controlling what traffic can reach
+   * it.
+   * 
+ * + * .google.cloud.functions.v2alpha.ServiceConfig.IngressSettings ingress_settings = 8; + * + * + * @return The ingressSettings. + */ + com.google.cloud.functions.v2alpha.ServiceConfig.IngressSettings getIngressSettings(); + + /** + * + * + *
+   * Output only. URI of the Service deployed.
+   * 
+ * + * string uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uri. + */ + java.lang.String getUri(); + /** + * + * + *
+   * Output only. URI of the Service deployed.
+   * 
+ * + * string uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uri. + */ + com.google.protobuf.ByteString getUriBytes(); + + /** + * + * + *
+   * The email of the service's service account. If empty, defaults to
+   * `{project_number}-compute@developer.gserviceaccount.com`.
+   * 
+ * + * string service_account_email = 10; + * + * @return The serviceAccountEmail. + */ + java.lang.String getServiceAccountEmail(); + /** + * + * + *
+   * The email of the service's service account. If empty, defaults to
+   * `{project_number}-compute@developer.gserviceaccount.com`.
+   * 
+ * + * string service_account_email = 10; + * + * @return The bytes for serviceAccountEmail. + */ + com.google.protobuf.ByteString getServiceAccountEmailBytes(); + + /** + * + * + *
+   * Whether 100% of traffic is routed to the latest revision.
+   * On CreateFunction and UpdateFunction, when set to true, the revision being
+   * deployed will serve 100% of traffic, ignoring any traffic split settings,
+   * if any. On GetFunction, true will be returned if the latest revision is
+   * serving 100% of traffic.
+   * 
+ * + * bool all_traffic_on_latest_revision = 16; + * + * @return The allTrafficOnLatestRevision. + */ + boolean getAllTrafficOnLatestRevision(); + + /** + * + * + *
+   * Secret environment variables configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretEnvVar secret_environment_variables = 17; + * + */ + java.util.List + getSecretEnvironmentVariablesList(); + /** + * + * + *
+   * Secret environment variables configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretEnvVar secret_environment_variables = 17; + * + */ + com.google.cloud.functions.v2alpha.SecretEnvVar getSecretEnvironmentVariables(int index); + /** + * + * + *
+   * Secret environment variables configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretEnvVar secret_environment_variables = 17; + * + */ + int getSecretEnvironmentVariablesCount(); + /** + * + * + *
+   * Secret environment variables configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretEnvVar secret_environment_variables = 17; + * + */ + java.util.List + getSecretEnvironmentVariablesOrBuilderList(); + /** + * + * + *
+   * Secret environment variables configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretEnvVar secret_environment_variables = 17; + * + */ + com.google.cloud.functions.v2alpha.SecretEnvVarOrBuilder getSecretEnvironmentVariablesOrBuilder( + int index); + + /** + * + * + *
+   * Secret volumes configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume secret_volumes = 19; + */ + java.util.List getSecretVolumesList(); + /** + * + * + *
+   * Secret volumes configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume secret_volumes = 19; + */ + com.google.cloud.functions.v2alpha.SecretVolume getSecretVolumes(int index); + /** + * + * + *
+   * Secret volumes configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume secret_volumes = 19; + */ + int getSecretVolumesCount(); + /** + * + * + *
+   * Secret volumes configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume secret_volumes = 19; + */ + java.util.List + getSecretVolumesOrBuilderList(); + /** + * + * + *
+   * Secret volumes configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.SecretVolume secret_volumes = 19; + */ + com.google.cloud.functions.v2alpha.SecretVolumeOrBuilder getSecretVolumesOrBuilder(int index); + + /** + * + * + *
+   * Output only. The name of service revision.
+   * 
+ * + * string revision = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The revision. + */ + java.lang.String getRevision(); + /** + * + * + *
+   * Output only. The name of service revision.
+   * 
+ * + * string revision = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for revision. + */ + com.google.protobuf.ByteString getRevisionBytes(); +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/Source.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/Source.java new file mode 100644 index 00000000..9c1953aa --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/Source.java @@ -0,0 +1,1156 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +/** + * + * + *
+ * The location of the function source code.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.Source} + */ +public final class Source extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2alpha.Source) + SourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use Source.newBuilder() to construct. + private Source(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Source() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Source(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Source( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.functions.v2alpha.StorageSource.Builder subBuilder = null; + if (sourceCase_ == 1) { + subBuilder = + ((com.google.cloud.functions.v2alpha.StorageSource) source_).toBuilder(); + } + source_ = + input.readMessage( + com.google.cloud.functions.v2alpha.StorageSource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.functions.v2alpha.StorageSource) source_); + source_ = subBuilder.buildPartial(); + } + sourceCase_ = 1; + break; + } + case 18: + { + com.google.cloud.functions.v2alpha.RepoSource.Builder subBuilder = null; + if (sourceCase_ == 2) { + subBuilder = ((com.google.cloud.functions.v2alpha.RepoSource) source_).toBuilder(); + } + source_ = + input.readMessage( + com.google.cloud.functions.v2alpha.RepoSource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.functions.v2alpha.RepoSource) source_); + source_ = subBuilder.buildPartial(); + } + sourceCase_ = 2; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_Source_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_Source_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.Source.class, + com.google.cloud.functions.v2alpha.Source.Builder.class); + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public enum SourceCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + STORAGE_SOURCE(1), + REPO_SOURCE(2), + SOURCE_NOT_SET(0); + private final int value; + + private SourceCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SourceCase valueOf(int value) { + return forNumber(value); + } + + public static SourceCase forNumber(int value) { + switch (value) { + case 1: + return STORAGE_SOURCE; + case 2: + return REPO_SOURCE; + case 0: + return SOURCE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public static final int STORAGE_SOURCE_FIELD_NUMBER = 1; + /** + * + * + *
+   * If provided, get the source from this location in Google Cloud Storage.
+   * 
+ * + * .google.cloud.functions.v2alpha.StorageSource storage_source = 1; + * + * @return Whether the storageSource field is set. + */ + @java.lang.Override + public boolean hasStorageSource() { + return sourceCase_ == 1; + } + /** + * + * + *
+   * If provided, get the source from this location in Google Cloud Storage.
+   * 
+ * + * .google.cloud.functions.v2alpha.StorageSource storage_source = 1; + * + * @return The storageSource. + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.StorageSource getStorageSource() { + if (sourceCase_ == 1) { + return (com.google.cloud.functions.v2alpha.StorageSource) source_; + } + return com.google.cloud.functions.v2alpha.StorageSource.getDefaultInstance(); + } + /** + * + * + *
+   * If provided, get the source from this location in Google Cloud Storage.
+   * 
+ * + * .google.cloud.functions.v2alpha.StorageSource storage_source = 1; + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.StorageSourceOrBuilder getStorageSourceOrBuilder() { + if (sourceCase_ == 1) { + return (com.google.cloud.functions.v2alpha.StorageSource) source_; + } + return com.google.cloud.functions.v2alpha.StorageSource.getDefaultInstance(); + } + + public static final int REPO_SOURCE_FIELD_NUMBER = 2; + /** + * + * + *
+   * If provided, get the source from this location in a Cloud Source
+   * Repository.
+   * 
+ * + * .google.cloud.functions.v2alpha.RepoSource repo_source = 2; + * + * @return Whether the repoSource field is set. + */ + @java.lang.Override + public boolean hasRepoSource() { + return sourceCase_ == 2; + } + /** + * + * + *
+   * If provided, get the source from this location in a Cloud Source
+   * Repository.
+   * 
+ * + * .google.cloud.functions.v2alpha.RepoSource repo_source = 2; + * + * @return The repoSource. + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.RepoSource getRepoSource() { + if (sourceCase_ == 2) { + return (com.google.cloud.functions.v2alpha.RepoSource) source_; + } + return com.google.cloud.functions.v2alpha.RepoSource.getDefaultInstance(); + } + /** + * + * + *
+   * If provided, get the source from this location in a Cloud Source
+   * Repository.
+   * 
+ * + * .google.cloud.functions.v2alpha.RepoSource repo_source = 2; + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.RepoSourceOrBuilder getRepoSourceOrBuilder() { + if (sourceCase_ == 2) { + return (com.google.cloud.functions.v2alpha.RepoSource) source_; + } + return com.google.cloud.functions.v2alpha.RepoSource.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (sourceCase_ == 1) { + output.writeMessage(1, (com.google.cloud.functions.v2alpha.StorageSource) source_); + } + if (sourceCase_ == 2) { + output.writeMessage(2, (com.google.cloud.functions.v2alpha.RepoSource) source_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (sourceCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.cloud.functions.v2alpha.StorageSource) source_); + } + if (sourceCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.functions.v2alpha.RepoSource) source_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2alpha.Source)) { + return super.equals(obj); + } + com.google.cloud.functions.v2alpha.Source other = + (com.google.cloud.functions.v2alpha.Source) obj; + + if (!getSourceCase().equals(other.getSourceCase())) return false; + switch (sourceCase_) { + case 1: + if (!getStorageSource().equals(other.getStorageSource())) return false; + break; + case 2: + if (!getRepoSource().equals(other.getRepoSource())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (sourceCase_) { + case 1: + hash = (37 * hash) + STORAGE_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getStorageSource().hashCode(); + break; + case 2: + hash = (37 * hash) + REPO_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getRepoSource().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2alpha.Source parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.Source parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.Source parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.Source parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.Source parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.Source parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.Source parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.Source parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.Source parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.Source parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.Source parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.Source parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v2alpha.Source prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The location of the function source code.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.Source} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2alpha.Source) + com.google.cloud.functions.v2alpha.SourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_Source_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_Source_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.Source.class, + com.google.cloud.functions.v2alpha.Source.Builder.class); + } + + // Construct using com.google.cloud.functions.v2alpha.Source.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + sourceCase_ = 0; + source_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_Source_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.Source getDefaultInstanceForType() { + return com.google.cloud.functions.v2alpha.Source.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.Source build() { + com.google.cloud.functions.v2alpha.Source result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.Source buildPartial() { + com.google.cloud.functions.v2alpha.Source result = + new com.google.cloud.functions.v2alpha.Source(this); + if (sourceCase_ == 1) { + if (storageSourceBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = storageSourceBuilder_.build(); + } + } + if (sourceCase_ == 2) { + if (repoSourceBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = repoSourceBuilder_.build(); + } + } + result.sourceCase_ = sourceCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2alpha.Source) { + return mergeFrom((com.google.cloud.functions.v2alpha.Source) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2alpha.Source other) { + if (other == com.google.cloud.functions.v2alpha.Source.getDefaultInstance()) return this; + switch (other.getSourceCase()) { + case STORAGE_SOURCE: + { + mergeStorageSource(other.getStorageSource()); + break; + } + case REPO_SOURCE: + { + mergeRepoSource(other.getRepoSource()); + break; + } + case SOURCE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2alpha.Source parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v2alpha.Source) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public Builder clearSource() { + sourceCase_ = 0; + source_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2alpha.StorageSource, + com.google.cloud.functions.v2alpha.StorageSource.Builder, + com.google.cloud.functions.v2alpha.StorageSourceOrBuilder> + storageSourceBuilder_; + /** + * + * + *
+     * If provided, get the source from this location in Google Cloud Storage.
+     * 
+ * + * .google.cloud.functions.v2alpha.StorageSource storage_source = 1; + * + * @return Whether the storageSource field is set. + */ + @java.lang.Override + public boolean hasStorageSource() { + return sourceCase_ == 1; + } + /** + * + * + *
+     * If provided, get the source from this location in Google Cloud Storage.
+     * 
+ * + * .google.cloud.functions.v2alpha.StorageSource storage_source = 1; + * + * @return The storageSource. + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.StorageSource getStorageSource() { + if (storageSourceBuilder_ == null) { + if (sourceCase_ == 1) { + return (com.google.cloud.functions.v2alpha.StorageSource) source_; + } + return com.google.cloud.functions.v2alpha.StorageSource.getDefaultInstance(); + } else { + if (sourceCase_ == 1) { + return storageSourceBuilder_.getMessage(); + } + return com.google.cloud.functions.v2alpha.StorageSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * If provided, get the source from this location in Google Cloud Storage.
+     * 
+ * + * .google.cloud.functions.v2alpha.StorageSource storage_source = 1; + */ + public Builder setStorageSource(com.google.cloud.functions.v2alpha.StorageSource value) { + if (storageSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + storageSourceBuilder_.setMessage(value); + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * If provided, get the source from this location in Google Cloud Storage.
+     * 
+ * + * .google.cloud.functions.v2alpha.StorageSource storage_source = 1; + */ + public Builder setStorageSource( + com.google.cloud.functions.v2alpha.StorageSource.Builder builderForValue) { + if (storageSourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + storageSourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * If provided, get the source from this location in Google Cloud Storage.
+     * 
+ * + * .google.cloud.functions.v2alpha.StorageSource storage_source = 1; + */ + public Builder mergeStorageSource(com.google.cloud.functions.v2alpha.StorageSource value) { + if (storageSourceBuilder_ == null) { + if (sourceCase_ == 1 + && source_ != com.google.cloud.functions.v2alpha.StorageSource.getDefaultInstance()) { + source_ = + com.google.cloud.functions.v2alpha.StorageSource.newBuilder( + (com.google.cloud.functions.v2alpha.StorageSource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 1) { + storageSourceBuilder_.mergeFrom(value); + } else { + storageSourceBuilder_.setMessage(value); + } + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * If provided, get the source from this location in Google Cloud Storage.
+     * 
+ * + * .google.cloud.functions.v2alpha.StorageSource storage_source = 1; + */ + public Builder clearStorageSource() { + if (storageSourceBuilder_ == null) { + if (sourceCase_ == 1) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 1) { + sourceCase_ = 0; + source_ = null; + } + storageSourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * If provided, get the source from this location in Google Cloud Storage.
+     * 
+ * + * .google.cloud.functions.v2alpha.StorageSource storage_source = 1; + */ + public com.google.cloud.functions.v2alpha.StorageSource.Builder getStorageSourceBuilder() { + return getStorageSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * If provided, get the source from this location in Google Cloud Storage.
+     * 
+ * + * .google.cloud.functions.v2alpha.StorageSource storage_source = 1; + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.StorageSourceOrBuilder getStorageSourceOrBuilder() { + if ((sourceCase_ == 1) && (storageSourceBuilder_ != null)) { + return storageSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 1) { + return (com.google.cloud.functions.v2alpha.StorageSource) source_; + } + return com.google.cloud.functions.v2alpha.StorageSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * If provided, get the source from this location in Google Cloud Storage.
+     * 
+ * + * .google.cloud.functions.v2alpha.StorageSource storage_source = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2alpha.StorageSource, + com.google.cloud.functions.v2alpha.StorageSource.Builder, + com.google.cloud.functions.v2alpha.StorageSourceOrBuilder> + getStorageSourceFieldBuilder() { + if (storageSourceBuilder_ == null) { + if (!(sourceCase_ == 1)) { + source_ = com.google.cloud.functions.v2alpha.StorageSource.getDefaultInstance(); + } + storageSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2alpha.StorageSource, + com.google.cloud.functions.v2alpha.StorageSource.Builder, + com.google.cloud.functions.v2alpha.StorageSourceOrBuilder>( + (com.google.cloud.functions.v2alpha.StorageSource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 1; + onChanged(); + ; + return storageSourceBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2alpha.RepoSource, + com.google.cloud.functions.v2alpha.RepoSource.Builder, + com.google.cloud.functions.v2alpha.RepoSourceOrBuilder> + repoSourceBuilder_; + /** + * + * + *
+     * If provided, get the source from this location in a Cloud Source
+     * Repository.
+     * 
+ * + * .google.cloud.functions.v2alpha.RepoSource repo_source = 2; + * + * @return Whether the repoSource field is set. + */ + @java.lang.Override + public boolean hasRepoSource() { + return sourceCase_ == 2; + } + /** + * + * + *
+     * If provided, get the source from this location in a Cloud Source
+     * Repository.
+     * 
+ * + * .google.cloud.functions.v2alpha.RepoSource repo_source = 2; + * + * @return The repoSource. + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.RepoSource getRepoSource() { + if (repoSourceBuilder_ == null) { + if (sourceCase_ == 2) { + return (com.google.cloud.functions.v2alpha.RepoSource) source_; + } + return com.google.cloud.functions.v2alpha.RepoSource.getDefaultInstance(); + } else { + if (sourceCase_ == 2) { + return repoSourceBuilder_.getMessage(); + } + return com.google.cloud.functions.v2alpha.RepoSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * If provided, get the source from this location in a Cloud Source
+     * Repository.
+     * 
+ * + * .google.cloud.functions.v2alpha.RepoSource repo_source = 2; + */ + public Builder setRepoSource(com.google.cloud.functions.v2alpha.RepoSource value) { + if (repoSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + repoSourceBuilder_.setMessage(value); + } + sourceCase_ = 2; + return this; + } + /** + * + * + *
+     * If provided, get the source from this location in a Cloud Source
+     * Repository.
+     * 
+ * + * .google.cloud.functions.v2alpha.RepoSource repo_source = 2; + */ + public Builder setRepoSource( + com.google.cloud.functions.v2alpha.RepoSource.Builder builderForValue) { + if (repoSourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + repoSourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 2; + return this; + } + /** + * + * + *
+     * If provided, get the source from this location in a Cloud Source
+     * Repository.
+     * 
+ * + * .google.cloud.functions.v2alpha.RepoSource repo_source = 2; + */ + public Builder mergeRepoSource(com.google.cloud.functions.v2alpha.RepoSource value) { + if (repoSourceBuilder_ == null) { + if (sourceCase_ == 2 + && source_ != com.google.cloud.functions.v2alpha.RepoSource.getDefaultInstance()) { + source_ = + com.google.cloud.functions.v2alpha.RepoSource.newBuilder( + (com.google.cloud.functions.v2alpha.RepoSource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 2) { + repoSourceBuilder_.mergeFrom(value); + } else { + repoSourceBuilder_.setMessage(value); + } + } + sourceCase_ = 2; + return this; + } + /** + * + * + *
+     * If provided, get the source from this location in a Cloud Source
+     * Repository.
+     * 
+ * + * .google.cloud.functions.v2alpha.RepoSource repo_source = 2; + */ + public Builder clearRepoSource() { + if (repoSourceBuilder_ == null) { + if (sourceCase_ == 2) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 2) { + sourceCase_ = 0; + source_ = null; + } + repoSourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * If provided, get the source from this location in a Cloud Source
+     * Repository.
+     * 
+ * + * .google.cloud.functions.v2alpha.RepoSource repo_source = 2; + */ + public com.google.cloud.functions.v2alpha.RepoSource.Builder getRepoSourceBuilder() { + return getRepoSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * If provided, get the source from this location in a Cloud Source
+     * Repository.
+     * 
+ * + * .google.cloud.functions.v2alpha.RepoSource repo_source = 2; + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.RepoSourceOrBuilder getRepoSourceOrBuilder() { + if ((sourceCase_ == 2) && (repoSourceBuilder_ != null)) { + return repoSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 2) { + return (com.google.cloud.functions.v2alpha.RepoSource) source_; + } + return com.google.cloud.functions.v2alpha.RepoSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * If provided, get the source from this location in a Cloud Source
+     * Repository.
+     * 
+ * + * .google.cloud.functions.v2alpha.RepoSource repo_source = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2alpha.RepoSource, + com.google.cloud.functions.v2alpha.RepoSource.Builder, + com.google.cloud.functions.v2alpha.RepoSourceOrBuilder> + getRepoSourceFieldBuilder() { + if (repoSourceBuilder_ == null) { + if (!(sourceCase_ == 2)) { + source_ = com.google.cloud.functions.v2alpha.RepoSource.getDefaultInstance(); + } + repoSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2alpha.RepoSource, + com.google.cloud.functions.v2alpha.RepoSource.Builder, + com.google.cloud.functions.v2alpha.RepoSourceOrBuilder>( + (com.google.cloud.functions.v2alpha.RepoSource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 2; + onChanged(); + ; + return repoSourceBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2alpha.Source) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2alpha.Source) + private static final com.google.cloud.functions.v2alpha.Source DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2alpha.Source(); + } + + public static com.google.cloud.functions.v2alpha.Source getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Source parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Source(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.Source getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/SourceOrBuilder.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/SourceOrBuilder.java new file mode 100644 index 00000000..0c2ca814 --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/SourceOrBuilder.java @@ -0,0 +1,100 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +public interface SourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2alpha.Source) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * If provided, get the source from this location in Google Cloud Storage.
+   * 
+ * + * .google.cloud.functions.v2alpha.StorageSource storage_source = 1; + * + * @return Whether the storageSource field is set. + */ + boolean hasStorageSource(); + /** + * + * + *
+   * If provided, get the source from this location in Google Cloud Storage.
+   * 
+ * + * .google.cloud.functions.v2alpha.StorageSource storage_source = 1; + * + * @return The storageSource. + */ + com.google.cloud.functions.v2alpha.StorageSource getStorageSource(); + /** + * + * + *
+   * If provided, get the source from this location in Google Cloud Storage.
+   * 
+ * + * .google.cloud.functions.v2alpha.StorageSource storage_source = 1; + */ + com.google.cloud.functions.v2alpha.StorageSourceOrBuilder getStorageSourceOrBuilder(); + + /** + * + * + *
+   * If provided, get the source from this location in a Cloud Source
+   * Repository.
+   * 
+ * + * .google.cloud.functions.v2alpha.RepoSource repo_source = 2; + * + * @return Whether the repoSource field is set. + */ + boolean hasRepoSource(); + /** + * + * + *
+   * If provided, get the source from this location in a Cloud Source
+   * Repository.
+   * 
+ * + * .google.cloud.functions.v2alpha.RepoSource repo_source = 2; + * + * @return The repoSource. + */ + com.google.cloud.functions.v2alpha.RepoSource getRepoSource(); + /** + * + * + *
+   * If provided, get the source from this location in a Cloud Source
+   * Repository.
+   * 
+ * + * .google.cloud.functions.v2alpha.RepoSource repo_source = 2; + */ + com.google.cloud.functions.v2alpha.RepoSourceOrBuilder getRepoSourceOrBuilder(); + + public com.google.cloud.functions.v2alpha.Source.SourceCase getSourceCase(); +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/SourceProvenance.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/SourceProvenance.java new file mode 100644 index 00000000..8fba4335 --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/SourceProvenance.java @@ -0,0 +1,1046 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +/** + * + * + *
+ * Provenance of the source. Ways to find the original source, or verify that
+ * some source was used for this build.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.SourceProvenance} + */ +public final class SourceProvenance extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2alpha.SourceProvenance) + SourceProvenanceOrBuilder { + private static final long serialVersionUID = 0L; + // Use SourceProvenance.newBuilder() to construct. + private SourceProvenance(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SourceProvenance() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SourceProvenance(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SourceProvenance( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.functions.v2alpha.StorageSource.Builder subBuilder = null; + if (resolvedStorageSource_ != null) { + subBuilder = resolvedStorageSource_.toBuilder(); + } + resolvedStorageSource_ = + input.readMessage( + com.google.cloud.functions.v2alpha.StorageSource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(resolvedStorageSource_); + resolvedStorageSource_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.cloud.functions.v2alpha.RepoSource.Builder subBuilder = null; + if (resolvedRepoSource_ != null) { + subBuilder = resolvedRepoSource_.toBuilder(); + } + resolvedRepoSource_ = + input.readMessage( + com.google.cloud.functions.v2alpha.RepoSource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(resolvedRepoSource_); + resolvedRepoSource_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_SourceProvenance_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_SourceProvenance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.SourceProvenance.class, + com.google.cloud.functions.v2alpha.SourceProvenance.Builder.class); + } + + public static final int RESOLVED_STORAGE_SOURCE_FIELD_NUMBER = 1; + private com.google.cloud.functions.v2alpha.StorageSource resolvedStorageSource_; + /** + * + * + *
+   * A copy of the build's `source.storage_source`, if exists, with any
+   * generations resolved.
+   * 
+ * + * .google.cloud.functions.v2alpha.StorageSource resolved_storage_source = 1; + * + * @return Whether the resolvedStorageSource field is set. + */ + @java.lang.Override + public boolean hasResolvedStorageSource() { + return resolvedStorageSource_ != null; + } + /** + * + * + *
+   * A copy of the build's `source.storage_source`, if exists, with any
+   * generations resolved.
+   * 
+ * + * .google.cloud.functions.v2alpha.StorageSource resolved_storage_source = 1; + * + * @return The resolvedStorageSource. + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.StorageSource getResolvedStorageSource() { + return resolvedStorageSource_ == null + ? com.google.cloud.functions.v2alpha.StorageSource.getDefaultInstance() + : resolvedStorageSource_; + } + /** + * + * + *
+   * A copy of the build's `source.storage_source`, if exists, with any
+   * generations resolved.
+   * 
+ * + * .google.cloud.functions.v2alpha.StorageSource resolved_storage_source = 1; + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.StorageSourceOrBuilder + getResolvedStorageSourceOrBuilder() { + return getResolvedStorageSource(); + } + + public static final int RESOLVED_REPO_SOURCE_FIELD_NUMBER = 2; + private com.google.cloud.functions.v2alpha.RepoSource resolvedRepoSource_; + /** + * + * + *
+   * A copy of the build's `source.repo_source`, if exists, with any
+   * revisions resolved.
+   * 
+ * + * .google.cloud.functions.v2alpha.RepoSource resolved_repo_source = 2; + * + * @return Whether the resolvedRepoSource field is set. + */ + @java.lang.Override + public boolean hasResolvedRepoSource() { + return resolvedRepoSource_ != null; + } + /** + * + * + *
+   * A copy of the build's `source.repo_source`, if exists, with any
+   * revisions resolved.
+   * 
+ * + * .google.cloud.functions.v2alpha.RepoSource resolved_repo_source = 2; + * + * @return The resolvedRepoSource. + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.RepoSource getResolvedRepoSource() { + return resolvedRepoSource_ == null + ? com.google.cloud.functions.v2alpha.RepoSource.getDefaultInstance() + : resolvedRepoSource_; + } + /** + * + * + *
+   * A copy of the build's `source.repo_source`, if exists, with any
+   * revisions resolved.
+   * 
+ * + * .google.cloud.functions.v2alpha.RepoSource resolved_repo_source = 2; + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.RepoSourceOrBuilder getResolvedRepoSourceOrBuilder() { + return getResolvedRepoSource(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (resolvedStorageSource_ != null) { + output.writeMessage(1, getResolvedStorageSource()); + } + if (resolvedRepoSource_ != null) { + output.writeMessage(2, getResolvedRepoSource()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (resolvedStorageSource_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, getResolvedStorageSource()); + } + if (resolvedRepoSource_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getResolvedRepoSource()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2alpha.SourceProvenance)) { + return super.equals(obj); + } + com.google.cloud.functions.v2alpha.SourceProvenance other = + (com.google.cloud.functions.v2alpha.SourceProvenance) obj; + + if (hasResolvedStorageSource() != other.hasResolvedStorageSource()) return false; + if (hasResolvedStorageSource()) { + if (!getResolvedStorageSource().equals(other.getResolvedStorageSource())) return false; + } + if (hasResolvedRepoSource() != other.hasResolvedRepoSource()) return false; + if (hasResolvedRepoSource()) { + if (!getResolvedRepoSource().equals(other.getResolvedRepoSource())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasResolvedStorageSource()) { + hash = (37 * hash) + RESOLVED_STORAGE_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getResolvedStorageSource().hashCode(); + } + if (hasResolvedRepoSource()) { + hash = (37 * hash) + RESOLVED_REPO_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getResolvedRepoSource().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2alpha.SourceProvenance parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.SourceProvenance parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.SourceProvenance parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.SourceProvenance parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.SourceProvenance parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.SourceProvenance parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.SourceProvenance parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.SourceProvenance parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.SourceProvenance parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.SourceProvenance parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.SourceProvenance parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.SourceProvenance parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v2alpha.SourceProvenance prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Provenance of the source. Ways to find the original source, or verify that
+   * some source was used for this build.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.SourceProvenance} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2alpha.SourceProvenance) + com.google.cloud.functions.v2alpha.SourceProvenanceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_SourceProvenance_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_SourceProvenance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.SourceProvenance.class, + com.google.cloud.functions.v2alpha.SourceProvenance.Builder.class); + } + + // Construct using com.google.cloud.functions.v2alpha.SourceProvenance.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (resolvedStorageSourceBuilder_ == null) { + resolvedStorageSource_ = null; + } else { + resolvedStorageSource_ = null; + resolvedStorageSourceBuilder_ = null; + } + if (resolvedRepoSourceBuilder_ == null) { + resolvedRepoSource_ = null; + } else { + resolvedRepoSource_ = null; + resolvedRepoSourceBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_SourceProvenance_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.SourceProvenance getDefaultInstanceForType() { + return com.google.cloud.functions.v2alpha.SourceProvenance.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.SourceProvenance build() { + com.google.cloud.functions.v2alpha.SourceProvenance result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.SourceProvenance buildPartial() { + com.google.cloud.functions.v2alpha.SourceProvenance result = + new com.google.cloud.functions.v2alpha.SourceProvenance(this); + if (resolvedStorageSourceBuilder_ == null) { + result.resolvedStorageSource_ = resolvedStorageSource_; + } else { + result.resolvedStorageSource_ = resolvedStorageSourceBuilder_.build(); + } + if (resolvedRepoSourceBuilder_ == null) { + result.resolvedRepoSource_ = resolvedRepoSource_; + } else { + result.resolvedRepoSource_ = resolvedRepoSourceBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2alpha.SourceProvenance) { + return mergeFrom((com.google.cloud.functions.v2alpha.SourceProvenance) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2alpha.SourceProvenance other) { + if (other == com.google.cloud.functions.v2alpha.SourceProvenance.getDefaultInstance()) + return this; + if (other.hasResolvedStorageSource()) { + mergeResolvedStorageSource(other.getResolvedStorageSource()); + } + if (other.hasResolvedRepoSource()) { + mergeResolvedRepoSource(other.getResolvedRepoSource()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2alpha.SourceProvenance parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2alpha.SourceProvenance) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.functions.v2alpha.StorageSource resolvedStorageSource_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2alpha.StorageSource, + com.google.cloud.functions.v2alpha.StorageSource.Builder, + com.google.cloud.functions.v2alpha.StorageSourceOrBuilder> + resolvedStorageSourceBuilder_; + /** + * + * + *
+     * A copy of the build's `source.storage_source`, if exists, with any
+     * generations resolved.
+     * 
+ * + * .google.cloud.functions.v2alpha.StorageSource resolved_storage_source = 1; + * + * @return Whether the resolvedStorageSource field is set. + */ + public boolean hasResolvedStorageSource() { + return resolvedStorageSourceBuilder_ != null || resolvedStorageSource_ != null; + } + /** + * + * + *
+     * A copy of the build's `source.storage_source`, if exists, with any
+     * generations resolved.
+     * 
+ * + * .google.cloud.functions.v2alpha.StorageSource resolved_storage_source = 1; + * + * @return The resolvedStorageSource. + */ + public com.google.cloud.functions.v2alpha.StorageSource getResolvedStorageSource() { + if (resolvedStorageSourceBuilder_ == null) { + return resolvedStorageSource_ == null + ? com.google.cloud.functions.v2alpha.StorageSource.getDefaultInstance() + : resolvedStorageSource_; + } else { + return resolvedStorageSourceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * A copy of the build's `source.storage_source`, if exists, with any
+     * generations resolved.
+     * 
+ * + * .google.cloud.functions.v2alpha.StorageSource resolved_storage_source = 1; + */ + public Builder setResolvedStorageSource( + com.google.cloud.functions.v2alpha.StorageSource value) { + if (resolvedStorageSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resolvedStorageSource_ = value; + onChanged(); + } else { + resolvedStorageSourceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * A copy of the build's `source.storage_source`, if exists, with any
+     * generations resolved.
+     * 
+ * + * .google.cloud.functions.v2alpha.StorageSource resolved_storage_source = 1; + */ + public Builder setResolvedStorageSource( + com.google.cloud.functions.v2alpha.StorageSource.Builder builderForValue) { + if (resolvedStorageSourceBuilder_ == null) { + resolvedStorageSource_ = builderForValue.build(); + onChanged(); + } else { + resolvedStorageSourceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * A copy of the build's `source.storage_source`, if exists, with any
+     * generations resolved.
+     * 
+ * + * .google.cloud.functions.v2alpha.StorageSource resolved_storage_source = 1; + */ + public Builder mergeResolvedStorageSource( + com.google.cloud.functions.v2alpha.StorageSource value) { + if (resolvedStorageSourceBuilder_ == null) { + if (resolvedStorageSource_ != null) { + resolvedStorageSource_ = + com.google.cloud.functions.v2alpha.StorageSource.newBuilder(resolvedStorageSource_) + .mergeFrom(value) + .buildPartial(); + } else { + resolvedStorageSource_ = value; + } + onChanged(); + } else { + resolvedStorageSourceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * A copy of the build's `source.storage_source`, if exists, with any
+     * generations resolved.
+     * 
+ * + * .google.cloud.functions.v2alpha.StorageSource resolved_storage_source = 1; + */ + public Builder clearResolvedStorageSource() { + if (resolvedStorageSourceBuilder_ == null) { + resolvedStorageSource_ = null; + onChanged(); + } else { + resolvedStorageSource_ = null; + resolvedStorageSourceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * A copy of the build's `source.storage_source`, if exists, with any
+     * generations resolved.
+     * 
+ * + * .google.cloud.functions.v2alpha.StorageSource resolved_storage_source = 1; + */ + public com.google.cloud.functions.v2alpha.StorageSource.Builder + getResolvedStorageSourceBuilder() { + + onChanged(); + return getResolvedStorageSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A copy of the build's `source.storage_source`, if exists, with any
+     * generations resolved.
+     * 
+ * + * .google.cloud.functions.v2alpha.StorageSource resolved_storage_source = 1; + */ + public com.google.cloud.functions.v2alpha.StorageSourceOrBuilder + getResolvedStorageSourceOrBuilder() { + if (resolvedStorageSourceBuilder_ != null) { + return resolvedStorageSourceBuilder_.getMessageOrBuilder(); + } else { + return resolvedStorageSource_ == null + ? com.google.cloud.functions.v2alpha.StorageSource.getDefaultInstance() + : resolvedStorageSource_; + } + } + /** + * + * + *
+     * A copy of the build's `source.storage_source`, if exists, with any
+     * generations resolved.
+     * 
+ * + * .google.cloud.functions.v2alpha.StorageSource resolved_storage_source = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2alpha.StorageSource, + com.google.cloud.functions.v2alpha.StorageSource.Builder, + com.google.cloud.functions.v2alpha.StorageSourceOrBuilder> + getResolvedStorageSourceFieldBuilder() { + if (resolvedStorageSourceBuilder_ == null) { + resolvedStorageSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2alpha.StorageSource, + com.google.cloud.functions.v2alpha.StorageSource.Builder, + com.google.cloud.functions.v2alpha.StorageSourceOrBuilder>( + getResolvedStorageSource(), getParentForChildren(), isClean()); + resolvedStorageSource_ = null; + } + return resolvedStorageSourceBuilder_; + } + + private com.google.cloud.functions.v2alpha.RepoSource resolvedRepoSource_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2alpha.RepoSource, + com.google.cloud.functions.v2alpha.RepoSource.Builder, + com.google.cloud.functions.v2alpha.RepoSourceOrBuilder> + resolvedRepoSourceBuilder_; + /** + * + * + *
+     * A copy of the build's `source.repo_source`, if exists, with any
+     * revisions resolved.
+     * 
+ * + * .google.cloud.functions.v2alpha.RepoSource resolved_repo_source = 2; + * + * @return Whether the resolvedRepoSource field is set. + */ + public boolean hasResolvedRepoSource() { + return resolvedRepoSourceBuilder_ != null || resolvedRepoSource_ != null; + } + /** + * + * + *
+     * A copy of the build's `source.repo_source`, if exists, with any
+     * revisions resolved.
+     * 
+ * + * .google.cloud.functions.v2alpha.RepoSource resolved_repo_source = 2; + * + * @return The resolvedRepoSource. + */ + public com.google.cloud.functions.v2alpha.RepoSource getResolvedRepoSource() { + if (resolvedRepoSourceBuilder_ == null) { + return resolvedRepoSource_ == null + ? com.google.cloud.functions.v2alpha.RepoSource.getDefaultInstance() + : resolvedRepoSource_; + } else { + return resolvedRepoSourceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * A copy of the build's `source.repo_source`, if exists, with any
+     * revisions resolved.
+     * 
+ * + * .google.cloud.functions.v2alpha.RepoSource resolved_repo_source = 2; + */ + public Builder setResolvedRepoSource(com.google.cloud.functions.v2alpha.RepoSource value) { + if (resolvedRepoSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resolvedRepoSource_ = value; + onChanged(); + } else { + resolvedRepoSourceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * A copy of the build's `source.repo_source`, if exists, with any
+     * revisions resolved.
+     * 
+ * + * .google.cloud.functions.v2alpha.RepoSource resolved_repo_source = 2; + */ + public Builder setResolvedRepoSource( + com.google.cloud.functions.v2alpha.RepoSource.Builder builderForValue) { + if (resolvedRepoSourceBuilder_ == null) { + resolvedRepoSource_ = builderForValue.build(); + onChanged(); + } else { + resolvedRepoSourceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * A copy of the build's `source.repo_source`, if exists, with any
+     * revisions resolved.
+     * 
+ * + * .google.cloud.functions.v2alpha.RepoSource resolved_repo_source = 2; + */ + public Builder mergeResolvedRepoSource(com.google.cloud.functions.v2alpha.RepoSource value) { + if (resolvedRepoSourceBuilder_ == null) { + if (resolvedRepoSource_ != null) { + resolvedRepoSource_ = + com.google.cloud.functions.v2alpha.RepoSource.newBuilder(resolvedRepoSource_) + .mergeFrom(value) + .buildPartial(); + } else { + resolvedRepoSource_ = value; + } + onChanged(); + } else { + resolvedRepoSourceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * A copy of the build's `source.repo_source`, if exists, with any
+     * revisions resolved.
+     * 
+ * + * .google.cloud.functions.v2alpha.RepoSource resolved_repo_source = 2; + */ + public Builder clearResolvedRepoSource() { + if (resolvedRepoSourceBuilder_ == null) { + resolvedRepoSource_ = null; + onChanged(); + } else { + resolvedRepoSource_ = null; + resolvedRepoSourceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * A copy of the build's `source.repo_source`, if exists, with any
+     * revisions resolved.
+     * 
+ * + * .google.cloud.functions.v2alpha.RepoSource resolved_repo_source = 2; + */ + public com.google.cloud.functions.v2alpha.RepoSource.Builder getResolvedRepoSourceBuilder() { + + onChanged(); + return getResolvedRepoSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A copy of the build's `source.repo_source`, if exists, with any
+     * revisions resolved.
+     * 
+ * + * .google.cloud.functions.v2alpha.RepoSource resolved_repo_source = 2; + */ + public com.google.cloud.functions.v2alpha.RepoSourceOrBuilder getResolvedRepoSourceOrBuilder() { + if (resolvedRepoSourceBuilder_ != null) { + return resolvedRepoSourceBuilder_.getMessageOrBuilder(); + } else { + return resolvedRepoSource_ == null + ? com.google.cloud.functions.v2alpha.RepoSource.getDefaultInstance() + : resolvedRepoSource_; + } + } + /** + * + * + *
+     * A copy of the build's `source.repo_source`, if exists, with any
+     * revisions resolved.
+     * 
+ * + * .google.cloud.functions.v2alpha.RepoSource resolved_repo_source = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2alpha.RepoSource, + com.google.cloud.functions.v2alpha.RepoSource.Builder, + com.google.cloud.functions.v2alpha.RepoSourceOrBuilder> + getResolvedRepoSourceFieldBuilder() { + if (resolvedRepoSourceBuilder_ == null) { + resolvedRepoSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2alpha.RepoSource, + com.google.cloud.functions.v2alpha.RepoSource.Builder, + com.google.cloud.functions.v2alpha.RepoSourceOrBuilder>( + getResolvedRepoSource(), getParentForChildren(), isClean()); + resolvedRepoSource_ = null; + } + return resolvedRepoSourceBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2alpha.SourceProvenance) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2alpha.SourceProvenance) + private static final com.google.cloud.functions.v2alpha.SourceProvenance DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2alpha.SourceProvenance(); + } + + public static com.google.cloud.functions.v2alpha.SourceProvenance getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SourceProvenance parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SourceProvenance(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.SourceProvenance getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/SourceProvenanceOrBuilder.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/SourceProvenanceOrBuilder.java new file mode 100644 index 00000000..322e6b23 --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/SourceProvenanceOrBuilder.java @@ -0,0 +1,101 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +public interface SourceProvenanceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2alpha.SourceProvenance) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A copy of the build's `source.storage_source`, if exists, with any
+   * generations resolved.
+   * 
+ * + * .google.cloud.functions.v2alpha.StorageSource resolved_storage_source = 1; + * + * @return Whether the resolvedStorageSource field is set. + */ + boolean hasResolvedStorageSource(); + /** + * + * + *
+   * A copy of the build's `source.storage_source`, if exists, with any
+   * generations resolved.
+   * 
+ * + * .google.cloud.functions.v2alpha.StorageSource resolved_storage_source = 1; + * + * @return The resolvedStorageSource. + */ + com.google.cloud.functions.v2alpha.StorageSource getResolvedStorageSource(); + /** + * + * + *
+   * A copy of the build's `source.storage_source`, if exists, with any
+   * generations resolved.
+   * 
+ * + * .google.cloud.functions.v2alpha.StorageSource resolved_storage_source = 1; + */ + com.google.cloud.functions.v2alpha.StorageSourceOrBuilder getResolvedStorageSourceOrBuilder(); + + /** + * + * + *
+   * A copy of the build's `source.repo_source`, if exists, with any
+   * revisions resolved.
+   * 
+ * + * .google.cloud.functions.v2alpha.RepoSource resolved_repo_source = 2; + * + * @return Whether the resolvedRepoSource field is set. + */ + boolean hasResolvedRepoSource(); + /** + * + * + *
+   * A copy of the build's `source.repo_source`, if exists, with any
+   * revisions resolved.
+   * 
+ * + * .google.cloud.functions.v2alpha.RepoSource resolved_repo_source = 2; + * + * @return The resolvedRepoSource. + */ + com.google.cloud.functions.v2alpha.RepoSource getResolvedRepoSource(); + /** + * + * + *
+   * A copy of the build's `source.repo_source`, if exists, with any
+   * revisions resolved.
+   * 
+ * + * .google.cloud.functions.v2alpha.RepoSource resolved_repo_source = 2; + */ + com.google.cloud.functions.v2alpha.RepoSourceOrBuilder getResolvedRepoSourceOrBuilder(); +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/Stage.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/Stage.java new file mode 100644 index 00000000..a72d37b4 --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/Stage.java @@ -0,0 +1,2222 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +/** + * + * + *
+ * Each Stage of the deployment process
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.Stage} + */ +public final class Stage extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2alpha.Stage) + StageOrBuilder { + private static final long serialVersionUID = 0L; + // Use Stage.newBuilder() to construct. + private Stage(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Stage() { + name_ = 0; + message_ = ""; + state_ = 0; + resource_ = ""; + resourceUri_ = ""; + stateMessages_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Stage(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Stage( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + name_ = rawValue; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + message_ = s; + break; + } + case 24: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + resource_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + resourceUri_ = s; + break; + } + case 50: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + stateMessages_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + stateMessages_.add( + input.readMessage( + com.google.cloud.functions.v2alpha.StateMessage.parser(), extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + stateMessages_ = java.util.Collections.unmodifiableList(stateMessages_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_Stage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_Stage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.Stage.class, + com.google.cloud.functions.v2alpha.Stage.Builder.class); + } + + /** + * + * + *
+   * Possible names for a Stage
+   * 
+ * + * Protobuf enum {@code google.cloud.functions.v2alpha.Stage.Name} + */ + public enum Name implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not specified. Invalid name.
+     * 
+ * + * NAME_UNSPECIFIED = 0; + */ + NAME_UNSPECIFIED(0), + /** + * + * + *
+     * Artifact Regsitry Stage
+     * 
+ * + * ARTIFACT_REGISTRY = 1; + */ + ARTIFACT_REGISTRY(1), + /** + * + * + *
+     * Build Stage
+     * 
+ * + * BUILD = 2; + */ + BUILD(2), + /** + * + * + *
+     * Service Stage
+     * 
+ * + * SERVICE = 3; + */ + SERVICE(3), + /** + * + * + *
+     * Trigger Stage
+     * 
+ * + * TRIGGER = 4; + */ + TRIGGER(4), + /** + * + * + *
+     * Service Rollback Stage
+     * 
+ * + * SERVICE_ROLLBACK = 5; + */ + SERVICE_ROLLBACK(5), + /** + * + * + *
+     * Trigger Rollback Stage
+     * 
+ * + * TRIGGER_ROLLBACK = 6; + */ + TRIGGER_ROLLBACK(6), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not specified. Invalid name.
+     * 
+ * + * NAME_UNSPECIFIED = 0; + */ + public static final int NAME_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Artifact Regsitry Stage
+     * 
+ * + * ARTIFACT_REGISTRY = 1; + */ + public static final int ARTIFACT_REGISTRY_VALUE = 1; + /** + * + * + *
+     * Build Stage
+     * 
+ * + * BUILD = 2; + */ + public static final int BUILD_VALUE = 2; + /** + * + * + *
+     * Service Stage
+     * 
+ * + * SERVICE = 3; + */ + public static final int SERVICE_VALUE = 3; + /** + * + * + *
+     * Trigger Stage
+     * 
+ * + * TRIGGER = 4; + */ + public static final int TRIGGER_VALUE = 4; + /** + * + * + *
+     * Service Rollback Stage
+     * 
+ * + * SERVICE_ROLLBACK = 5; + */ + public static final int SERVICE_ROLLBACK_VALUE = 5; + /** + * + * + *
+     * Trigger Rollback Stage
+     * 
+ * + * TRIGGER_ROLLBACK = 6; + */ + public static final int TRIGGER_ROLLBACK_VALUE = 6; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Name valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Name forNumber(int value) { + switch (value) { + case 0: + return NAME_UNSPECIFIED; + case 1: + return ARTIFACT_REGISTRY; + case 2: + return BUILD; + case 3: + return SERVICE; + case 4: + return TRIGGER; + case 5: + return SERVICE_ROLLBACK; + case 6: + return TRIGGER_ROLLBACK; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Name findValueByNumber(int number) { + return Name.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.Stage.getDescriptor().getEnumTypes().get(0); + } + + private static final Name[] VALUES = values(); + + public static Name valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Name(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.functions.v2alpha.Stage.Name) + } + + /** + * + * + *
+   * Possible states for a Stage
+   * 
+ * + * Protobuf enum {@code google.cloud.functions.v2alpha.Stage.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not specified. Invalid state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Stage has not started.
+     * 
+ * + * NOT_STARTED = 1; + */ + NOT_STARTED(1), + /** + * + * + *
+     * Stage is in progress.
+     * 
+ * + * IN_PROGRESS = 2; + */ + IN_PROGRESS(2), + /** + * + * + *
+     * Stage has completed.
+     * 
+ * + * COMPLETE = 3; + */ + COMPLETE(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not specified. Invalid state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Stage has not started.
+     * 
+ * + * NOT_STARTED = 1; + */ + public static final int NOT_STARTED_VALUE = 1; + /** + * + * + *
+     * Stage is in progress.
+     * 
+ * + * IN_PROGRESS = 2; + */ + public static final int IN_PROGRESS_VALUE = 2; + /** + * + * + *
+     * Stage has completed.
+     * 
+ * + * COMPLETE = 3; + */ + public static final int COMPLETE_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static State valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 1: + return NOT_STARTED; + case 2: + return IN_PROGRESS; + case 3: + return COMPLETE; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.Stage.getDescriptor().getEnumTypes().get(1); + } + + private static final State[] VALUES = values(); + + public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.functions.v2alpha.Stage.State) + } + + public static final int NAME_FIELD_NUMBER = 1; + private int name_; + /** + * + * + *
+   * Name of the Stage. This will be unique for each Stage.
+   * 
+ * + * .google.cloud.functions.v2alpha.Stage.Name name = 1; + * + * @return The enum numeric value on the wire for name. + */ + @java.lang.Override + public int getNameValue() { + return name_; + } + /** + * + * + *
+   * Name of the Stage. This will be unique for each Stage.
+   * 
+ * + * .google.cloud.functions.v2alpha.Stage.Name name = 1; + * + * @return The name. + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.Stage.Name getName() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2alpha.Stage.Name result = + com.google.cloud.functions.v2alpha.Stage.Name.valueOf(name_); + return result == null ? com.google.cloud.functions.v2alpha.Stage.Name.UNRECOGNIZED : result; + } + + public static final int MESSAGE_FIELD_NUMBER = 2; + private volatile java.lang.Object message_; + /** + * + * + *
+   * Message describing the Stage
+   * 
+ * + * string message = 2; + * + * @return The message. + */ + @java.lang.Override + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } + } + /** + * + * + *
+   * Message describing the Stage
+   * 
+ * + * string message = 2; + * + * @return The bytes for message. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATE_FIELD_NUMBER = 3; + private int state_; + /** + * + * + *
+   * Current state of the Stage
+   * 
+ * + * .google.cloud.functions.v2alpha.Stage.State state = 3; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Current state of the Stage
+   * 
+ * + * .google.cloud.functions.v2alpha.Stage.State state = 3; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.Stage.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2alpha.Stage.State result = + com.google.cloud.functions.v2alpha.Stage.State.valueOf(state_); + return result == null ? com.google.cloud.functions.v2alpha.Stage.State.UNRECOGNIZED : result; + } + + public static final int RESOURCE_FIELD_NUMBER = 4; + private volatile java.lang.Object resource_; + /** + * + * + *
+   * Resource of the Stage
+   * 
+ * + * string resource = 4; + * + * @return The resource. + */ + @java.lang.Override + public java.lang.String getResource() { + java.lang.Object ref = resource_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resource_ = s; + return s; + } + } + /** + * + * + *
+   * Resource of the Stage
+   * 
+ * + * string resource = 4; + * + * @return The bytes for resource. + */ + @java.lang.Override + public com.google.protobuf.ByteString getResourceBytes() { + java.lang.Object ref = resource_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOURCE_URI_FIELD_NUMBER = 5; + private volatile java.lang.Object resourceUri_; + /** + * + * + *
+   * Link to the current Stage resource
+   * 
+ * + * string resource_uri = 5; + * + * @return The resourceUri. + */ + @java.lang.Override + public java.lang.String getResourceUri() { + java.lang.Object ref = resourceUri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceUri_ = s; + return s; + } + } + /** + * + * + *
+   * Link to the current Stage resource
+   * 
+ * + * string resource_uri = 5; + * + * @return The bytes for resourceUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getResourceUriBytes() { + java.lang.Object ref = resourceUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATE_MESSAGES_FIELD_NUMBER = 6; + private java.util.List stateMessages_; + /** + * + * + *
+   * State messages from the current Stage.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 6; + */ + @java.lang.Override + public java.util.List getStateMessagesList() { + return stateMessages_; + } + /** + * + * + *
+   * State messages from the current Stage.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 6; + */ + @java.lang.Override + public java.util.List + getStateMessagesOrBuilderList() { + return stateMessages_; + } + /** + * + * + *
+   * State messages from the current Stage.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 6; + */ + @java.lang.Override + public int getStateMessagesCount() { + return stateMessages_.size(); + } + /** + * + * + *
+   * State messages from the current Stage.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 6; + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.StateMessage getStateMessages(int index) { + return stateMessages_.get(index); + } + /** + * + * + *
+   * State messages from the current Stage.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 6; + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.StateMessageOrBuilder getStateMessagesOrBuilder( + int index) { + return stateMessages_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (name_ != com.google.cloud.functions.v2alpha.Stage.Name.NAME_UNSPECIFIED.getNumber()) { + output.writeEnum(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(message_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, message_); + } + if (state_ != com.google.cloud.functions.v2alpha.Stage.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(3, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resource_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, resource_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resourceUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, resourceUri_); + } + for (int i = 0; i < stateMessages_.size(); i++) { + output.writeMessage(6, stateMessages_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (name_ != com.google.cloud.functions.v2alpha.Stage.Name.NAME_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(message_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, message_); + } + if (state_ != com.google.cloud.functions.v2alpha.Stage.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resource_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, resource_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resourceUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, resourceUri_); + } + for (int i = 0; i < stateMessages_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, stateMessages_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2alpha.Stage)) { + return super.equals(obj); + } + com.google.cloud.functions.v2alpha.Stage other = (com.google.cloud.functions.v2alpha.Stage) obj; + + if (name_ != other.name_) return false; + if (!getMessage().equals(other.getMessage())) return false; + if (state_ != other.state_) return false; + if (!getResource().equals(other.getResource())) return false; + if (!getResourceUri().equals(other.getResourceUri())) return false; + if (!getStateMessagesList().equals(other.getStateMessagesList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + name_; + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + RESOURCE_FIELD_NUMBER; + hash = (53 * hash) + getResource().hashCode(); + hash = (37 * hash) + RESOURCE_URI_FIELD_NUMBER; + hash = (53 * hash) + getResourceUri().hashCode(); + if (getStateMessagesCount() > 0) { + hash = (37 * hash) + STATE_MESSAGES_FIELD_NUMBER; + hash = (53 * hash) + getStateMessagesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2alpha.Stage parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.Stage parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.Stage parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.Stage parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.Stage parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.Stage parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.Stage parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.Stage parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.Stage parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.Stage parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.Stage parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.Stage parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v2alpha.Stage prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Each Stage of the deployment process
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.Stage} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2alpha.Stage) + com.google.cloud.functions.v2alpha.StageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_Stage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_Stage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.Stage.class, + com.google.cloud.functions.v2alpha.Stage.Builder.class); + } + + // Construct using com.google.cloud.functions.v2alpha.Stage.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getStateMessagesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = 0; + + message_ = ""; + + state_ = 0; + + resource_ = ""; + + resourceUri_ = ""; + + if (stateMessagesBuilder_ == null) { + stateMessages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + stateMessagesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_Stage_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.Stage getDefaultInstanceForType() { + return com.google.cloud.functions.v2alpha.Stage.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.Stage build() { + com.google.cloud.functions.v2alpha.Stage result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.Stage buildPartial() { + com.google.cloud.functions.v2alpha.Stage result = + new com.google.cloud.functions.v2alpha.Stage(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.message_ = message_; + result.state_ = state_; + result.resource_ = resource_; + result.resourceUri_ = resourceUri_; + if (stateMessagesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + stateMessages_ = java.util.Collections.unmodifiableList(stateMessages_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.stateMessages_ = stateMessages_; + } else { + result.stateMessages_ = stateMessagesBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2alpha.Stage) { + return mergeFrom((com.google.cloud.functions.v2alpha.Stage) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2alpha.Stage other) { + if (other == com.google.cloud.functions.v2alpha.Stage.getDefaultInstance()) return this; + if (other.name_ != 0) { + setNameValue(other.getNameValue()); + } + if (!other.getMessage().isEmpty()) { + message_ = other.message_; + onChanged(); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (!other.getResource().isEmpty()) { + resource_ = other.resource_; + onChanged(); + } + if (!other.getResourceUri().isEmpty()) { + resourceUri_ = other.resourceUri_; + onChanged(); + } + if (stateMessagesBuilder_ == null) { + if (!other.stateMessages_.isEmpty()) { + if (stateMessages_.isEmpty()) { + stateMessages_ = other.stateMessages_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureStateMessagesIsMutable(); + stateMessages_.addAll(other.stateMessages_); + } + onChanged(); + } + } else { + if (!other.stateMessages_.isEmpty()) { + if (stateMessagesBuilder_.isEmpty()) { + stateMessagesBuilder_.dispose(); + stateMessagesBuilder_ = null; + stateMessages_ = other.stateMessages_; + bitField0_ = (bitField0_ & ~0x00000001); + stateMessagesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getStateMessagesFieldBuilder() + : null; + } else { + stateMessagesBuilder_.addAllMessages(other.stateMessages_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2alpha.Stage parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v2alpha.Stage) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private int name_ = 0; + /** + * + * + *
+     * Name of the Stage. This will be unique for each Stage.
+     * 
+ * + * .google.cloud.functions.v2alpha.Stage.Name name = 1; + * + * @return The enum numeric value on the wire for name. + */ + @java.lang.Override + public int getNameValue() { + return name_; + } + /** + * + * + *
+     * Name of the Stage. This will be unique for each Stage.
+     * 
+ * + * .google.cloud.functions.v2alpha.Stage.Name name = 1; + * + * @param value The enum numeric value on the wire for name to set. + * @return This builder for chaining. + */ + public Builder setNameValue(int value) { + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the Stage. This will be unique for each Stage.
+     * 
+ * + * .google.cloud.functions.v2alpha.Stage.Name name = 1; + * + * @return The name. + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.Stage.Name getName() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2alpha.Stage.Name result = + com.google.cloud.functions.v2alpha.Stage.Name.valueOf(name_); + return result == null ? com.google.cloud.functions.v2alpha.Stage.Name.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Name of the Stage. This will be unique for each Stage.
+     * 
+ * + * .google.cloud.functions.v2alpha.Stage.Name name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(com.google.cloud.functions.v2alpha.Stage.Name value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the Stage. This will be unique for each Stage.
+     * 
+ * + * .google.cloud.functions.v2alpha.Stage.Name name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = 0; + onChanged(); + return this; + } + + private java.lang.Object message_ = ""; + /** + * + * + *
+     * Message describing the Stage
+     * 
+ * + * string message = 2; + * + * @return The message. + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Message describing the Stage
+     * 
+ * + * string message = 2; + * + * @return The bytes for message. + */ + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Message describing the Stage
+     * 
+ * + * string message = 2; + * + * @param value The message to set. + * @return This builder for chaining. + */ + public Builder setMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + message_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Message describing the Stage
+     * 
+ * + * string message = 2; + * + * @return This builder for chaining. + */ + public Builder clearMessage() { + + message_ = getDefaultInstance().getMessage(); + onChanged(); + return this; + } + /** + * + * + *
+     * Message describing the Stage
+     * 
+ * + * string message = 2; + * + * @param value The bytes for message to set. + * @return This builder for chaining. + */ + public Builder setMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + message_ = value; + onChanged(); + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * Current state of the Stage
+     * 
+ * + * .google.cloud.functions.v2alpha.Stage.State state = 3; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Current state of the Stage
+     * 
+ * + * .google.cloud.functions.v2alpha.Stage.State state = 3; + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + + state_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Current state of the Stage
+     * 
+ * + * .google.cloud.functions.v2alpha.Stage.State state = 3; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.Stage.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2alpha.Stage.State result = + com.google.cloud.functions.v2alpha.Stage.State.valueOf(state_); + return result == null ? com.google.cloud.functions.v2alpha.Stage.State.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Current state of the Stage
+     * 
+ * + * .google.cloud.functions.v2alpha.Stage.State state = 3; + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.functions.v2alpha.Stage.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Current state of the Stage
+     * 
+ * + * .google.cloud.functions.v2alpha.Stage.State state = 3; + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private java.lang.Object resource_ = ""; + /** + * + * + *
+     * Resource of the Stage
+     * 
+ * + * string resource = 4; + * + * @return The resource. + */ + public java.lang.String getResource() { + java.lang.Object ref = resource_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resource_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Resource of the Stage
+     * 
+ * + * string resource = 4; + * + * @return The bytes for resource. + */ + public com.google.protobuf.ByteString getResourceBytes() { + java.lang.Object ref = resource_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Resource of the Stage
+     * 
+ * + * string resource = 4; + * + * @param value The resource to set. + * @return This builder for chaining. + */ + public Builder setResource(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + resource_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Resource of the Stage
+     * 
+ * + * string resource = 4; + * + * @return This builder for chaining. + */ + public Builder clearResource() { + + resource_ = getDefaultInstance().getResource(); + onChanged(); + return this; + } + /** + * + * + *
+     * Resource of the Stage
+     * 
+ * + * string resource = 4; + * + * @param value The bytes for resource to set. + * @return This builder for chaining. + */ + public Builder setResourceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + resource_ = value; + onChanged(); + return this; + } + + private java.lang.Object resourceUri_ = ""; + /** + * + * + *
+     * Link to the current Stage resource
+     * 
+ * + * string resource_uri = 5; + * + * @return The resourceUri. + */ + public java.lang.String getResourceUri() { + java.lang.Object ref = resourceUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Link to the current Stage resource
+     * 
+ * + * string resource_uri = 5; + * + * @return The bytes for resourceUri. + */ + public com.google.protobuf.ByteString getResourceUriBytes() { + java.lang.Object ref = resourceUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Link to the current Stage resource
+     * 
+ * + * string resource_uri = 5; + * + * @param value The resourceUri to set. + * @return This builder for chaining. + */ + public Builder setResourceUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + resourceUri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Link to the current Stage resource
+     * 
+ * + * string resource_uri = 5; + * + * @return This builder for chaining. + */ + public Builder clearResourceUri() { + + resourceUri_ = getDefaultInstance().getResourceUri(); + onChanged(); + return this; + } + /** + * + * + *
+     * Link to the current Stage resource
+     * 
+ * + * string resource_uri = 5; + * + * @param value The bytes for resourceUri to set. + * @return This builder for chaining. + */ + public Builder setResourceUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + resourceUri_ = value; + onChanged(); + return this; + } + + private java.util.List stateMessages_ = + java.util.Collections.emptyList(); + + private void ensureStateMessagesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + stateMessages_ = + new java.util.ArrayList( + stateMessages_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2alpha.StateMessage, + com.google.cloud.functions.v2alpha.StateMessage.Builder, + com.google.cloud.functions.v2alpha.StateMessageOrBuilder> + stateMessagesBuilder_; + + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 6; + */ + public java.util.List getStateMessagesList() { + if (stateMessagesBuilder_ == null) { + return java.util.Collections.unmodifiableList(stateMessages_); + } else { + return stateMessagesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 6; + */ + public int getStateMessagesCount() { + if (stateMessagesBuilder_ == null) { + return stateMessages_.size(); + } else { + return stateMessagesBuilder_.getCount(); + } + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 6; + */ + public com.google.cloud.functions.v2alpha.StateMessage getStateMessages(int index) { + if (stateMessagesBuilder_ == null) { + return stateMessages_.get(index); + } else { + return stateMessagesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 6; + */ + public Builder setStateMessages( + int index, com.google.cloud.functions.v2alpha.StateMessage value) { + if (stateMessagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStateMessagesIsMutable(); + stateMessages_.set(index, value); + onChanged(); + } else { + stateMessagesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 6; + */ + public Builder setStateMessages( + int index, com.google.cloud.functions.v2alpha.StateMessage.Builder builderForValue) { + if (stateMessagesBuilder_ == null) { + ensureStateMessagesIsMutable(); + stateMessages_.set(index, builderForValue.build()); + onChanged(); + } else { + stateMessagesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 6; + */ + public Builder addStateMessages(com.google.cloud.functions.v2alpha.StateMessage value) { + if (stateMessagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStateMessagesIsMutable(); + stateMessages_.add(value); + onChanged(); + } else { + stateMessagesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 6; + */ + public Builder addStateMessages( + int index, com.google.cloud.functions.v2alpha.StateMessage value) { + if (stateMessagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStateMessagesIsMutable(); + stateMessages_.add(index, value); + onChanged(); + } else { + stateMessagesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 6; + */ + public Builder addStateMessages( + com.google.cloud.functions.v2alpha.StateMessage.Builder builderForValue) { + if (stateMessagesBuilder_ == null) { + ensureStateMessagesIsMutable(); + stateMessages_.add(builderForValue.build()); + onChanged(); + } else { + stateMessagesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 6; + */ + public Builder addStateMessages( + int index, com.google.cloud.functions.v2alpha.StateMessage.Builder builderForValue) { + if (stateMessagesBuilder_ == null) { + ensureStateMessagesIsMutable(); + stateMessages_.add(index, builderForValue.build()); + onChanged(); + } else { + stateMessagesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 6; + */ + public Builder addAllStateMessages( + java.lang.Iterable values) { + if (stateMessagesBuilder_ == null) { + ensureStateMessagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, stateMessages_); + onChanged(); + } else { + stateMessagesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 6; + */ + public Builder clearStateMessages() { + if (stateMessagesBuilder_ == null) { + stateMessages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + stateMessagesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 6; + */ + public Builder removeStateMessages(int index) { + if (stateMessagesBuilder_ == null) { + ensureStateMessagesIsMutable(); + stateMessages_.remove(index); + onChanged(); + } else { + stateMessagesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 6; + */ + public com.google.cloud.functions.v2alpha.StateMessage.Builder getStateMessagesBuilder( + int index) { + return getStateMessagesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 6; + */ + public com.google.cloud.functions.v2alpha.StateMessageOrBuilder getStateMessagesOrBuilder( + int index) { + if (stateMessagesBuilder_ == null) { + return stateMessages_.get(index); + } else { + return stateMessagesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 6; + */ + public java.util.List + getStateMessagesOrBuilderList() { + if (stateMessagesBuilder_ != null) { + return stateMessagesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(stateMessages_); + } + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 6; + */ + public com.google.cloud.functions.v2alpha.StateMessage.Builder addStateMessagesBuilder() { + return getStateMessagesFieldBuilder() + .addBuilder(com.google.cloud.functions.v2alpha.StateMessage.getDefaultInstance()); + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 6; + */ + public com.google.cloud.functions.v2alpha.StateMessage.Builder addStateMessagesBuilder( + int index) { + return getStateMessagesFieldBuilder() + .addBuilder(index, com.google.cloud.functions.v2alpha.StateMessage.getDefaultInstance()); + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 6; + */ + public java.util.List + getStateMessagesBuilderList() { + return getStateMessagesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2alpha.StateMessage, + com.google.cloud.functions.v2alpha.StateMessage.Builder, + com.google.cloud.functions.v2alpha.StateMessageOrBuilder> + getStateMessagesFieldBuilder() { + if (stateMessagesBuilder_ == null) { + stateMessagesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2alpha.StateMessage, + com.google.cloud.functions.v2alpha.StateMessage.Builder, + com.google.cloud.functions.v2alpha.StateMessageOrBuilder>( + stateMessages_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + stateMessages_ = null; + } + return stateMessagesBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2alpha.Stage) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2alpha.Stage) + private static final com.google.cloud.functions.v2alpha.Stage DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2alpha.Stage(); + } + + public static com.google.cloud.functions.v2alpha.Stage getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Stage parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Stage(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.Stage getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/StageOrBuilder.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/StageOrBuilder.java new file mode 100644 index 00000000..47a82604 --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/StageOrBuilder.java @@ -0,0 +1,202 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +public interface StageOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2alpha.Stage) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of the Stage. This will be unique for each Stage.
+   * 
+ * + * .google.cloud.functions.v2alpha.Stage.Name name = 1; + * + * @return The enum numeric value on the wire for name. + */ + int getNameValue(); + /** + * + * + *
+   * Name of the Stage. This will be unique for each Stage.
+   * 
+ * + * .google.cloud.functions.v2alpha.Stage.Name name = 1; + * + * @return The name. + */ + com.google.cloud.functions.v2alpha.Stage.Name getName(); + + /** + * + * + *
+   * Message describing the Stage
+   * 
+ * + * string message = 2; + * + * @return The message. + */ + java.lang.String getMessage(); + /** + * + * + *
+   * Message describing the Stage
+   * 
+ * + * string message = 2; + * + * @return The bytes for message. + */ + com.google.protobuf.ByteString getMessageBytes(); + + /** + * + * + *
+   * Current state of the Stage
+   * 
+ * + * .google.cloud.functions.v2alpha.Stage.State state = 3; + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Current state of the Stage
+   * 
+ * + * .google.cloud.functions.v2alpha.Stage.State state = 3; + * + * @return The state. + */ + com.google.cloud.functions.v2alpha.Stage.State getState(); + + /** + * + * + *
+   * Resource of the Stage
+   * 
+ * + * string resource = 4; + * + * @return The resource. + */ + java.lang.String getResource(); + /** + * + * + *
+   * Resource of the Stage
+   * 
+ * + * string resource = 4; + * + * @return The bytes for resource. + */ + com.google.protobuf.ByteString getResourceBytes(); + + /** + * + * + *
+   * Link to the current Stage resource
+   * 
+ * + * string resource_uri = 5; + * + * @return The resourceUri. + */ + java.lang.String getResourceUri(); + /** + * + * + *
+   * Link to the current Stage resource
+   * 
+ * + * string resource_uri = 5; + * + * @return The bytes for resourceUri. + */ + com.google.protobuf.ByteString getResourceUriBytes(); + + /** + * + * + *
+   * State messages from the current Stage.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 6; + */ + java.util.List getStateMessagesList(); + /** + * + * + *
+   * State messages from the current Stage.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 6; + */ + com.google.cloud.functions.v2alpha.StateMessage getStateMessages(int index); + /** + * + * + *
+   * State messages from the current Stage.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 6; + */ + int getStateMessagesCount(); + /** + * + * + *
+   * State messages from the current Stage.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 6; + */ + java.util.List + getStateMessagesOrBuilderList(); + /** + * + * + *
+   * State messages from the current Stage.
+   * 
+ * + * repeated .google.cloud.functions.v2alpha.StateMessage state_messages = 6; + */ + com.google.cloud.functions.v2alpha.StateMessageOrBuilder getStateMessagesOrBuilder(int index); +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/StateMessage.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/StateMessage.java new file mode 100644 index 00000000..3e5d1753 --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/StateMessage.java @@ -0,0 +1,1153 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +/** + * + * + *
+ * Informational messages about the state of the Cloud Function or Operation.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.StateMessage} + */ +public final class StateMessage extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2alpha.StateMessage) + StateMessageOrBuilder { + private static final long serialVersionUID = 0L; + // Use StateMessage.newBuilder() to construct. + private StateMessage(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StateMessage() { + severity_ = 0; + type_ = ""; + message_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StateMessage(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private StateMessage( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + severity_ = rawValue; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + type_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + message_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_StateMessage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_StateMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.StateMessage.class, + com.google.cloud.functions.v2alpha.StateMessage.Builder.class); + } + + /** + * + * + *
+   * Severity of the state message.
+   * 
+ * + * Protobuf enum {@code google.cloud.functions.v2alpha.StateMessage.Severity} + */ + public enum Severity implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not specified. Invalid severity.
+     * 
+ * + * SEVERITY_UNSPECIFIED = 0; + */ + SEVERITY_UNSPECIFIED(0), + /** + * + * + *
+     * ERROR-level severity.
+     * 
+ * + * ERROR = 1; + */ + ERROR(1), + /** + * + * + *
+     * WARNING-level severity.
+     * 
+ * + * WARNING = 2; + */ + WARNING(2), + /** + * + * + *
+     * INFO-level severity.
+     * 
+ * + * INFO = 3; + */ + INFO(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not specified. Invalid severity.
+     * 
+ * + * SEVERITY_UNSPECIFIED = 0; + */ + public static final int SEVERITY_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * ERROR-level severity.
+     * 
+ * + * ERROR = 1; + */ + public static final int ERROR_VALUE = 1; + /** + * + * + *
+     * WARNING-level severity.
+     * 
+ * + * WARNING = 2; + */ + public static final int WARNING_VALUE = 2; + /** + * + * + *
+     * INFO-level severity.
+     * 
+ * + * INFO = 3; + */ + public static final int INFO_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Severity valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Severity forNumber(int value) { + switch (value) { + case 0: + return SEVERITY_UNSPECIFIED; + case 1: + return ERROR; + case 2: + return WARNING; + case 3: + return INFO; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Severity findValueByNumber(int number) { + return Severity.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.StateMessage.getDescriptor().getEnumTypes().get(0); + } + + private static final Severity[] VALUES = values(); + + public static Severity valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Severity(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.functions.v2alpha.StateMessage.Severity) + } + + public static final int SEVERITY_FIELD_NUMBER = 1; + private int severity_; + /** + * + * + *
+   * Severity of the state message.
+   * 
+ * + * .google.cloud.functions.v2alpha.StateMessage.Severity severity = 1; + * + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override + public int getSeverityValue() { + return severity_; + } + /** + * + * + *
+   * Severity of the state message.
+   * 
+ * + * .google.cloud.functions.v2alpha.StateMessage.Severity severity = 1; + * + * @return The severity. + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.StateMessage.Severity getSeverity() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2alpha.StateMessage.Severity result = + com.google.cloud.functions.v2alpha.StateMessage.Severity.valueOf(severity_); + return result == null + ? com.google.cloud.functions.v2alpha.StateMessage.Severity.UNRECOGNIZED + : result; + } + + public static final int TYPE_FIELD_NUMBER = 2; + private volatile java.lang.Object type_; + /** + * + * + *
+   * One-word CamelCase type of the state message.
+   * 
+ * + * string type = 2; + * + * @return The type. + */ + @java.lang.Override + public java.lang.String getType() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } + } + /** + * + * + *
+   * One-word CamelCase type of the state message.
+   * 
+ * + * string type = 2; + * + * @return The bytes for type. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MESSAGE_FIELD_NUMBER = 3; + private volatile java.lang.Object message_; + /** + * + * + *
+   * The message.
+   * 
+ * + * string message = 3; + * + * @return The message. + */ + @java.lang.Override + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } + } + /** + * + * + *
+   * The message.
+   * 
+ * + * string message = 3; + * + * @return The bytes for message. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (severity_ + != com.google.cloud.functions.v2alpha.StateMessage.Severity.SEVERITY_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, severity_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, type_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(message_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, message_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (severity_ + != com.google.cloud.functions.v2alpha.StateMessage.Severity.SEVERITY_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, severity_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, type_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(message_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, message_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2alpha.StateMessage)) { + return super.equals(obj); + } + com.google.cloud.functions.v2alpha.StateMessage other = + (com.google.cloud.functions.v2alpha.StateMessage) obj; + + if (severity_ != other.severity_) return false; + if (!getType().equals(other.getType())) return false; + if (!getMessage().equals(other.getMessage())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SEVERITY_FIELD_NUMBER; + hash = (53 * hash) + severity_; + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2alpha.StateMessage parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.StateMessage parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.StateMessage parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.StateMessage parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.StateMessage parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.StateMessage parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.StateMessage parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.StateMessage parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.StateMessage parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.StateMessage parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.StateMessage parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.StateMessage parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v2alpha.StateMessage prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Informational messages about the state of the Cloud Function or Operation.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.StateMessage} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2alpha.StateMessage) + com.google.cloud.functions.v2alpha.StateMessageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_StateMessage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_StateMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.StateMessage.class, + com.google.cloud.functions.v2alpha.StateMessage.Builder.class); + } + + // Construct using com.google.cloud.functions.v2alpha.StateMessage.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + severity_ = 0; + + type_ = ""; + + message_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_StateMessage_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.StateMessage getDefaultInstanceForType() { + return com.google.cloud.functions.v2alpha.StateMessage.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.StateMessage build() { + com.google.cloud.functions.v2alpha.StateMessage result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.StateMessage buildPartial() { + com.google.cloud.functions.v2alpha.StateMessage result = + new com.google.cloud.functions.v2alpha.StateMessage(this); + result.severity_ = severity_; + result.type_ = type_; + result.message_ = message_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2alpha.StateMessage) { + return mergeFrom((com.google.cloud.functions.v2alpha.StateMessage) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2alpha.StateMessage other) { + if (other == com.google.cloud.functions.v2alpha.StateMessage.getDefaultInstance()) + return this; + if (other.severity_ != 0) { + setSeverityValue(other.getSeverityValue()); + } + if (!other.getType().isEmpty()) { + type_ = other.type_; + onChanged(); + } + if (!other.getMessage().isEmpty()) { + message_ = other.message_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2alpha.StateMessage parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v2alpha.StateMessage) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int severity_ = 0; + /** + * + * + *
+     * Severity of the state message.
+     * 
+ * + * .google.cloud.functions.v2alpha.StateMessage.Severity severity = 1; + * + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override + public int getSeverityValue() { + return severity_; + } + /** + * + * + *
+     * Severity of the state message.
+     * 
+ * + * .google.cloud.functions.v2alpha.StateMessage.Severity severity = 1; + * + * @param value The enum numeric value on the wire for severity to set. + * @return This builder for chaining. + */ + public Builder setSeverityValue(int value) { + + severity_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Severity of the state message.
+     * 
+ * + * .google.cloud.functions.v2alpha.StateMessage.Severity severity = 1; + * + * @return The severity. + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.StateMessage.Severity getSeverity() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2alpha.StateMessage.Severity result = + com.google.cloud.functions.v2alpha.StateMessage.Severity.valueOf(severity_); + return result == null + ? com.google.cloud.functions.v2alpha.StateMessage.Severity.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Severity of the state message.
+     * 
+ * + * .google.cloud.functions.v2alpha.StateMessage.Severity severity = 1; + * + * @param value The severity to set. + * @return This builder for chaining. + */ + public Builder setSeverity(com.google.cloud.functions.v2alpha.StateMessage.Severity value) { + if (value == null) { + throw new NullPointerException(); + } + + severity_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Severity of the state message.
+     * 
+ * + * .google.cloud.functions.v2alpha.StateMessage.Severity severity = 1; + * + * @return This builder for chaining. + */ + public Builder clearSeverity() { + + severity_ = 0; + onChanged(); + return this; + } + + private java.lang.Object type_ = ""; + /** + * + * + *
+     * One-word CamelCase type of the state message.
+     * 
+ * + * string type = 2; + * + * @return The type. + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * One-word CamelCase type of the state message.
+     * 
+ * + * string type = 2; + * + * @return The bytes for type. + */ + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * One-word CamelCase type of the state message.
+     * 
+ * + * string type = 2; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * One-word CamelCase type of the state message.
+     * 
+ * + * string type = 2; + * + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = getDefaultInstance().getType(); + onChanged(); + return this; + } + /** + * + * + *
+     * One-word CamelCase type of the state message.
+     * 
+ * + * string type = 2; + * + * @param value The bytes for type to set. + * @return This builder for chaining. + */ + public Builder setTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + type_ = value; + onChanged(); + return this; + } + + private java.lang.Object message_ = ""; + /** + * + * + *
+     * The message.
+     * 
+ * + * string message = 3; + * + * @return The message. + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The message.
+     * 
+ * + * string message = 3; + * + * @return The bytes for message. + */ + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The message.
+     * 
+ * + * string message = 3; + * + * @param value The message to set. + * @return This builder for chaining. + */ + public Builder setMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + message_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The message.
+     * 
+ * + * string message = 3; + * + * @return This builder for chaining. + */ + public Builder clearMessage() { + + message_ = getDefaultInstance().getMessage(); + onChanged(); + return this; + } + /** + * + * + *
+     * The message.
+     * 
+ * + * string message = 3; + * + * @param value The bytes for message to set. + * @return This builder for chaining. + */ + public Builder setMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + message_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2alpha.StateMessage) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2alpha.StateMessage) + private static final com.google.cloud.functions.v2alpha.StateMessage DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2alpha.StateMessage(); + } + + public static com.google.cloud.functions.v2alpha.StateMessage getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StateMessage parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StateMessage(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.StateMessage getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/StateMessageOrBuilder.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/StateMessageOrBuilder.java new file mode 100644 index 00000000..b879c44e --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/StateMessageOrBuilder.java @@ -0,0 +1,100 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +public interface StateMessageOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2alpha.StateMessage) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Severity of the state message.
+   * 
+ * + * .google.cloud.functions.v2alpha.StateMessage.Severity severity = 1; + * + * @return The enum numeric value on the wire for severity. + */ + int getSeverityValue(); + /** + * + * + *
+   * Severity of the state message.
+   * 
+ * + * .google.cloud.functions.v2alpha.StateMessage.Severity severity = 1; + * + * @return The severity. + */ + com.google.cloud.functions.v2alpha.StateMessage.Severity getSeverity(); + + /** + * + * + *
+   * One-word CamelCase type of the state message.
+   * 
+ * + * string type = 2; + * + * @return The type. + */ + java.lang.String getType(); + /** + * + * + *
+   * One-word CamelCase type of the state message.
+   * 
+ * + * string type = 2; + * + * @return The bytes for type. + */ + com.google.protobuf.ByteString getTypeBytes(); + + /** + * + * + *
+   * The message.
+   * 
+ * + * string message = 3; + * + * @return The message. + */ + java.lang.String getMessage(); + /** + * + * + *
+   * The message.
+   * 
+ * + * string message = 3; + * + * @return The bytes for message. + */ + com.google.protobuf.ByteString getMessageBytes(); +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/StorageSource.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/StorageSource.java new file mode 100644 index 00000000..2ede7a30 --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/StorageSource.java @@ -0,0 +1,938 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +/** + * + * + *
+ * Location of the source in an archive file in Google Cloud Storage.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.StorageSource} + */ +public final class StorageSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2alpha.StorageSource) + StorageSourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use StorageSource.newBuilder() to construct. + private StorageSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StorageSource() { + bucket_ = ""; + object_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StorageSource(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private StorageSource( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + bucket_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + object_ = s; + break; + } + case 24: + { + generation_ = input.readInt64(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_StorageSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_StorageSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.StorageSource.class, + com.google.cloud.functions.v2alpha.StorageSource.Builder.class); + } + + public static final int BUCKET_FIELD_NUMBER = 1; + private volatile java.lang.Object bucket_; + /** + * + * + *
+   * Google Cloud Storage bucket containing the source (see
+   * [Bucket Name
+   * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
+   * 
+ * + * string bucket = 1; + * + * @return The bucket. + */ + @java.lang.Override + public java.lang.String getBucket() { + java.lang.Object ref = bucket_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + bucket_ = s; + return s; + } + } + /** + * + * + *
+   * Google Cloud Storage bucket containing the source (see
+   * [Bucket Name
+   * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
+   * 
+ * + * string bucket = 1; + * + * @return The bytes for bucket. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBucketBytes() { + java.lang.Object ref = bucket_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + bucket_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OBJECT_FIELD_NUMBER = 2; + private volatile java.lang.Object object_; + /** + * + * + *
+   * Google Cloud Storage object containing the source.
+   * This object must be a gzipped archive file (`.tar.gz`) containing source to
+   * build.
+   * 
+ * + * string object = 2; + * + * @return The object. + */ + @java.lang.Override + public java.lang.String getObject() { + java.lang.Object ref = object_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + object_ = s; + return s; + } + } + /** + * + * + *
+   * Google Cloud Storage object containing the source.
+   * This object must be a gzipped archive file (`.tar.gz`) containing source to
+   * build.
+   * 
+ * + * string object = 2; + * + * @return The bytes for object. + */ + @java.lang.Override + public com.google.protobuf.ByteString getObjectBytes() { + java.lang.Object ref = object_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + object_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GENERATION_FIELD_NUMBER = 3; + private long generation_; + /** + * + * + *
+   * Google Cloud Storage generation for the object. If the generation is
+   * omitted, the latest generation will be used.
+   * 
+ * + * int64 generation = 3; + * + * @return The generation. + */ + @java.lang.Override + public long getGeneration() { + return generation_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bucket_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, bucket_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(object_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, object_); + } + if (generation_ != 0L) { + output.writeInt64(3, generation_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bucket_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, bucket_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(object_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, object_); + } + if (generation_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, generation_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2alpha.StorageSource)) { + return super.equals(obj); + } + com.google.cloud.functions.v2alpha.StorageSource other = + (com.google.cloud.functions.v2alpha.StorageSource) obj; + + if (!getBucket().equals(other.getBucket())) return false; + if (!getObject().equals(other.getObject())) return false; + if (getGeneration() != other.getGeneration()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + BUCKET_FIELD_NUMBER; + hash = (53 * hash) + getBucket().hashCode(); + hash = (37 * hash) + OBJECT_FIELD_NUMBER; + hash = (53 * hash) + getObject().hashCode(); + hash = (37 * hash) + GENERATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getGeneration()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2alpha.StorageSource parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.StorageSource parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.StorageSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.StorageSource parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.StorageSource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.StorageSource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.StorageSource parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.StorageSource parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.StorageSource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.StorageSource parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.StorageSource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.StorageSource parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v2alpha.StorageSource prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Location of the source in an archive file in Google Cloud Storage.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.StorageSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2alpha.StorageSource) + com.google.cloud.functions.v2alpha.StorageSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_StorageSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_StorageSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.StorageSource.class, + com.google.cloud.functions.v2alpha.StorageSource.Builder.class); + } + + // Construct using com.google.cloud.functions.v2alpha.StorageSource.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bucket_ = ""; + + object_ = ""; + + generation_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_StorageSource_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.StorageSource getDefaultInstanceForType() { + return com.google.cloud.functions.v2alpha.StorageSource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.StorageSource build() { + com.google.cloud.functions.v2alpha.StorageSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.StorageSource buildPartial() { + com.google.cloud.functions.v2alpha.StorageSource result = + new com.google.cloud.functions.v2alpha.StorageSource(this); + result.bucket_ = bucket_; + result.object_ = object_; + result.generation_ = generation_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2alpha.StorageSource) { + return mergeFrom((com.google.cloud.functions.v2alpha.StorageSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2alpha.StorageSource other) { + if (other == com.google.cloud.functions.v2alpha.StorageSource.getDefaultInstance()) + return this; + if (!other.getBucket().isEmpty()) { + bucket_ = other.bucket_; + onChanged(); + } + if (!other.getObject().isEmpty()) { + object_ = other.object_; + onChanged(); + } + if (other.getGeneration() != 0L) { + setGeneration(other.getGeneration()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2alpha.StorageSource parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v2alpha.StorageSource) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object bucket_ = ""; + /** + * + * + *
+     * Google Cloud Storage bucket containing the source (see
+     * [Bucket Name
+     * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
+     * 
+ * + * string bucket = 1; + * + * @return The bucket. + */ + public java.lang.String getBucket() { + java.lang.Object ref = bucket_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + bucket_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Google Cloud Storage bucket containing the source (see
+     * [Bucket Name
+     * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
+     * 
+ * + * string bucket = 1; + * + * @return The bytes for bucket. + */ + public com.google.protobuf.ByteString getBucketBytes() { + java.lang.Object ref = bucket_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + bucket_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Google Cloud Storage bucket containing the source (see
+     * [Bucket Name
+     * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
+     * 
+ * + * string bucket = 1; + * + * @param value The bucket to set. + * @return This builder for chaining. + */ + public Builder setBucket(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + bucket_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Google Cloud Storage bucket containing the source (see
+     * [Bucket Name
+     * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
+     * 
+ * + * string bucket = 1; + * + * @return This builder for chaining. + */ + public Builder clearBucket() { + + bucket_ = getDefaultInstance().getBucket(); + onChanged(); + return this; + } + /** + * + * + *
+     * Google Cloud Storage bucket containing the source (see
+     * [Bucket Name
+     * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
+     * 
+ * + * string bucket = 1; + * + * @param value The bytes for bucket to set. + * @return This builder for chaining. + */ + public Builder setBucketBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + bucket_ = value; + onChanged(); + return this; + } + + private java.lang.Object object_ = ""; + /** + * + * + *
+     * Google Cloud Storage object containing the source.
+     * This object must be a gzipped archive file (`.tar.gz`) containing source to
+     * build.
+     * 
+ * + * string object = 2; + * + * @return The object. + */ + public java.lang.String getObject() { + java.lang.Object ref = object_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + object_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Google Cloud Storage object containing the source.
+     * This object must be a gzipped archive file (`.tar.gz`) containing source to
+     * build.
+     * 
+ * + * string object = 2; + * + * @return The bytes for object. + */ + public com.google.protobuf.ByteString getObjectBytes() { + java.lang.Object ref = object_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + object_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Google Cloud Storage object containing the source.
+     * This object must be a gzipped archive file (`.tar.gz`) containing source to
+     * build.
+     * 
+ * + * string object = 2; + * + * @param value The object to set. + * @return This builder for chaining. + */ + public Builder setObject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + object_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Google Cloud Storage object containing the source.
+     * This object must be a gzipped archive file (`.tar.gz`) containing source to
+     * build.
+     * 
+ * + * string object = 2; + * + * @return This builder for chaining. + */ + public Builder clearObject() { + + object_ = getDefaultInstance().getObject(); + onChanged(); + return this; + } + /** + * + * + *
+     * Google Cloud Storage object containing the source.
+     * This object must be a gzipped archive file (`.tar.gz`) containing source to
+     * build.
+     * 
+ * + * string object = 2; + * + * @param value The bytes for object to set. + * @return This builder for chaining. + */ + public Builder setObjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + object_ = value; + onChanged(); + return this; + } + + private long generation_; + /** + * + * + *
+     * Google Cloud Storage generation for the object. If the generation is
+     * omitted, the latest generation will be used.
+     * 
+ * + * int64 generation = 3; + * + * @return The generation. + */ + @java.lang.Override + public long getGeneration() { + return generation_; + } + /** + * + * + *
+     * Google Cloud Storage generation for the object. If the generation is
+     * omitted, the latest generation will be used.
+     * 
+ * + * int64 generation = 3; + * + * @param value The generation to set. + * @return This builder for chaining. + */ + public Builder setGeneration(long value) { + + generation_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Google Cloud Storage generation for the object. If the generation is
+     * omitted, the latest generation will be used.
+     * 
+ * + * int64 generation = 3; + * + * @return This builder for chaining. + */ + public Builder clearGeneration() { + + generation_ = 0L; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2alpha.StorageSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2alpha.StorageSource) + private static final com.google.cloud.functions.v2alpha.StorageSource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2alpha.StorageSource(); + } + + public static com.google.cloud.functions.v2alpha.StorageSource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StorageSource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StorageSource(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.StorageSource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/StorageSourceOrBuilder.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/StorageSourceOrBuilder.java new file mode 100644 index 00000000..78dcde7a --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/StorageSourceOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +public interface StorageSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2alpha.StorageSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Google Cloud Storage bucket containing the source (see
+   * [Bucket Name
+   * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
+   * 
+ * + * string bucket = 1; + * + * @return The bucket. + */ + java.lang.String getBucket(); + /** + * + * + *
+   * Google Cloud Storage bucket containing the source (see
+   * [Bucket Name
+   * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
+   * 
+ * + * string bucket = 1; + * + * @return The bytes for bucket. + */ + com.google.protobuf.ByteString getBucketBytes(); + + /** + * + * + *
+   * Google Cloud Storage object containing the source.
+   * This object must be a gzipped archive file (`.tar.gz`) containing source to
+   * build.
+   * 
+ * + * string object = 2; + * + * @return The object. + */ + java.lang.String getObject(); + /** + * + * + *
+   * Google Cloud Storage object containing the source.
+   * This object must be a gzipped archive file (`.tar.gz`) containing source to
+   * build.
+   * 
+ * + * string object = 2; + * + * @return The bytes for object. + */ + com.google.protobuf.ByteString getObjectBytes(); + + /** + * + * + *
+   * Google Cloud Storage generation for the object. If the generation is
+   * omitted, the latest generation will be used.
+   * 
+ * + * int64 generation = 3; + * + * @return The generation. + */ + long getGeneration(); +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/UpdateFunctionRequest.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/UpdateFunctionRequest.java new file mode 100644 index 00000000..2d6af7a6 --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/UpdateFunctionRequest.java @@ -0,0 +1,1057 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +/** + * + * + *
+ * Request for the `UpdateFunction` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.UpdateFunctionRequest} + */ +public final class UpdateFunctionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2alpha.UpdateFunctionRequest) + UpdateFunctionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateFunctionRequest.newBuilder() to construct. + private UpdateFunctionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateFunctionRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateFunctionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateFunctionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.functions.v2alpha.Function.Builder subBuilder = null; + if (function_ != null) { + subBuilder = function_.toBuilder(); + } + function_ = + input.readMessage( + com.google.cloud.functions.v2alpha.Function.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(function_); + function_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_UpdateFunctionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_UpdateFunctionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.UpdateFunctionRequest.class, + com.google.cloud.functions.v2alpha.UpdateFunctionRequest.Builder.class); + } + + public static final int FUNCTION_FIELD_NUMBER = 1; + private com.google.cloud.functions.v2alpha.Function function_; + /** + * + * + *
+   * Required. New version of the function.
+   * 
+ * + * + * .google.cloud.functions.v2alpha.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the function field is set. + */ + @java.lang.Override + public boolean hasFunction() { + return function_ != null; + } + /** + * + * + *
+   * Required. New version of the function.
+   * 
+ * + * + * .google.cloud.functions.v2alpha.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The function. + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.Function getFunction() { + return function_ == null + ? com.google.cloud.functions.v2alpha.Function.getDefaultInstance() + : function_; + } + /** + * + * + *
+   * Required. New version of the function.
+   * 
+ * + * + * .google.cloud.functions.v2alpha.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.functions.v2alpha.FunctionOrBuilder getFunctionOrBuilder() { + return getFunction(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * The list of fields to be updated.
+   * If no field mask is provided, all provided fields in the request will be
+   * updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * The list of fields to be updated.
+   * If no field mask is provided, all provided fields in the request will be
+   * updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * The list of fields to be updated.
+   * If no field mask is provided, all provided fields in the request will be
+   * updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (function_ != null) { + output.writeMessage(1, getFunction()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (function_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getFunction()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2alpha.UpdateFunctionRequest)) { + return super.equals(obj); + } + com.google.cloud.functions.v2alpha.UpdateFunctionRequest other = + (com.google.cloud.functions.v2alpha.UpdateFunctionRequest) obj; + + if (hasFunction() != other.hasFunction()) return false; + if (hasFunction()) { + if (!getFunction().equals(other.getFunction())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasFunction()) { + hash = (37 * hash) + FUNCTION_FIELD_NUMBER; + hash = (53 * hash) + getFunction().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2alpha.UpdateFunctionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.UpdateFunctionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.UpdateFunctionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.UpdateFunctionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.UpdateFunctionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2alpha.UpdateFunctionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.UpdateFunctionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.UpdateFunctionRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.UpdateFunctionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.UpdateFunctionRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2alpha.UpdateFunctionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2alpha.UpdateFunctionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.functions.v2alpha.UpdateFunctionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the `UpdateFunction` method.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2alpha.UpdateFunctionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2alpha.UpdateFunctionRequest) + com.google.cloud.functions.v2alpha.UpdateFunctionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_UpdateFunctionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_UpdateFunctionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2alpha.UpdateFunctionRequest.class, + com.google.cloud.functions.v2alpha.UpdateFunctionRequest.Builder.class); + } + + // Construct using com.google.cloud.functions.v2alpha.UpdateFunctionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (functionBuilder_ == null) { + function_ = null; + } else { + function_ = null; + functionBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2alpha.FunctionsProto + .internal_static_google_cloud_functions_v2alpha_UpdateFunctionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.UpdateFunctionRequest getDefaultInstanceForType() { + return com.google.cloud.functions.v2alpha.UpdateFunctionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.UpdateFunctionRequest build() { + com.google.cloud.functions.v2alpha.UpdateFunctionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.UpdateFunctionRequest buildPartial() { + com.google.cloud.functions.v2alpha.UpdateFunctionRequest result = + new com.google.cloud.functions.v2alpha.UpdateFunctionRequest(this); + if (functionBuilder_ == null) { + result.function_ = function_; + } else { + result.function_ = functionBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2alpha.UpdateFunctionRequest) { + return mergeFrom((com.google.cloud.functions.v2alpha.UpdateFunctionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2alpha.UpdateFunctionRequest other) { + if (other == com.google.cloud.functions.v2alpha.UpdateFunctionRequest.getDefaultInstance()) + return this; + if (other.hasFunction()) { + mergeFunction(other.getFunction()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2alpha.UpdateFunctionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2alpha.UpdateFunctionRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.functions.v2alpha.Function function_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2alpha.Function, + com.google.cloud.functions.v2alpha.Function.Builder, + com.google.cloud.functions.v2alpha.FunctionOrBuilder> + functionBuilder_; + /** + * + * + *
+     * Required. New version of the function.
+     * 
+ * + * + * .google.cloud.functions.v2alpha.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the function field is set. + */ + public boolean hasFunction() { + return functionBuilder_ != null || function_ != null; + } + /** + * + * + *
+     * Required. New version of the function.
+     * 
+ * + * + * .google.cloud.functions.v2alpha.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The function. + */ + public com.google.cloud.functions.v2alpha.Function getFunction() { + if (functionBuilder_ == null) { + return function_ == null + ? com.google.cloud.functions.v2alpha.Function.getDefaultInstance() + : function_; + } else { + return functionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. New version of the function.
+     * 
+ * + * + * .google.cloud.functions.v2alpha.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setFunction(com.google.cloud.functions.v2alpha.Function value) { + if (functionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + function_ = value; + onChanged(); + } else { + functionBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. New version of the function.
+     * 
+ * + * + * .google.cloud.functions.v2alpha.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setFunction( + com.google.cloud.functions.v2alpha.Function.Builder builderForValue) { + if (functionBuilder_ == null) { + function_ = builderForValue.build(); + onChanged(); + } else { + functionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. New version of the function.
+     * 
+ * + * + * .google.cloud.functions.v2alpha.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeFunction(com.google.cloud.functions.v2alpha.Function value) { + if (functionBuilder_ == null) { + if (function_ != null) { + function_ = + com.google.cloud.functions.v2alpha.Function.newBuilder(function_) + .mergeFrom(value) + .buildPartial(); + } else { + function_ = value; + } + onChanged(); + } else { + functionBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. New version of the function.
+     * 
+ * + * + * .google.cloud.functions.v2alpha.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearFunction() { + if (functionBuilder_ == null) { + function_ = null; + onChanged(); + } else { + function_ = null; + functionBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. New version of the function.
+     * 
+ * + * + * .google.cloud.functions.v2alpha.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.functions.v2alpha.Function.Builder getFunctionBuilder() { + + onChanged(); + return getFunctionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. New version of the function.
+     * 
+ * + * + * .google.cloud.functions.v2alpha.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.functions.v2alpha.FunctionOrBuilder getFunctionOrBuilder() { + if (functionBuilder_ != null) { + return functionBuilder_.getMessageOrBuilder(); + } else { + return function_ == null + ? com.google.cloud.functions.v2alpha.Function.getDefaultInstance() + : function_; + } + } + /** + * + * + *
+     * Required. New version of the function.
+     * 
+ * + * + * .google.cloud.functions.v2alpha.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2alpha.Function, + com.google.cloud.functions.v2alpha.Function.Builder, + com.google.cloud.functions.v2alpha.FunctionOrBuilder> + getFunctionFieldBuilder() { + if (functionBuilder_ == null) { + functionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2alpha.Function, + com.google.cloud.functions.v2alpha.Function.Builder, + com.google.cloud.functions.v2alpha.FunctionOrBuilder>( + getFunction(), getParentForChildren(), isClean()); + function_ = null; + } + return functionBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * The list of fields to be updated.
+     * If no field mask is provided, all provided fields in the request will be
+     * updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * The list of fields to be updated.
+     * If no field mask is provided, all provided fields in the request will be
+     * updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The list of fields to be updated.
+     * If no field mask is provided, all provided fields in the request will be
+     * updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The list of fields to be updated.
+     * If no field mask is provided, all provided fields in the request will be
+     * updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The list of fields to be updated.
+     * If no field mask is provided, all provided fields in the request will be
+     * updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The list of fields to be updated.
+     * If no field mask is provided, all provided fields in the request will be
+     * updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The list of fields to be updated.
+     * If no field mask is provided, all provided fields in the request will be
+     * updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The list of fields to be updated.
+     * If no field mask is provided, all provided fields in the request will be
+     * updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * The list of fields to be updated.
+     * If no field mask is provided, all provided fields in the request will be
+     * updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2alpha.UpdateFunctionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2alpha.UpdateFunctionRequest) + private static final com.google.cloud.functions.v2alpha.UpdateFunctionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2alpha.UpdateFunctionRequest(); + } + + public static com.google.cloud.functions.v2alpha.UpdateFunctionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateFunctionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateFunctionRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2alpha.UpdateFunctionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/UpdateFunctionRequestOrBuilder.java b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/UpdateFunctionRequestOrBuilder.java new file mode 100644 index 00000000..fad1333c --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/java/com/google/cloud/functions/v2alpha/UpdateFunctionRequestOrBuilder.java @@ -0,0 +1,107 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2alpha/functions.proto + +package com.google.cloud.functions.v2alpha; + +public interface UpdateFunctionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2alpha.UpdateFunctionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. New version of the function.
+   * 
+ * + * + * .google.cloud.functions.v2alpha.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the function field is set. + */ + boolean hasFunction(); + /** + * + * + *
+   * Required. New version of the function.
+   * 
+ * + * + * .google.cloud.functions.v2alpha.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The function. + */ + com.google.cloud.functions.v2alpha.Function getFunction(); + /** + * + * + *
+   * Required. New version of the function.
+   * 
+ * + * + * .google.cloud.functions.v2alpha.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.functions.v2alpha.FunctionOrBuilder getFunctionOrBuilder(); + + /** + * + * + *
+   * The list of fields to be updated.
+   * If no field mask is provided, all provided fields in the request will be
+   * updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * The list of fields to be updated.
+   * If no field mask is provided, all provided fields in the request will be
+   * updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * The list of fields to be updated.
+   * If no field mask is provided, all provided fields in the request will be
+   * updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-functions-v2alpha/src/main/proto/google/cloud/functions/v2alpha/functions.proto b/proto-google-cloud-functions-v2alpha/src/main/proto/google/cloud/functions/v2alpha/functions.proto new file mode 100644 index 00000000..6bc9de68 --- /dev/null +++ b/proto-google-cloud-functions-v2alpha/src/main/proto/google/cloud/functions/v2alpha/functions.proto @@ -0,0 +1,1033 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.functions.v2alpha; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/functions/v2alpha;functions"; +option java_multiple_files = true; +option java_outer_classname = "FunctionsProto"; +option java_package = "com.google.cloud.functions.v2alpha"; +option objc_class_prefix = "GCF"; +option (google.api.resource_definition) = { + type: "artifactregistry.googleapis.com/Repository" + pattern: "projects/{project}/locations/{location}/repositories/{repository}" +}; +option (google.api.resource_definition) = { + type: "cloudbuild.googleapis.com/Build" + pattern: "projects/{project}/locations/{location}/builds/{build}" +}; +option (google.api.resource_definition) = { + type: "cloudbuild.googleapis.com/WorkerPool" + pattern: "projects/{project}/locations/{location}/workerPools/{worker_pool}" +}; +option (google.api.resource_definition) = { + type: "run.googleapis.com/Service" + pattern: "projects/{project}/locations/{location}/services/{service}" +}; +option (google.api.resource_definition) = { + type: "vpcaccess.googleapis.com/Connector" + pattern: "projects/{project}/locations/{location}/connectors/{connector}" +}; +option (google.api.resource_definition) = { + type: "eventarc.googleapis.com/Trigger" + pattern: "projects/{project}/locations/{location}/triggers/{trigger}" +}; +option (google.api.resource_definition) = { + type: "eventarc.googleapis.com/Channel" + pattern: "projects/{project}/locations/{location}/channels/{channel}" +}; +option (google.api.resource_definition) = { + type: "pubsub.googleapis.com/Topic" + pattern: "projects/{project}/topics/{topic}" +}; + +// Google Cloud Functions is used to deploy functions that are executed by +// Google in response to various events. Data connected with that event is +// passed to a function as the input data. +// +// A **function** is a resource which describes a function that should be +// executed and how it is triggered. +service FunctionService { + option (google.api.default_host) = "cloudfunctions.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Returns a function with the given name from the requested project. + rpc GetFunction(GetFunctionRequest) returns (Function) { + option (google.api.http) = { + get: "/v2alpha/{name=projects/*/locations/*/functions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Returns a list of functions that belong to the requested project. + rpc ListFunctions(ListFunctionsRequest) returns (ListFunctionsResponse) { + option (google.api.http) = { + get: "/v2alpha/{parent=projects/*/locations/*}/functions" + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a new function. If a function with the given name already exists in + // the specified project, the long running operation will return + // `ALREADY_EXISTS` error. + rpc CreateFunction(CreateFunctionRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2alpha/{parent=projects/*/locations/*}/functions" + body: "function" + }; + option (google.api.method_signature) = "parent,function,function_id"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.functions.v2alpha.Function" + metadata_type: "google.cloud.functions.v2alpha.OperationMetadata" + }; + } + + // Updates existing function. + rpc UpdateFunction(UpdateFunctionRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v2alpha/{function.name=projects/*/locations/*/functions/*}" + body: "function" + }; + option (google.api.method_signature) = "function,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.functions.v2alpha.Function" + metadata_type: "google.cloud.functions.v2alpha.OperationMetadata" + }; + } + + // Deletes a function with the given name from the specified project. If the + // given function is used by some trigger, the trigger will be updated to + // remove this function. + rpc DeleteFunction(DeleteFunctionRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v2alpha/{name=projects/*/locations/*/functions/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.functions.v2alpha.OperationMetadata" + }; + } + + // Returns a signed URL for uploading a function source code. + // For more information about the signed URL usage see: + // https://cloud.google.com/storage/docs/access-control/signed-urls. + // Once the function source code upload is complete, the used signed + // URL should be provided in CreateFunction or UpdateFunction request + // as a reference to the function source code. + // + // When uploading source code to the generated signed URL, please follow + // these restrictions: + // + // * Source file type should be a zip file. + // * No credentials should be attached - the signed URLs provide access to the + // target bucket using internal service identity; if credentials were + // attached, the identity from the credentials would be used, but that + // identity does not have permissions to upload files to the URL. + // + // When making a HTTP PUT request, these two headers need to be specified: + // + // * `content-type: application/zip` + // + // And this header SHOULD NOT be specified: + // + // * `Authorization: Bearer YOUR_TOKEN` + rpc GenerateUploadUrl(GenerateUploadUrlRequest) returns (GenerateUploadUrlResponse) { + option (google.api.http) = { + post: "/v2alpha/{parent=projects/*/locations/*}/functions:generateUploadUrl" + body: "*" + }; + } + + // Returns a signed URL for downloading deployed function source code. + // The URL is only valid for a limited period and should be used within + // 30 minutes of generation. + // For more information about the signed URL usage see: + // https://cloud.google.com/storage/docs/access-control/signed-urls + rpc GenerateDownloadUrl(GenerateDownloadUrlRequest) returns (GenerateDownloadUrlResponse) { + option (google.api.http) = { + post: "/v2alpha/{name=projects/*/locations/*/functions/*}:generateDownloadUrl" + body: "*" + }; + } + + // Returns a list of runtimes that are supported for the requested project. + rpc ListRuntimes(ListRuntimesRequest) returns (ListRuntimesResponse) { + option (google.api.http) = { + get: "/v2alpha/{parent=projects/*/locations/*}/runtimes" + }; + option (google.api.method_signature) = "parent"; + } +} + +// The environment the function is hosted on. +enum Environment { + // Unspecified + ENVIRONMENT_UNSPECIFIED = 0; + + // Gen 1 + GEN_1 = 1; + + // Gen 2 + GEN_2 = 2; +} + +// Describes a Cloud Function that contains user computation executed in +// response to an event. It encapsulates function and trigger configurations. +message Function { + option (google.api.resource) = { + type: "cloudfunctions.googleapis.com/Function" + pattern: "projects/{project}/locations/{location}/functions/{function}" + plural: "functions" + singular: "function" + }; + + // Describes the current state of the function. + enum State { + // Not specified. Invalid state. + STATE_UNSPECIFIED = 0; + + // Function has been successfully deployed and is serving. + ACTIVE = 1; + + // Function deployment failed and the function is not serving. + FAILED = 2; + + // Function is being created or updated. + DEPLOYING = 3; + + // Function is being deleted. + DELETING = 4; + + // Function deployment failed and the function serving state is undefined. + // The function should be updated or deleted to move it out of this state. + UNKNOWN = 5; + } + + // A user-defined name of the function. Function names must be unique + // globally and match pattern `projects/*/locations/*/functions/*` + string name = 1; + + // Describe whether the function is gen1 or gen2. + Environment environment = 10; + + // User-provided description of a function. + string description = 2; + + // Describes the Build step of the function that builds a container from the + // given source. + BuildConfig build_config = 3; + + // Describes the Service being deployed. Currently deploys services to Cloud + // Run (fully managed). + ServiceConfig service_config = 4; + + // An Eventarc trigger managed by Google Cloud Functions that fires events in + // response to a condition in another service. + EventTrigger event_trigger = 5; + + // Output only. State of the function. + State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last update timestamp of a Cloud Function. + google.protobuf.Timestamp update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels associated with this Cloud Function. + map labels = 8; + + // Output only. State Messages for this Cloud Function. + repeated StateMessage state_messages = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Informational messages about the state of the Cloud Function or Operation. +message StateMessage { + // Severity of the state message. + enum Severity { + // Not specified. Invalid severity. + SEVERITY_UNSPECIFIED = 0; + + // ERROR-level severity. + ERROR = 1; + + // WARNING-level severity. + WARNING = 2; + + // INFO-level severity. + INFO = 3; + } + + // Severity of the state message. + Severity severity = 1; + + // One-word CamelCase type of the state message. + string type = 2; + + // The message. + string message = 3; +} + +// Location of the source in an archive file in Google Cloud Storage. +message StorageSource { + // Google Cloud Storage bucket containing the source (see + // [Bucket Name + // Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). + string bucket = 1; + + // Google Cloud Storage object containing the source. + // + // This object must be a gzipped archive file (`.tar.gz`) containing source to + // build. + string object = 2; + + // Google Cloud Storage generation for the object. If the generation is + // omitted, the latest generation will be used. + int64 generation = 3; +} + +// Location of the source in a Google Cloud Source Repository. +message RepoSource { + // A revision within the Cloud Source Repository must be specified in + // one of these ways. + oneof revision { + // Regex matching branches to build. + // + // The syntax of the regular expressions accepted is the syntax accepted by + // RE2 and described at https://github.com/google/re2/wiki/Syntax + string branch_name = 3; + + // Regex matching tags to build. + // + // The syntax of the regular expressions accepted is the syntax accepted by + // RE2 and described at https://github.com/google/re2/wiki/Syntax + string tag_name = 4; + + // Explicit commit SHA to build. + string commit_sha = 5; + } + + // ID of the project that owns the Cloud Source Repository. If omitted, the + // project ID requesting the build is assumed. + string project_id = 1; + + // Name of the Cloud Source Repository. + string repo_name = 2; + + // Directory, relative to the source root, in which to run the build. + // + // This must be a relative path. If a step's `dir` is specified and is an + // absolute path, this value is ignored for that step's execution. + // eg. helloworld (no leading slash allowed) + string dir = 6; + + // Only trigger a build if the revision regex does NOT match the revision + // regex. + bool invert_regex = 7; +} + +// The location of the function source code. +message Source { + // Location of the source. + // At least one source needs to be provided for the deployment to succeed. + oneof source { + // If provided, get the source from this location in Google Cloud Storage. + StorageSource storage_source = 1; + + // If provided, get the source from this location in a Cloud Source + // Repository. + RepoSource repo_source = 2; + } +} + +// Provenance of the source. Ways to find the original source, or verify that +// some source was used for this build. +message SourceProvenance { + // A copy of the build's `source.storage_source`, if exists, with any + // generations resolved. + StorageSource resolved_storage_source = 1; + + // A copy of the build's `source.repo_source`, if exists, with any + // revisions resolved. + RepoSource resolved_repo_source = 2; +} + +// Describes the Build step of the function that builds a container from the +// given source. +message BuildConfig { + // Output only. The Cloud Build name of the latest successful deployment of the + // function. + string build = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/Build" + } + ]; + + // The runtime in which to run the function. Required when deploying a new + // function, optional when updating an existing function. For a complete + // list of possible choices, see the + // [`gcloud` command + // reference](https://cloud.google.com/sdk/gcloud/reference/functions/deploy#--runtime). + string runtime = 2; + + // The name of the function (as defined in source code) that will be + // executed. Defaults to the resource name suffix, if not specified. For + // backward compatibility, if function with given name is not found, then the + // system will try to use function named "function". + // For Node.js this is name of a function exported by the module specified + // in `source_location`. + string entry_point = 3; + + // The location of the function source code. + Source source = 4; + + // Output only. A permanent fixed identifier for source. + SourceProvenance source_provenance = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Name of the Cloud Build Custom Worker Pool that should be used to build the + // function. The format of this field is + // `projects/{project}/locations/{region}/workerPools/{workerPool}` where + // {project} and {region} are the project id and region respectively where the + // worker pool is defined and {workerPool} is the short name of the worker + // pool. + // + // If the project id is not the same as the function, then the Cloud + // Functions Service Agent + // (service-@gcf-admin-robot.iam.gserviceaccount.com) must be + // granted the role Cloud Build Custom Workers Builder + // (roles/cloudbuild.customworkers.builder) in the project. + string worker_pool = 5 [(google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/WorkerPool" + }]; + + // User-provided build-time environment variables for the function + map environment_variables = 6; + + // Optional. User managed repository created in Artifact Registry optionally with a + // customer managed encryption key. This is the repository to which the + // function docker image will be pushed after it is built by Cloud Build. + // If unspecified, GCF will create and use a repository named 'gcf-artifacts' + // for every deployed region. + // + // It must match the pattern + // `projects/{project}/locations/{location}/repositories/{repository}`. + // + // Cross-project repositories are not supported. + // Cross-location repositories are not supported. + // Repository format must be 'DOCKER'. + string docker_repository = 7 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "artifactregistry.googleapis.com/Repository" + } + ]; +} + +// Describes the Service being deployed. +// Currently Supported : Cloud Run (fully managed). +message ServiceConfig { + // Available egress settings. + // + // This controls what traffic is diverted through the VPC Access Connector + // resource. By default PRIVATE_RANGES_ONLY will be used. + enum VpcConnectorEgressSettings { + // Unspecified. + VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED = 0; + + // Use the VPC Access Connector only for private IP space from RFC1918. + PRIVATE_RANGES_ONLY = 1; + + // Force the use of VPC Access Connector for all egress traffic from the + // function. + ALL_TRAFFIC = 2; + } + + // Available ingress settings. + // + // This controls what traffic can reach the function. + // + // If unspecified, ALLOW_ALL will be used. + enum IngressSettings { + // Unspecified. + INGRESS_SETTINGS_UNSPECIFIED = 0; + + // Allow HTTP traffic from public and private sources. + ALLOW_ALL = 1; + + // Allow HTTP traffic from only private VPC sources. + ALLOW_INTERNAL_ONLY = 2; + + // Allow HTTP traffic from private VPC sources and through GCLB. + ALLOW_INTERNAL_AND_GCLB = 3; + } + + // Output only. Name of the service associated with a Function. + // The format of this field is + // `projects/{project}/locations/{region}/services/{service}` + string service = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "run.googleapis.com/Service" + } + ]; + + // The function execution timeout. Execution is considered failed and + // can be terminated if the function is not completed at the end of the + // timeout period. Defaults to 60 seconds. + int32 timeout_seconds = 2; + + // The amount of memory available for a function. + // Defaults to 256M. Supported units are k, M, G, Mi, Gi. If no unit is + // supplied the value is interpreted as bytes. + // See + // https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go + // a full description. + string available_memory = 13; + + // Environment variables that shall be available during function execution. + map environment_variables = 4; + + // The limit on the maximum number of function instances that may coexist at a + // given time. + // + // In some cases, such as rapid traffic surges, Cloud Functions may, for a + // short period of time, create more instances than the specified max + // instances limit. If your function cannot tolerate this temporary behavior, + // you may want to factor in a safety margin and set a lower max instances + // value than your function can tolerate. + // + // See the [Max + // Instances](https://cloud.google.com/functions/docs/max-instances) Guide for + // more details. + int32 max_instance_count = 5; + + // The limit on the minimum number of function instances that may coexist at a + // given time. + // + // Function instances are kept in idle state for a short period after they + // finished executing the request to reduce cold start time for subsequent + // requests. Setting a minimum instance count will ensure that the given + // number of instances are kept running in idle state always. This can help + // with cold start times when jump in incoming request count occurs after the + // idle instance would have been stopped in the default case. + int32 min_instance_count = 12; + + // The Serverless VPC Access connector that this cloud function can connect + // to. The format of this field is `projects/*/locations/*/connectors/*`. + string vpc_connector = 6 [(google.api.resource_reference) = { + type: "vpcaccess.googleapis.com/Connector" + }]; + + // The egress settings for the connector, controlling what traffic is diverted + // through it. + VpcConnectorEgressSettings vpc_connector_egress_settings = 7; + + // The ingress settings for the function, controlling what traffic can reach + // it. + IngressSettings ingress_settings = 8; + + // Output only. URI of the Service deployed. + string uri = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The email of the service's service account. If empty, defaults to + // `{project_number}-compute@developer.gserviceaccount.com`. + string service_account_email = 10; + + // Whether 100% of traffic is routed to the latest revision. + // On CreateFunction and UpdateFunction, when set to true, the revision being + // deployed will serve 100% of traffic, ignoring any traffic split settings, + // if any. On GetFunction, true will be returned if the latest revision is + // serving 100% of traffic. + bool all_traffic_on_latest_revision = 16; + + // Secret environment variables configuration. + repeated SecretEnvVar secret_environment_variables = 17; + + // Secret volumes configuration. + repeated SecretVolume secret_volumes = 19; + + // Output only. The name of service revision. + string revision = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Configuration for a secret environment variable. It has the information +// necessary to fetch the secret value from secret manager and expose it as an +// environment variable. +message SecretEnvVar { + // Name of the environment variable. + string key = 1; + + // Project identifier (preferably project number but can also be the + // project ID) of the project that contains the secret. If not set, it is + // assumed that the secret is in the same project as the function. + string project_id = 2; + + // Name of the secret in secret manager (not the full resource name). + string secret = 3; + + // Version of the secret (version number or the string 'latest'). It is + // recommended to use a numeric version for secret environment variables as + // any updates to the secret value is not reflected until new instances + // start. + string version = 4; +} + +// Configuration for a secret volume. It has the information necessary to fetch +// the secret value from secret manager and make it available as files mounted +// at the requested paths within the application container. +message SecretVolume { + // Configuration for a single version. + message SecretVersion { + // Version of the secret (version number or the string 'latest'). It is + // preferable to use `latest` version with secret volumes as secret value + // changes are reflected immediately. + string version = 1; + + // Relative path of the file under the mount path where the secret value for + // this version will be fetched and made available. For example, setting the + // mount_path as '/etc/secrets' and path as `secret_foo` would mount the + // secret value file at `/etc/secrets/secret_foo`. + string path = 2; + } + + // The path within the container to mount the secret volume. For example, + // setting the mount_path as `/etc/secrets` would mount the secret value files + // under the `/etc/secrets` directory. This directory will also be completely + // shadowed and unavailable to mount any other secrets. + // Recommended mount path: /etc/secrets + string mount_path = 1; + + // Project identifier (preferably project number but can also be the project + // ID) of the project that contains the secret. If not set, it is + // assumed that the secret is in the same project as the function. + string project_id = 2; + + // Name of the secret in secret manager (not the full resource name). + string secret = 3; + + // List of secret versions to mount for this secret. If empty, the `latest` + // version of the secret will be made available in a file named after the + // secret under the mount point. + repeated SecretVersion versions = 4; +} + +// Describes EventTrigger, used to request events to be sent from another +// service. +message EventTrigger { + // Describes the retry policy in case of function's execution failure. + // Retried execution is charged as any other execution. + enum RetryPolicy { + // Not specified. + RETRY_POLICY_UNSPECIFIED = 0; + + // Do not retry. + RETRY_POLICY_DO_NOT_RETRY = 1; + + // Retry on any failure, retry up to 7 days with an exponential backoff + // (capped at 10 seconds). + RETRY_POLICY_RETRY = 2; + } + + // Output only. The resource name of the Eventarc trigger. The format of this field is + // `projects/{project}/locations/{region}/triggers/{trigger}`. + string trigger = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "eventarc.googleapis.com/Trigger" + } + ]; + + // The region that the trigger will be in. The trigger will only receive + // events originating in this region. It can be the same + // region as the function, a different region or multi-region, or the global + // region. If not provided, defaults to the same region as the function. + string trigger_region = 2; + + // Required. The type of event to observe. For example: + // `google.cloud.audit.log.v1.written` or + // `google.cloud.pubsub.topic.v1.messagePublished`. + string event_type = 3 [(google.api.field_behavior) = REQUIRED]; + + // Criteria used to filter events. + repeated EventFilter event_filters = 4; + + // Optional. The name of a Pub/Sub topic in the same project that will be used + // as the transport topic for the event delivery. Format: + // `projects/{project}/topics/{topic}`. + // + // This is only valid for events of type + // `google.cloud.pubsub.topic.v1.messagePublished`. The topic provided here + // will not be deleted at function deletion. + string pubsub_topic = 5 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "pubsub.googleapis.com/Topic" + } + ]; + + // Optional. The email of the trigger's service account. The service account must have + // permission to invoke Cloud Run services, the permission is + // `run.routes.invoke`. + // If empty, defaults to the Compute Engine default service account: + // `{project_number}-compute@developer.gserviceaccount.com`. + string service_account_email = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If unset, then defaults to ignoring failures (i.e. not retrying them). + RetryPolicy retry_policy = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The name of the channel associated with the trigger in + // `projects/{project}/locations/{location}/channels/{channel}` format. + // You must provide a channel to receive events from Eventarc SaaS partners. + string channel = 8 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "eventarc.googleapis.com/Channel" + } + ]; +} + +// Filters events based on exact matches on the CloudEvents attributes. +message EventFilter { + // Required. The name of a CloudEvents attribute. + string attribute = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The value for the attribute. + string value = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The operator used for matching the events with the value of the + // filter. If not specified, only events that have an exact key-value pair + // specified in the filter are matched. The only allowed value is + // `match-path-pattern`. + string operator = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for the `GetFunction` method. +message GetFunctionRequest { + // Required. The name of the function which details should be obtained. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudfunctions.googleapis.com/Function" + } + ]; +} + +// Request for the `ListFunctions` method. +message ListFunctionsRequest { + // Required. The project and location from which the function should be listed, + // specified in the format `projects/*/locations/*` + // If you want to list functions in all locations, use "-" in place of a + // location. When listing functions in all locations, if one or more + // location(s) are unreachable, the response will contain functions from all + // reachable locations along with the names of any unreachable locations. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudfunctions.googleapis.com/Function" + } + ]; + + // Maximum number of functions to return per call. + int32 page_size = 2; + + // The value returned by the last + // `ListFunctionsResponse`; indicates that + // this is a continuation of a prior `ListFunctions` call, and that the + // system should return the next page of data. + string page_token = 3; + + // The filter for Functions that match the filter expression, + // following the syntax outlined in https://google.aip.dev/160. + string filter = 4; + + // The sorting order of the resources returned. Value should be a comma + // separated list of fields. The default sorting oder is ascending. + // See https://google.aip.dev/132#ordering. + string order_by = 5; +} + +// Response for the `ListFunctions` method. +message ListFunctionsResponse { + // The functions that match the request. + repeated Function functions = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; + + // Locations that could not be reached. The response does not include any + // functions from these locations. + repeated string unreachable = 3; +} + +// Request for the `CreateFunction` method. +message CreateFunctionRequest { + // Required. The project and location in which the function should be created, specified + // in the format `projects/*/locations/*` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. Function to be created. + Function function = 2 [(google.api.field_behavior) = REQUIRED]; + + // The ID to use for the function, which will become the final component of + // the function's resource name. + // + // This value should be 4-63 characters, and valid characters + // are /[a-z][0-9]-/. + string function_id = 3; +} + +// Request for the `UpdateFunction` method. +message UpdateFunctionRequest { + // Required. New version of the function. + Function function = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. + // If no field mask is provided, all provided fields in the request will be + // updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Request for the `DeleteFunction` method. +message DeleteFunctionRequest { + // Required. The name of the function which should be deleted. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudfunctions.googleapis.com/Function" + } + ]; +} + +// Request of `GenerateSourceUploadUrl` method. +message GenerateUploadUrlRequest { + // Required. The project and location in which the Google Cloud Storage signed URL + // should be generated, specified in the format `projects/*/locations/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; +} + +// Response of `GenerateSourceUploadUrl` method. +message GenerateUploadUrlResponse { + // The generated Google Cloud Storage signed URL that should be used for a + // function source code upload. The uploaded file should be a zip archive + // which contains a function. + string upload_url = 1; + + // The location of the source code in the upload bucket. + // + // Once the archive is uploaded using the `upload_url` use this field to + // set the `function.build_config.source.storage_source` + // during CreateFunction and UpdateFunction. + // + // Generation defaults to 0, as Cloud Storage provides a new generation only + // upon uploading a new object or version of an object. + StorageSource storage_source = 2; +} + +// Request of `GenerateDownloadUrl` method. +message GenerateDownloadUrlRequest { + // Required. The name of function for which source code Google Cloud Storage signed + // URL should be generated. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudfunctions.googleapis.com/Function" + } + ]; +} + +// Response of `GenerateDownloadUrl` method. +message GenerateDownloadUrlResponse { + // The generated Google Cloud Storage signed URL that should be used for + // function source code download. + string download_url = 1; +} + +// Request for the `ListRuntimes` method. +message ListRuntimesRequest { + // Required. The project and location from which the runtimes should be listed, + // specified in the format `projects/*/locations/*` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The filter for Runtimes that match the filter expression, + // following the syntax outlined in https://google.aip.dev/160. + string filter = 2; +} + +// Response for the `ListRuntimes` method. +message ListRuntimesResponse { + // Describes a runtime and any special information (e.g., deprecation status) + // related to it. + message Runtime { + // The name of the runtime, e.g., 'go113', 'nodejs12', etc. + string name = 1; + + // The user facing name, eg 'Go 1.13', 'Node.js 12', etc. + string display_name = 5; + + // The stage of life this runtime is in, e.g., BETA, GA, etc. + RuntimeStage stage = 2; + + // Warning messages, e.g., a deprecation warning. + repeated string warnings = 3; + + // The environment for the runtime. + Environment environment = 4; + } + + // The various stages that a runtime can be in. + enum RuntimeStage { + // Not specified. + RUNTIME_STAGE_UNSPECIFIED = 0; + + // The runtime is in development. + DEVELOPMENT = 1; + + // The runtime is in the Alpha stage. + ALPHA = 2; + + // The runtime is in the Beta stage. + BETA = 3; + + // The runtime is generally available. + GA = 4; + + // The runtime is deprecated. + DEPRECATED = 5; + + // The runtime is no longer supported. + DECOMMISSIONED = 6; + } + + // The runtimes that match the request. + repeated Runtime runtimes = 1; +} + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // The time the operation was created. + google.protobuf.Timestamp create_time = 1; + + // The time the operation finished running. + google.protobuf.Timestamp end_time = 2; + + // Server-defined resource path for the target of the operation. + string target = 3; + + // Name of the verb executed by the operation. + string verb = 4; + + // Human-readable status of the operation, if any. + string status_detail = 5; + + // Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`. + bool cancel_requested = 6; + + // API version used to start the operation. + string api_version = 7; + + // The original request that started the operation. + google.protobuf.Any request_resource = 8; + + // Mechanism for reporting in-progress stages + repeated Stage stages = 9; +} + +// Each Stage of the deployment process +message Stage { + // Possible names for a Stage + enum Name { + // Not specified. Invalid name. + NAME_UNSPECIFIED = 0; + + // Artifact Regsitry Stage + ARTIFACT_REGISTRY = 1; + + // Build Stage + BUILD = 2; + + // Service Stage + SERVICE = 3; + + // Trigger Stage + TRIGGER = 4; + + // Service Rollback Stage + SERVICE_ROLLBACK = 5; + + // Trigger Rollback Stage + TRIGGER_ROLLBACK = 6; + } + + // Possible states for a Stage + enum State { + // Not specified. Invalid state. + STATE_UNSPECIFIED = 0; + + // Stage has not started. + NOT_STARTED = 1; + + // Stage is in progress. + IN_PROGRESS = 2; + + // Stage has completed. + COMPLETE = 3; + } + + // Name of the Stage. This will be unique for each Stage. + Name name = 1; + + // Message describing the Stage + string message = 2; + + // Current state of the Stage + State state = 3; + + // Resource of the Stage + string resource = 4; + + // Link to the current Stage resource + string resource_uri = 5; + + // State messages from the current Stage. + repeated StateMessage state_messages = 6; +} diff --git a/proto-google-cloud-functions-v2beta/clirr-ignored-differences.xml b/proto-google-cloud-functions-v2beta/clirr-ignored-differences.xml new file mode 100644 index 00000000..5c637bc1 --- /dev/null +++ b/proto-google-cloud-functions-v2beta/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/cloud/functions/v2beta/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/functions/v2beta/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/functions/v2beta/*OrBuilder + boolean has*(*) + + diff --git a/proto-google-cloud-functions-v2beta/pom.xml b/proto-google-cloud-functions-v2beta/pom.xml new file mode 100644 index 00000000..2a34c296 --- /dev/null +++ b/proto-google-cloud-functions-v2beta/pom.xml @@ -0,0 +1,42 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-functions-v2beta + 2.4.2-SNAPSHOT + proto-google-cloud-functions-v2beta + Proto library for google-cloud-functions + + com.google.cloud + google-cloud-functions-parent + 2.4.2-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api + api-common + + + com.google.guava + guava + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/BuildConfig.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/BuildConfig.java new file mode 100644 index 00000000..c5165e5c --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/BuildConfig.java @@ -0,0 +1,2513 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +/** + * + * + *
+ * Describes the Build step of the function that builds a container from the
+ * given source.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.BuildConfig} + */ +public final class BuildConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2beta.BuildConfig) + BuildConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use BuildConfig.newBuilder() to construct. + private BuildConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BuildConfig() { + build_ = ""; + runtime_ = ""; + entryPoint_ = ""; + workerPool_ = ""; + dockerRepository_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BuildConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BuildConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + build_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + runtime_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + entryPoint_ = s; + break; + } + case 34: + { + com.google.cloud.functions.v2beta.Source.Builder subBuilder = null; + if (source_ != null) { + subBuilder = source_.toBuilder(); + } + source_ = + input.readMessage( + com.google.cloud.functions.v2beta.Source.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(source_); + source_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + workerPool_ = s; + break; + } + case 50: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + environmentVariables_ = + com.google.protobuf.MapField.newMapField( + EnvironmentVariablesDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry + environmentVariables__ = + input.readMessage( + EnvironmentVariablesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + environmentVariables_ + .getMutableMap() + .put(environmentVariables__.getKey(), environmentVariables__.getValue()); + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + + dockerRepository_ = s; + break; + } + case 66: + { + com.google.cloud.functions.v2beta.SourceProvenance.Builder subBuilder = null; + if (sourceProvenance_ != null) { + subBuilder = sourceProvenance_.toBuilder(); + } + sourceProvenance_ = + input.readMessage( + com.google.cloud.functions.v2beta.SourceProvenance.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(sourceProvenance_); + sourceProvenance_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_BuildConfig_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 6: + return internalGetEnvironmentVariables(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_BuildConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.BuildConfig.class, + com.google.cloud.functions.v2beta.BuildConfig.Builder.class); + } + + public static final int BUILD_FIELD_NUMBER = 1; + private volatile java.lang.Object build_; + /** + * + * + *
+   * Output only. The Cloud Build name of the latest successful deployment of the
+   * function.
+   * 
+ * + * + * string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The build. + */ + @java.lang.Override + public java.lang.String getBuild() { + java.lang.Object ref = build_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + build_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The Cloud Build name of the latest successful deployment of the
+   * function.
+   * 
+ * + * + * string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for build. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBuildBytes() { + java.lang.Object ref = build_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + build_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RUNTIME_FIELD_NUMBER = 2; + private volatile java.lang.Object runtime_; + /** + * + * + *
+   * The runtime in which to run the function. Required when deploying a new
+   * function, optional when updating an existing function. For a complete
+   * list of possible choices, see the
+   * [`gcloud` command
+   * reference](https://cloud.google.com/sdk/gcloud/reference/functions/deploy#--runtime).
+   * 
+ * + * string runtime = 2; + * + * @return The runtime. + */ + @java.lang.Override + public java.lang.String getRuntime() { + java.lang.Object ref = runtime_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + runtime_ = s; + return s; + } + } + /** + * + * + *
+   * The runtime in which to run the function. Required when deploying a new
+   * function, optional when updating an existing function. For a complete
+   * list of possible choices, see the
+   * [`gcloud` command
+   * reference](https://cloud.google.com/sdk/gcloud/reference/functions/deploy#--runtime).
+   * 
+ * + * string runtime = 2; + * + * @return The bytes for runtime. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRuntimeBytes() { + java.lang.Object ref = runtime_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + runtime_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENTRY_POINT_FIELD_NUMBER = 3; + private volatile java.lang.Object entryPoint_; + /** + * + * + *
+   * The name of the function (as defined in source code) that will be
+   * executed. Defaults to the resource name suffix, if not specified. For
+   * backward compatibility, if function with given name is not found, then the
+   * system will try to use function named "function".
+   * For Node.js this is name of a function exported by the module specified
+   * in `source_location`.
+   * 
+ * + * string entry_point = 3; + * + * @return The entryPoint. + */ + @java.lang.Override + public java.lang.String getEntryPoint() { + java.lang.Object ref = entryPoint_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + entryPoint_ = s; + return s; + } + } + /** + * + * + *
+   * The name of the function (as defined in source code) that will be
+   * executed. Defaults to the resource name suffix, if not specified. For
+   * backward compatibility, if function with given name is not found, then the
+   * system will try to use function named "function".
+   * For Node.js this is name of a function exported by the module specified
+   * in `source_location`.
+   * 
+ * + * string entry_point = 3; + * + * @return The bytes for entryPoint. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEntryPointBytes() { + java.lang.Object ref = entryPoint_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + entryPoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SOURCE_FIELD_NUMBER = 4; + private com.google.cloud.functions.v2beta.Source source_; + /** + * + * + *
+   * The location of the function source code.
+   * 
+ * + * .google.cloud.functions.v2beta.Source source = 4; + * + * @return Whether the source field is set. + */ + @java.lang.Override + public boolean hasSource() { + return source_ != null; + } + /** + * + * + *
+   * The location of the function source code.
+   * 
+ * + * .google.cloud.functions.v2beta.Source source = 4; + * + * @return The source. + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.Source getSource() { + return source_ == null + ? com.google.cloud.functions.v2beta.Source.getDefaultInstance() + : source_; + } + /** + * + * + *
+   * The location of the function source code.
+   * 
+ * + * .google.cloud.functions.v2beta.Source source = 4; + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.SourceOrBuilder getSourceOrBuilder() { + return getSource(); + } + + public static final int SOURCE_PROVENANCE_FIELD_NUMBER = 8; + private com.google.cloud.functions.v2beta.SourceProvenance sourceProvenance_; + /** + * + * + *
+   * Output only. A permanent fixed identifier for source.
+   * 
+ * + * + * .google.cloud.functions.v2beta.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the sourceProvenance field is set. + */ + @java.lang.Override + public boolean hasSourceProvenance() { + return sourceProvenance_ != null; + } + /** + * + * + *
+   * Output only. A permanent fixed identifier for source.
+   * 
+ * + * + * .google.cloud.functions.v2beta.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The sourceProvenance. + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.SourceProvenance getSourceProvenance() { + return sourceProvenance_ == null + ? com.google.cloud.functions.v2beta.SourceProvenance.getDefaultInstance() + : sourceProvenance_; + } + /** + * + * + *
+   * Output only. A permanent fixed identifier for source.
+   * 
+ * + * + * .google.cloud.functions.v2beta.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.SourceProvenanceOrBuilder + getSourceProvenanceOrBuilder() { + return getSourceProvenance(); + } + + public static final int WORKER_POOL_FIELD_NUMBER = 5; + private volatile java.lang.Object workerPool_; + /** + * + * + *
+   * Name of the Cloud Build Custom Worker Pool that should be used to build the
+   * function. The format of this field is
+   * `projects/{project}/locations/{region}/workerPools/{workerPool}` where
+   * {project} and {region} are the project id and region respectively where the
+   * worker pool is defined and {workerPool} is the short name of the worker
+   * pool.
+   * If the project id is not the same as the function, then the Cloud
+   * Functions Service Agent
+   * (service-<project_number>@gcf-admin-robot.iam.gserviceaccount.com) must be
+   * granted the role Cloud Build Custom Workers Builder
+   * (roles/cloudbuild.customworkers.builder) in the project.
+   * 
+ * + * string worker_pool = 5 [(.google.api.resource_reference) = { ... } + * + * @return The workerPool. + */ + @java.lang.Override + public java.lang.String getWorkerPool() { + java.lang.Object ref = workerPool_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + workerPool_ = s; + return s; + } + } + /** + * + * + *
+   * Name of the Cloud Build Custom Worker Pool that should be used to build the
+   * function. The format of this field is
+   * `projects/{project}/locations/{region}/workerPools/{workerPool}` where
+   * {project} and {region} are the project id and region respectively where the
+   * worker pool is defined and {workerPool} is the short name of the worker
+   * pool.
+   * If the project id is not the same as the function, then the Cloud
+   * Functions Service Agent
+   * (service-<project_number>@gcf-admin-robot.iam.gserviceaccount.com) must be
+   * granted the role Cloud Build Custom Workers Builder
+   * (roles/cloudbuild.customworkers.builder) in the project.
+   * 
+ * + * string worker_pool = 5 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for workerPool. + */ + @java.lang.Override + public com.google.protobuf.ByteString getWorkerPoolBytes() { + java.lang.Object ref = workerPool_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + workerPool_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENVIRONMENT_VARIABLES_FIELD_NUMBER = 6; + + private static final class EnvironmentVariablesDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_BuildConfig_EnvironmentVariablesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField environmentVariables_; + + private com.google.protobuf.MapField + internalGetEnvironmentVariables() { + if (environmentVariables_ == null) { + return com.google.protobuf.MapField.emptyMapField( + EnvironmentVariablesDefaultEntryHolder.defaultEntry); + } + return environmentVariables_; + } + + public int getEnvironmentVariablesCount() { + return internalGetEnvironmentVariables().getMap().size(); + } + /** + * + * + *
+   * User-provided build-time environment variables for the function
+   * 
+ * + * map<string, string> environment_variables = 6; + */ + @java.lang.Override + public boolean containsEnvironmentVariables(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetEnvironmentVariables().getMap().containsKey(key); + } + /** Use {@link #getEnvironmentVariablesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getEnvironmentVariables() { + return getEnvironmentVariablesMap(); + } + /** + * + * + *
+   * User-provided build-time environment variables for the function
+   * 
+ * + * map<string, string> environment_variables = 6; + */ + @java.lang.Override + public java.util.Map getEnvironmentVariablesMap() { + return internalGetEnvironmentVariables().getMap(); + } + /** + * + * + *
+   * User-provided build-time environment variables for the function
+   * 
+ * + * map<string, string> environment_variables = 6; + */ + @java.lang.Override + public java.lang.String getEnvironmentVariablesOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetEnvironmentVariables().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * User-provided build-time environment variables for the function
+   * 
+ * + * map<string, string> environment_variables = 6; + */ + @java.lang.Override + public java.lang.String getEnvironmentVariablesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetEnvironmentVariables().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int DOCKER_REPOSITORY_FIELD_NUMBER = 7; + private volatile java.lang.Object dockerRepository_; + /** + * + * + *
+   * Optional. User managed repository created in Artifact Registry optionally with a
+   * customer managed encryption key. This is the repository to which the
+   * function docker image will be pushed after it is built by Cloud Build.
+   * If unspecified, GCF will create and use a repository named 'gcf-artifacts'
+   * for every deployed region.
+   * It must match the pattern
+   * `projects/{project}/locations/{location}/repositories/{repository}`.
+   * Cross-project repositories are not supported.
+   * Cross-location repositories are not supported.
+   * Repository format must be 'DOCKER'.
+   * 
+ * + * + * string docker_repository = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The dockerRepository. + */ + @java.lang.Override + public java.lang.String getDockerRepository() { + java.lang.Object ref = dockerRepository_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dockerRepository_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. User managed repository created in Artifact Registry optionally with a
+   * customer managed encryption key. This is the repository to which the
+   * function docker image will be pushed after it is built by Cloud Build.
+   * If unspecified, GCF will create and use a repository named 'gcf-artifacts'
+   * for every deployed region.
+   * It must match the pattern
+   * `projects/{project}/locations/{location}/repositories/{repository}`.
+   * Cross-project repositories are not supported.
+   * Cross-location repositories are not supported.
+   * Repository format must be 'DOCKER'.
+   * 
+ * + * + * string docker_repository = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for dockerRepository. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDockerRepositoryBytes() { + java.lang.Object ref = dockerRepository_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dockerRepository_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(build_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, build_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(runtime_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, runtime_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(entryPoint_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, entryPoint_); + } + if (source_ != null) { + output.writeMessage(4, getSource()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(workerPool_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, workerPool_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, + internalGetEnvironmentVariables(), + EnvironmentVariablesDefaultEntryHolder.defaultEntry, + 6); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dockerRepository_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, dockerRepository_); + } + if (sourceProvenance_ != null) { + output.writeMessage(8, getSourceProvenance()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(build_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, build_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(runtime_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, runtime_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(entryPoint_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, entryPoint_); + } + if (source_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getSource()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(workerPool_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, workerPool_); + } + for (java.util.Map.Entry entry : + internalGetEnvironmentVariables().getMap().entrySet()) { + com.google.protobuf.MapEntry environmentVariables__ = + EnvironmentVariablesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, environmentVariables__); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dockerRepository_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, dockerRepository_); + } + if (sourceProvenance_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getSourceProvenance()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2beta.BuildConfig)) { + return super.equals(obj); + } + com.google.cloud.functions.v2beta.BuildConfig other = + (com.google.cloud.functions.v2beta.BuildConfig) obj; + + if (!getBuild().equals(other.getBuild())) return false; + if (!getRuntime().equals(other.getRuntime())) return false; + if (!getEntryPoint().equals(other.getEntryPoint())) return false; + if (hasSource() != other.hasSource()) return false; + if (hasSource()) { + if (!getSource().equals(other.getSource())) return false; + } + if (hasSourceProvenance() != other.hasSourceProvenance()) return false; + if (hasSourceProvenance()) { + if (!getSourceProvenance().equals(other.getSourceProvenance())) return false; + } + if (!getWorkerPool().equals(other.getWorkerPool())) return false; + if (!internalGetEnvironmentVariables().equals(other.internalGetEnvironmentVariables())) + return false; + if (!getDockerRepository().equals(other.getDockerRepository())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + BUILD_FIELD_NUMBER; + hash = (53 * hash) + getBuild().hashCode(); + hash = (37 * hash) + RUNTIME_FIELD_NUMBER; + hash = (53 * hash) + getRuntime().hashCode(); + hash = (37 * hash) + ENTRY_POINT_FIELD_NUMBER; + hash = (53 * hash) + getEntryPoint().hashCode(); + if (hasSource()) { + hash = (37 * hash) + SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getSource().hashCode(); + } + if (hasSourceProvenance()) { + hash = (37 * hash) + SOURCE_PROVENANCE_FIELD_NUMBER; + hash = (53 * hash) + getSourceProvenance().hashCode(); + } + hash = (37 * hash) + WORKER_POOL_FIELD_NUMBER; + hash = (53 * hash) + getWorkerPool().hashCode(); + if (!internalGetEnvironmentVariables().getMap().isEmpty()) { + hash = (37 * hash) + ENVIRONMENT_VARIABLES_FIELD_NUMBER; + hash = (53 * hash) + internalGetEnvironmentVariables().hashCode(); + } + hash = (37 * hash) + DOCKER_REPOSITORY_FIELD_NUMBER; + hash = (53 * hash) + getDockerRepository().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2beta.BuildConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.BuildConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.BuildConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.BuildConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.BuildConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.BuildConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.BuildConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.BuildConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.BuildConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.BuildConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.BuildConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.BuildConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v2beta.BuildConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Describes the Build step of the function that builds a container from the
+   * given source.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.BuildConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2beta.BuildConfig) + com.google.cloud.functions.v2beta.BuildConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_BuildConfig_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 6: + return internalGetEnvironmentVariables(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 6: + return internalGetMutableEnvironmentVariables(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_BuildConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.BuildConfig.class, + com.google.cloud.functions.v2beta.BuildConfig.Builder.class); + } + + // Construct using com.google.cloud.functions.v2beta.BuildConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + build_ = ""; + + runtime_ = ""; + + entryPoint_ = ""; + + if (sourceBuilder_ == null) { + source_ = null; + } else { + source_ = null; + sourceBuilder_ = null; + } + if (sourceProvenanceBuilder_ == null) { + sourceProvenance_ = null; + } else { + sourceProvenance_ = null; + sourceProvenanceBuilder_ = null; + } + workerPool_ = ""; + + internalGetMutableEnvironmentVariables().clear(); + dockerRepository_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_BuildConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.BuildConfig getDefaultInstanceForType() { + return com.google.cloud.functions.v2beta.BuildConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.BuildConfig build() { + com.google.cloud.functions.v2beta.BuildConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.BuildConfig buildPartial() { + com.google.cloud.functions.v2beta.BuildConfig result = + new com.google.cloud.functions.v2beta.BuildConfig(this); + int from_bitField0_ = bitField0_; + result.build_ = build_; + result.runtime_ = runtime_; + result.entryPoint_ = entryPoint_; + if (sourceBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = sourceBuilder_.build(); + } + if (sourceProvenanceBuilder_ == null) { + result.sourceProvenance_ = sourceProvenance_; + } else { + result.sourceProvenance_ = sourceProvenanceBuilder_.build(); + } + result.workerPool_ = workerPool_; + result.environmentVariables_ = internalGetEnvironmentVariables(); + result.environmentVariables_.makeImmutable(); + result.dockerRepository_ = dockerRepository_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2beta.BuildConfig) { + return mergeFrom((com.google.cloud.functions.v2beta.BuildConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2beta.BuildConfig other) { + if (other == com.google.cloud.functions.v2beta.BuildConfig.getDefaultInstance()) return this; + if (!other.getBuild().isEmpty()) { + build_ = other.build_; + onChanged(); + } + if (!other.getRuntime().isEmpty()) { + runtime_ = other.runtime_; + onChanged(); + } + if (!other.getEntryPoint().isEmpty()) { + entryPoint_ = other.entryPoint_; + onChanged(); + } + if (other.hasSource()) { + mergeSource(other.getSource()); + } + if (other.hasSourceProvenance()) { + mergeSourceProvenance(other.getSourceProvenance()); + } + if (!other.getWorkerPool().isEmpty()) { + workerPool_ = other.workerPool_; + onChanged(); + } + internalGetMutableEnvironmentVariables().mergeFrom(other.internalGetEnvironmentVariables()); + if (!other.getDockerRepository().isEmpty()) { + dockerRepository_ = other.dockerRepository_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2beta.BuildConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v2beta.BuildConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object build_ = ""; + /** + * + * + *
+     * Output only. The Cloud Build name of the latest successful deployment of the
+     * function.
+     * 
+ * + * + * string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The build. + */ + public java.lang.String getBuild() { + java.lang.Object ref = build_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + build_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The Cloud Build name of the latest successful deployment of the
+     * function.
+     * 
+ * + * + * string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for build. + */ + public com.google.protobuf.ByteString getBuildBytes() { + java.lang.Object ref = build_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + build_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The Cloud Build name of the latest successful deployment of the
+     * function.
+     * 
+ * + * + * string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The build to set. + * @return This builder for chaining. + */ + public Builder setBuild(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + build_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The Cloud Build name of the latest successful deployment of the
+     * function.
+     * 
+ * + * + * string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearBuild() { + + build_ = getDefaultInstance().getBuild(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The Cloud Build name of the latest successful deployment of the
+     * function.
+     * 
+ * + * + * string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for build to set. + * @return This builder for chaining. + */ + public Builder setBuildBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + build_ = value; + onChanged(); + return this; + } + + private java.lang.Object runtime_ = ""; + /** + * + * + *
+     * The runtime in which to run the function. Required when deploying a new
+     * function, optional when updating an existing function. For a complete
+     * list of possible choices, see the
+     * [`gcloud` command
+     * reference](https://cloud.google.com/sdk/gcloud/reference/functions/deploy#--runtime).
+     * 
+ * + * string runtime = 2; + * + * @return The runtime. + */ + public java.lang.String getRuntime() { + java.lang.Object ref = runtime_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + runtime_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The runtime in which to run the function. Required when deploying a new
+     * function, optional when updating an existing function. For a complete
+     * list of possible choices, see the
+     * [`gcloud` command
+     * reference](https://cloud.google.com/sdk/gcloud/reference/functions/deploy#--runtime).
+     * 
+ * + * string runtime = 2; + * + * @return The bytes for runtime. + */ + public com.google.protobuf.ByteString getRuntimeBytes() { + java.lang.Object ref = runtime_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + runtime_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The runtime in which to run the function. Required when deploying a new
+     * function, optional when updating an existing function. For a complete
+     * list of possible choices, see the
+     * [`gcloud` command
+     * reference](https://cloud.google.com/sdk/gcloud/reference/functions/deploy#--runtime).
+     * 
+ * + * string runtime = 2; + * + * @param value The runtime to set. + * @return This builder for chaining. + */ + public Builder setRuntime(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + runtime_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The runtime in which to run the function. Required when deploying a new
+     * function, optional when updating an existing function. For a complete
+     * list of possible choices, see the
+     * [`gcloud` command
+     * reference](https://cloud.google.com/sdk/gcloud/reference/functions/deploy#--runtime).
+     * 
+ * + * string runtime = 2; + * + * @return This builder for chaining. + */ + public Builder clearRuntime() { + + runtime_ = getDefaultInstance().getRuntime(); + onChanged(); + return this; + } + /** + * + * + *
+     * The runtime in which to run the function. Required when deploying a new
+     * function, optional when updating an existing function. For a complete
+     * list of possible choices, see the
+     * [`gcloud` command
+     * reference](https://cloud.google.com/sdk/gcloud/reference/functions/deploy#--runtime).
+     * 
+ * + * string runtime = 2; + * + * @param value The bytes for runtime to set. + * @return This builder for chaining. + */ + public Builder setRuntimeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + runtime_ = value; + onChanged(); + return this; + } + + private java.lang.Object entryPoint_ = ""; + /** + * + * + *
+     * The name of the function (as defined in source code) that will be
+     * executed. Defaults to the resource name suffix, if not specified. For
+     * backward compatibility, if function with given name is not found, then the
+     * system will try to use function named "function".
+     * For Node.js this is name of a function exported by the module specified
+     * in `source_location`.
+     * 
+ * + * string entry_point = 3; + * + * @return The entryPoint. + */ + public java.lang.String getEntryPoint() { + java.lang.Object ref = entryPoint_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + entryPoint_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The name of the function (as defined in source code) that will be
+     * executed. Defaults to the resource name suffix, if not specified. For
+     * backward compatibility, if function with given name is not found, then the
+     * system will try to use function named "function".
+     * For Node.js this is name of a function exported by the module specified
+     * in `source_location`.
+     * 
+ * + * string entry_point = 3; + * + * @return The bytes for entryPoint. + */ + public com.google.protobuf.ByteString getEntryPointBytes() { + java.lang.Object ref = entryPoint_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + entryPoint_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The name of the function (as defined in source code) that will be
+     * executed. Defaults to the resource name suffix, if not specified. For
+     * backward compatibility, if function with given name is not found, then the
+     * system will try to use function named "function".
+     * For Node.js this is name of a function exported by the module specified
+     * in `source_location`.
+     * 
+ * + * string entry_point = 3; + * + * @param value The entryPoint to set. + * @return This builder for chaining. + */ + public Builder setEntryPoint(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + entryPoint_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the function (as defined in source code) that will be
+     * executed. Defaults to the resource name suffix, if not specified. For
+     * backward compatibility, if function with given name is not found, then the
+     * system will try to use function named "function".
+     * For Node.js this is name of a function exported by the module specified
+     * in `source_location`.
+     * 
+ * + * string entry_point = 3; + * + * @return This builder for chaining. + */ + public Builder clearEntryPoint() { + + entryPoint_ = getDefaultInstance().getEntryPoint(); + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the function (as defined in source code) that will be
+     * executed. Defaults to the resource name suffix, if not specified. For
+     * backward compatibility, if function with given name is not found, then the
+     * system will try to use function named "function".
+     * For Node.js this is name of a function exported by the module specified
+     * in `source_location`.
+     * 
+ * + * string entry_point = 3; + * + * @param value The bytes for entryPoint to set. + * @return This builder for chaining. + */ + public Builder setEntryPointBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + entryPoint_ = value; + onChanged(); + return this; + } + + private com.google.cloud.functions.v2beta.Source source_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2beta.Source, + com.google.cloud.functions.v2beta.Source.Builder, + com.google.cloud.functions.v2beta.SourceOrBuilder> + sourceBuilder_; + /** + * + * + *
+     * The location of the function source code.
+     * 
+ * + * .google.cloud.functions.v2beta.Source source = 4; + * + * @return Whether the source field is set. + */ + public boolean hasSource() { + return sourceBuilder_ != null || source_ != null; + } + /** + * + * + *
+     * The location of the function source code.
+     * 
+ * + * .google.cloud.functions.v2beta.Source source = 4; + * + * @return The source. + */ + public com.google.cloud.functions.v2beta.Source getSource() { + if (sourceBuilder_ == null) { + return source_ == null + ? com.google.cloud.functions.v2beta.Source.getDefaultInstance() + : source_; + } else { + return sourceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The location of the function source code.
+     * 
+ * + * .google.cloud.functions.v2beta.Source source = 4; + */ + public Builder setSource(com.google.cloud.functions.v2beta.Source value) { + if (sourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + sourceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The location of the function source code.
+     * 
+ * + * .google.cloud.functions.v2beta.Source source = 4; + */ + public Builder setSource(com.google.cloud.functions.v2beta.Source.Builder builderForValue) { + if (sourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + sourceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The location of the function source code.
+     * 
+ * + * .google.cloud.functions.v2beta.Source source = 4; + */ + public Builder mergeSource(com.google.cloud.functions.v2beta.Source value) { + if (sourceBuilder_ == null) { + if (source_ != null) { + source_ = + com.google.cloud.functions.v2beta.Source.newBuilder(source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + sourceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The location of the function source code.
+     * 
+ * + * .google.cloud.functions.v2beta.Source source = 4; + */ + public Builder clearSource() { + if (sourceBuilder_ == null) { + source_ = null; + onChanged(); + } else { + source_ = null; + sourceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The location of the function source code.
+     * 
+ * + * .google.cloud.functions.v2beta.Source source = 4; + */ + public com.google.cloud.functions.v2beta.Source.Builder getSourceBuilder() { + + onChanged(); + return getSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The location of the function source code.
+     * 
+ * + * .google.cloud.functions.v2beta.Source source = 4; + */ + public com.google.cloud.functions.v2beta.SourceOrBuilder getSourceOrBuilder() { + if (sourceBuilder_ != null) { + return sourceBuilder_.getMessageOrBuilder(); + } else { + return source_ == null + ? com.google.cloud.functions.v2beta.Source.getDefaultInstance() + : source_; + } + } + /** + * + * + *
+     * The location of the function source code.
+     * 
+ * + * .google.cloud.functions.v2beta.Source source = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2beta.Source, + com.google.cloud.functions.v2beta.Source.Builder, + com.google.cloud.functions.v2beta.SourceOrBuilder> + getSourceFieldBuilder() { + if (sourceBuilder_ == null) { + sourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2beta.Source, + com.google.cloud.functions.v2beta.Source.Builder, + com.google.cloud.functions.v2beta.SourceOrBuilder>( + getSource(), getParentForChildren(), isClean()); + source_ = null; + } + return sourceBuilder_; + } + + private com.google.cloud.functions.v2beta.SourceProvenance sourceProvenance_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2beta.SourceProvenance, + com.google.cloud.functions.v2beta.SourceProvenance.Builder, + com.google.cloud.functions.v2beta.SourceProvenanceOrBuilder> + sourceProvenanceBuilder_; + /** + * + * + *
+     * Output only. A permanent fixed identifier for source.
+     * 
+ * + * + * .google.cloud.functions.v2beta.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the sourceProvenance field is set. + */ + public boolean hasSourceProvenance() { + return sourceProvenanceBuilder_ != null || sourceProvenance_ != null; + } + /** + * + * + *
+     * Output only. A permanent fixed identifier for source.
+     * 
+ * + * + * .google.cloud.functions.v2beta.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The sourceProvenance. + */ + public com.google.cloud.functions.v2beta.SourceProvenance getSourceProvenance() { + if (sourceProvenanceBuilder_ == null) { + return sourceProvenance_ == null + ? com.google.cloud.functions.v2beta.SourceProvenance.getDefaultInstance() + : sourceProvenance_; + } else { + return sourceProvenanceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. A permanent fixed identifier for source.
+     * 
+ * + * + * .google.cloud.functions.v2beta.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSourceProvenance(com.google.cloud.functions.v2beta.SourceProvenance value) { + if (sourceProvenanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sourceProvenance_ = value; + onChanged(); + } else { + sourceProvenanceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. A permanent fixed identifier for source.
+     * 
+ * + * + * .google.cloud.functions.v2beta.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setSourceProvenance( + com.google.cloud.functions.v2beta.SourceProvenance.Builder builderForValue) { + if (sourceProvenanceBuilder_ == null) { + sourceProvenance_ = builderForValue.build(); + onChanged(); + } else { + sourceProvenanceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. A permanent fixed identifier for source.
+     * 
+ * + * + * .google.cloud.functions.v2beta.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeSourceProvenance(com.google.cloud.functions.v2beta.SourceProvenance value) { + if (sourceProvenanceBuilder_ == null) { + if (sourceProvenance_ != null) { + sourceProvenance_ = + com.google.cloud.functions.v2beta.SourceProvenance.newBuilder(sourceProvenance_) + .mergeFrom(value) + .buildPartial(); + } else { + sourceProvenance_ = value; + } + onChanged(); + } else { + sourceProvenanceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. A permanent fixed identifier for source.
+     * 
+ * + * + * .google.cloud.functions.v2beta.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearSourceProvenance() { + if (sourceProvenanceBuilder_ == null) { + sourceProvenance_ = null; + onChanged(); + } else { + sourceProvenance_ = null; + sourceProvenanceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. A permanent fixed identifier for source.
+     * 
+ * + * + * .google.cloud.functions.v2beta.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.functions.v2beta.SourceProvenance.Builder getSourceProvenanceBuilder() { + + onChanged(); + return getSourceProvenanceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. A permanent fixed identifier for source.
+     * 
+ * + * + * .google.cloud.functions.v2beta.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.functions.v2beta.SourceProvenanceOrBuilder + getSourceProvenanceOrBuilder() { + if (sourceProvenanceBuilder_ != null) { + return sourceProvenanceBuilder_.getMessageOrBuilder(); + } else { + return sourceProvenance_ == null + ? com.google.cloud.functions.v2beta.SourceProvenance.getDefaultInstance() + : sourceProvenance_; + } + } + /** + * + * + *
+     * Output only. A permanent fixed identifier for source.
+     * 
+ * + * + * .google.cloud.functions.v2beta.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2beta.SourceProvenance, + com.google.cloud.functions.v2beta.SourceProvenance.Builder, + com.google.cloud.functions.v2beta.SourceProvenanceOrBuilder> + getSourceProvenanceFieldBuilder() { + if (sourceProvenanceBuilder_ == null) { + sourceProvenanceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2beta.SourceProvenance, + com.google.cloud.functions.v2beta.SourceProvenance.Builder, + com.google.cloud.functions.v2beta.SourceProvenanceOrBuilder>( + getSourceProvenance(), getParentForChildren(), isClean()); + sourceProvenance_ = null; + } + return sourceProvenanceBuilder_; + } + + private java.lang.Object workerPool_ = ""; + /** + * + * + *
+     * Name of the Cloud Build Custom Worker Pool that should be used to build the
+     * function. The format of this field is
+     * `projects/{project}/locations/{region}/workerPools/{workerPool}` where
+     * {project} and {region} are the project id and region respectively where the
+     * worker pool is defined and {workerPool} is the short name of the worker
+     * pool.
+     * If the project id is not the same as the function, then the Cloud
+     * Functions Service Agent
+     * (service-<project_number>@gcf-admin-robot.iam.gserviceaccount.com) must be
+     * granted the role Cloud Build Custom Workers Builder
+     * (roles/cloudbuild.customworkers.builder) in the project.
+     * 
+ * + * string worker_pool = 5 [(.google.api.resource_reference) = { ... } + * + * @return The workerPool. + */ + public java.lang.String getWorkerPool() { + java.lang.Object ref = workerPool_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + workerPool_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the Cloud Build Custom Worker Pool that should be used to build the
+     * function. The format of this field is
+     * `projects/{project}/locations/{region}/workerPools/{workerPool}` where
+     * {project} and {region} are the project id and region respectively where the
+     * worker pool is defined and {workerPool} is the short name of the worker
+     * pool.
+     * If the project id is not the same as the function, then the Cloud
+     * Functions Service Agent
+     * (service-<project_number>@gcf-admin-robot.iam.gserviceaccount.com) must be
+     * granted the role Cloud Build Custom Workers Builder
+     * (roles/cloudbuild.customworkers.builder) in the project.
+     * 
+ * + * string worker_pool = 5 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for workerPool. + */ + public com.google.protobuf.ByteString getWorkerPoolBytes() { + java.lang.Object ref = workerPool_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + workerPool_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the Cloud Build Custom Worker Pool that should be used to build the
+     * function. The format of this field is
+     * `projects/{project}/locations/{region}/workerPools/{workerPool}` where
+     * {project} and {region} are the project id and region respectively where the
+     * worker pool is defined and {workerPool} is the short name of the worker
+     * pool.
+     * If the project id is not the same as the function, then the Cloud
+     * Functions Service Agent
+     * (service-<project_number>@gcf-admin-robot.iam.gserviceaccount.com) must be
+     * granted the role Cloud Build Custom Workers Builder
+     * (roles/cloudbuild.customworkers.builder) in the project.
+     * 
+ * + * string worker_pool = 5 [(.google.api.resource_reference) = { ... } + * + * @param value The workerPool to set. + * @return This builder for chaining. + */ + public Builder setWorkerPool(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + workerPool_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the Cloud Build Custom Worker Pool that should be used to build the
+     * function. The format of this field is
+     * `projects/{project}/locations/{region}/workerPools/{workerPool}` where
+     * {project} and {region} are the project id and region respectively where the
+     * worker pool is defined and {workerPool} is the short name of the worker
+     * pool.
+     * If the project id is not the same as the function, then the Cloud
+     * Functions Service Agent
+     * (service-<project_number>@gcf-admin-robot.iam.gserviceaccount.com) must be
+     * granted the role Cloud Build Custom Workers Builder
+     * (roles/cloudbuild.customworkers.builder) in the project.
+     * 
+ * + * string worker_pool = 5 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearWorkerPool() { + + workerPool_ = getDefaultInstance().getWorkerPool(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the Cloud Build Custom Worker Pool that should be used to build the
+     * function. The format of this field is
+     * `projects/{project}/locations/{region}/workerPools/{workerPool}` where
+     * {project} and {region} are the project id and region respectively where the
+     * worker pool is defined and {workerPool} is the short name of the worker
+     * pool.
+     * If the project id is not the same as the function, then the Cloud
+     * Functions Service Agent
+     * (service-<project_number>@gcf-admin-robot.iam.gserviceaccount.com) must be
+     * granted the role Cloud Build Custom Workers Builder
+     * (roles/cloudbuild.customworkers.builder) in the project.
+     * 
+ * + * string worker_pool = 5 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for workerPool to set. + * @return This builder for chaining. + */ + public Builder setWorkerPoolBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + workerPool_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField environmentVariables_; + + private com.google.protobuf.MapField + internalGetEnvironmentVariables() { + if (environmentVariables_ == null) { + return com.google.protobuf.MapField.emptyMapField( + EnvironmentVariablesDefaultEntryHolder.defaultEntry); + } + return environmentVariables_; + } + + private com.google.protobuf.MapField + internalGetMutableEnvironmentVariables() { + onChanged(); + ; + if (environmentVariables_ == null) { + environmentVariables_ = + com.google.protobuf.MapField.newMapField( + EnvironmentVariablesDefaultEntryHolder.defaultEntry); + } + if (!environmentVariables_.isMutable()) { + environmentVariables_ = environmentVariables_.copy(); + } + return environmentVariables_; + } + + public int getEnvironmentVariablesCount() { + return internalGetEnvironmentVariables().getMap().size(); + } + /** + * + * + *
+     * User-provided build-time environment variables for the function
+     * 
+ * + * map<string, string> environment_variables = 6; + */ + @java.lang.Override + public boolean containsEnvironmentVariables(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetEnvironmentVariables().getMap().containsKey(key); + } + /** Use {@link #getEnvironmentVariablesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getEnvironmentVariables() { + return getEnvironmentVariablesMap(); + } + /** + * + * + *
+     * User-provided build-time environment variables for the function
+     * 
+ * + * map<string, string> environment_variables = 6; + */ + @java.lang.Override + public java.util.Map getEnvironmentVariablesMap() { + return internalGetEnvironmentVariables().getMap(); + } + /** + * + * + *
+     * User-provided build-time environment variables for the function
+     * 
+ * + * map<string, string> environment_variables = 6; + */ + @java.lang.Override + public java.lang.String getEnvironmentVariablesOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetEnvironmentVariables().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * User-provided build-time environment variables for the function
+     * 
+ * + * map<string, string> environment_variables = 6; + */ + @java.lang.Override + public java.lang.String getEnvironmentVariablesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetEnvironmentVariables().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearEnvironmentVariables() { + internalGetMutableEnvironmentVariables().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * User-provided build-time environment variables for the function
+     * 
+ * + * map<string, string> environment_variables = 6; + */ + public Builder removeEnvironmentVariables(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableEnvironmentVariables().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableEnvironmentVariables() { + return internalGetMutableEnvironmentVariables().getMutableMap(); + } + /** + * + * + *
+     * User-provided build-time environment variables for the function
+     * 
+ * + * map<string, string> environment_variables = 6; + */ + public Builder putEnvironmentVariables(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableEnvironmentVariables().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * User-provided build-time environment variables for the function
+     * 
+ * + * map<string, string> environment_variables = 6; + */ + public Builder putAllEnvironmentVariables( + java.util.Map values) { + internalGetMutableEnvironmentVariables().getMutableMap().putAll(values); + return this; + } + + private java.lang.Object dockerRepository_ = ""; + /** + * + * + *
+     * Optional. User managed repository created in Artifact Registry optionally with a
+     * customer managed encryption key. This is the repository to which the
+     * function docker image will be pushed after it is built by Cloud Build.
+     * If unspecified, GCF will create and use a repository named 'gcf-artifacts'
+     * for every deployed region.
+     * It must match the pattern
+     * `projects/{project}/locations/{location}/repositories/{repository}`.
+     * Cross-project repositories are not supported.
+     * Cross-location repositories are not supported.
+     * Repository format must be 'DOCKER'.
+     * 
+ * + * + * string docker_repository = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The dockerRepository. + */ + public java.lang.String getDockerRepository() { + java.lang.Object ref = dockerRepository_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dockerRepository_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. User managed repository created in Artifact Registry optionally with a
+     * customer managed encryption key. This is the repository to which the
+     * function docker image will be pushed after it is built by Cloud Build.
+     * If unspecified, GCF will create and use a repository named 'gcf-artifacts'
+     * for every deployed region.
+     * It must match the pattern
+     * `projects/{project}/locations/{location}/repositories/{repository}`.
+     * Cross-project repositories are not supported.
+     * Cross-location repositories are not supported.
+     * Repository format must be 'DOCKER'.
+     * 
+ * + * + * string docker_repository = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for dockerRepository. + */ + public com.google.protobuf.ByteString getDockerRepositoryBytes() { + java.lang.Object ref = dockerRepository_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dockerRepository_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. User managed repository created in Artifact Registry optionally with a
+     * customer managed encryption key. This is the repository to which the
+     * function docker image will be pushed after it is built by Cloud Build.
+     * If unspecified, GCF will create and use a repository named 'gcf-artifacts'
+     * for every deployed region.
+     * It must match the pattern
+     * `projects/{project}/locations/{location}/repositories/{repository}`.
+     * Cross-project repositories are not supported.
+     * Cross-location repositories are not supported.
+     * Repository format must be 'DOCKER'.
+     * 
+ * + * + * string docker_repository = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The dockerRepository to set. + * @return This builder for chaining. + */ + public Builder setDockerRepository(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + dockerRepository_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. User managed repository created in Artifact Registry optionally with a
+     * customer managed encryption key. This is the repository to which the
+     * function docker image will be pushed after it is built by Cloud Build.
+     * If unspecified, GCF will create and use a repository named 'gcf-artifacts'
+     * for every deployed region.
+     * It must match the pattern
+     * `projects/{project}/locations/{location}/repositories/{repository}`.
+     * Cross-project repositories are not supported.
+     * Cross-location repositories are not supported.
+     * Repository format must be 'DOCKER'.
+     * 
+ * + * + * string docker_repository = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearDockerRepository() { + + dockerRepository_ = getDefaultInstance().getDockerRepository(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. User managed repository created in Artifact Registry optionally with a
+     * customer managed encryption key. This is the repository to which the
+     * function docker image will be pushed after it is built by Cloud Build.
+     * If unspecified, GCF will create and use a repository named 'gcf-artifacts'
+     * for every deployed region.
+     * It must match the pattern
+     * `projects/{project}/locations/{location}/repositories/{repository}`.
+     * Cross-project repositories are not supported.
+     * Cross-location repositories are not supported.
+     * Repository format must be 'DOCKER'.
+     * 
+ * + * + * string docker_repository = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for dockerRepository to set. + * @return This builder for chaining. + */ + public Builder setDockerRepositoryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + dockerRepository_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2beta.BuildConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2beta.BuildConfig) + private static final com.google.cloud.functions.v2beta.BuildConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2beta.BuildConfig(); + } + + public static com.google.cloud.functions.v2beta.BuildConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BuildConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BuildConfig(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.BuildConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/BuildConfigOrBuilder.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/BuildConfigOrBuilder.java new file mode 100644 index 00000000..2f3d2721 --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/BuildConfigOrBuilder.java @@ -0,0 +1,351 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +public interface BuildConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2beta.BuildConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The Cloud Build name of the latest successful deployment of the
+   * function.
+   * 
+ * + * + * string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The build. + */ + java.lang.String getBuild(); + /** + * + * + *
+   * Output only. The Cloud Build name of the latest successful deployment of the
+   * function.
+   * 
+ * + * + * string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for build. + */ + com.google.protobuf.ByteString getBuildBytes(); + + /** + * + * + *
+   * The runtime in which to run the function. Required when deploying a new
+   * function, optional when updating an existing function. For a complete
+   * list of possible choices, see the
+   * [`gcloud` command
+   * reference](https://cloud.google.com/sdk/gcloud/reference/functions/deploy#--runtime).
+   * 
+ * + * string runtime = 2; + * + * @return The runtime. + */ + java.lang.String getRuntime(); + /** + * + * + *
+   * The runtime in which to run the function. Required when deploying a new
+   * function, optional when updating an existing function. For a complete
+   * list of possible choices, see the
+   * [`gcloud` command
+   * reference](https://cloud.google.com/sdk/gcloud/reference/functions/deploy#--runtime).
+   * 
+ * + * string runtime = 2; + * + * @return The bytes for runtime. + */ + com.google.protobuf.ByteString getRuntimeBytes(); + + /** + * + * + *
+   * The name of the function (as defined in source code) that will be
+   * executed. Defaults to the resource name suffix, if not specified. For
+   * backward compatibility, if function with given name is not found, then the
+   * system will try to use function named "function".
+   * For Node.js this is name of a function exported by the module specified
+   * in `source_location`.
+   * 
+ * + * string entry_point = 3; + * + * @return The entryPoint. + */ + java.lang.String getEntryPoint(); + /** + * + * + *
+   * The name of the function (as defined in source code) that will be
+   * executed. Defaults to the resource name suffix, if not specified. For
+   * backward compatibility, if function with given name is not found, then the
+   * system will try to use function named "function".
+   * For Node.js this is name of a function exported by the module specified
+   * in `source_location`.
+   * 
+ * + * string entry_point = 3; + * + * @return The bytes for entryPoint. + */ + com.google.protobuf.ByteString getEntryPointBytes(); + + /** + * + * + *
+   * The location of the function source code.
+   * 
+ * + * .google.cloud.functions.v2beta.Source source = 4; + * + * @return Whether the source field is set. + */ + boolean hasSource(); + /** + * + * + *
+   * The location of the function source code.
+   * 
+ * + * .google.cloud.functions.v2beta.Source source = 4; + * + * @return The source. + */ + com.google.cloud.functions.v2beta.Source getSource(); + /** + * + * + *
+   * The location of the function source code.
+   * 
+ * + * .google.cloud.functions.v2beta.Source source = 4; + */ + com.google.cloud.functions.v2beta.SourceOrBuilder getSourceOrBuilder(); + + /** + * + * + *
+   * Output only. A permanent fixed identifier for source.
+   * 
+ * + * + * .google.cloud.functions.v2beta.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the sourceProvenance field is set. + */ + boolean hasSourceProvenance(); + /** + * + * + *
+   * Output only. A permanent fixed identifier for source.
+   * 
+ * + * + * .google.cloud.functions.v2beta.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The sourceProvenance. + */ + com.google.cloud.functions.v2beta.SourceProvenance getSourceProvenance(); + /** + * + * + *
+   * Output only. A permanent fixed identifier for source.
+   * 
+ * + * + * .google.cloud.functions.v2beta.SourceProvenance source_provenance = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.functions.v2beta.SourceProvenanceOrBuilder getSourceProvenanceOrBuilder(); + + /** + * + * + *
+   * Name of the Cloud Build Custom Worker Pool that should be used to build the
+   * function. The format of this field is
+   * `projects/{project}/locations/{region}/workerPools/{workerPool}` where
+   * {project} and {region} are the project id and region respectively where the
+   * worker pool is defined and {workerPool} is the short name of the worker
+   * pool.
+   * If the project id is not the same as the function, then the Cloud
+   * Functions Service Agent
+   * (service-<project_number>@gcf-admin-robot.iam.gserviceaccount.com) must be
+   * granted the role Cloud Build Custom Workers Builder
+   * (roles/cloudbuild.customworkers.builder) in the project.
+   * 
+ * + * string worker_pool = 5 [(.google.api.resource_reference) = { ... } + * + * @return The workerPool. + */ + java.lang.String getWorkerPool(); + /** + * + * + *
+   * Name of the Cloud Build Custom Worker Pool that should be used to build the
+   * function. The format of this field is
+   * `projects/{project}/locations/{region}/workerPools/{workerPool}` where
+   * {project} and {region} are the project id and region respectively where the
+   * worker pool is defined and {workerPool} is the short name of the worker
+   * pool.
+   * If the project id is not the same as the function, then the Cloud
+   * Functions Service Agent
+   * (service-<project_number>@gcf-admin-robot.iam.gserviceaccount.com) must be
+   * granted the role Cloud Build Custom Workers Builder
+   * (roles/cloudbuild.customworkers.builder) in the project.
+   * 
+ * + * string worker_pool = 5 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for workerPool. + */ + com.google.protobuf.ByteString getWorkerPoolBytes(); + + /** + * + * + *
+   * User-provided build-time environment variables for the function
+   * 
+ * + * map<string, string> environment_variables = 6; + */ + int getEnvironmentVariablesCount(); + /** + * + * + *
+   * User-provided build-time environment variables for the function
+   * 
+ * + * map<string, string> environment_variables = 6; + */ + boolean containsEnvironmentVariables(java.lang.String key); + /** Use {@link #getEnvironmentVariablesMap()} instead. */ + @java.lang.Deprecated + java.util.Map getEnvironmentVariables(); + /** + * + * + *
+   * User-provided build-time environment variables for the function
+   * 
+ * + * map<string, string> environment_variables = 6; + */ + java.util.Map getEnvironmentVariablesMap(); + /** + * + * + *
+   * User-provided build-time environment variables for the function
+   * 
+ * + * map<string, string> environment_variables = 6; + */ + + /* nullable */ + java.lang.String getEnvironmentVariablesOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * User-provided build-time environment variables for the function
+   * 
+ * + * map<string, string> environment_variables = 6; + */ + java.lang.String getEnvironmentVariablesOrThrow(java.lang.String key); + + /** + * + * + *
+   * Optional. User managed repository created in Artifact Registry optionally with a
+   * customer managed encryption key. This is the repository to which the
+   * function docker image will be pushed after it is built by Cloud Build.
+   * If unspecified, GCF will create and use a repository named 'gcf-artifacts'
+   * for every deployed region.
+   * It must match the pattern
+   * `projects/{project}/locations/{location}/repositories/{repository}`.
+   * Cross-project repositories are not supported.
+   * Cross-location repositories are not supported.
+   * Repository format must be 'DOCKER'.
+   * 
+ * + * + * string docker_repository = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The dockerRepository. + */ + java.lang.String getDockerRepository(); + /** + * + * + *
+   * Optional. User managed repository created in Artifact Registry optionally with a
+   * customer managed encryption key. This is the repository to which the
+   * function docker image will be pushed after it is built by Cloud Build.
+   * If unspecified, GCF will create and use a repository named 'gcf-artifacts'
+   * for every deployed region.
+   * It must match the pattern
+   * `projects/{project}/locations/{location}/repositories/{repository}`.
+   * Cross-project repositories are not supported.
+   * Cross-location repositories are not supported.
+   * Repository format must be 'DOCKER'.
+   * 
+ * + * + * string docker_repository = 7 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for dockerRepository. + */ + com.google.protobuf.ByteString getDockerRepositoryBytes(); +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/CreateFunctionRequest.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/CreateFunctionRequest.java new file mode 100644 index 00000000..81761723 --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/CreateFunctionRequest.java @@ -0,0 +1,1161 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +/** + * + * + *
+ * Request for the `CreateFunction` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.CreateFunctionRequest} + */ +public final class CreateFunctionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2beta.CreateFunctionRequest) + CreateFunctionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateFunctionRequest.newBuilder() to construct. + private CreateFunctionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateFunctionRequest() { + parent_ = ""; + functionId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateFunctionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateFunctionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + com.google.cloud.functions.v2beta.Function.Builder subBuilder = null; + if (function_ != null) { + subBuilder = function_.toBuilder(); + } + function_ = + input.readMessage( + com.google.cloud.functions.v2beta.Function.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(function_); + function_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + functionId_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_CreateFunctionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_CreateFunctionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.CreateFunctionRequest.class, + com.google.cloud.functions.v2beta.CreateFunctionRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The project and location in which the function should be created, specified
+   * in the format `projects/*/locations/*`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The project and location in which the function should be created, specified
+   * in the format `projects/*/locations/*`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FUNCTION_FIELD_NUMBER = 2; + private com.google.cloud.functions.v2beta.Function function_; + /** + * + * + *
+   * Required. Function to be created.
+   * 
+ * + * + * .google.cloud.functions.v2beta.Function function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the function field is set. + */ + @java.lang.Override + public boolean hasFunction() { + return function_ != null; + } + /** + * + * + *
+   * Required. Function to be created.
+   * 
+ * + * + * .google.cloud.functions.v2beta.Function function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The function. + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.Function getFunction() { + return function_ == null + ? com.google.cloud.functions.v2beta.Function.getDefaultInstance() + : function_; + } + /** + * + * + *
+   * Required. Function to be created.
+   * 
+ * + * + * .google.cloud.functions.v2beta.Function function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.FunctionOrBuilder getFunctionOrBuilder() { + return getFunction(); + } + + public static final int FUNCTION_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object functionId_; + /** + * + * + *
+   * The ID to use for the function, which will become the final component of
+   * the function's resource name.
+   * This value should be 4-63 characters, and valid characters
+   * are /[a-z][0-9]-/.
+   * 
+ * + * string function_id = 3; + * + * @return The functionId. + */ + @java.lang.Override + public java.lang.String getFunctionId() { + java.lang.Object ref = functionId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + functionId_ = s; + return s; + } + } + /** + * + * + *
+   * The ID to use for the function, which will become the final component of
+   * the function's resource name.
+   * This value should be 4-63 characters, and valid characters
+   * are /[a-z][0-9]-/.
+   * 
+ * + * string function_id = 3; + * + * @return The bytes for functionId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFunctionIdBytes() { + java.lang.Object ref = functionId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + functionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (function_ != null) { + output.writeMessage(2, getFunction()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(functionId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, functionId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (function_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getFunction()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(functionId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, functionId_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2beta.CreateFunctionRequest)) { + return super.equals(obj); + } + com.google.cloud.functions.v2beta.CreateFunctionRequest other = + (com.google.cloud.functions.v2beta.CreateFunctionRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasFunction() != other.hasFunction()) return false; + if (hasFunction()) { + if (!getFunction().equals(other.getFunction())) return false; + } + if (!getFunctionId().equals(other.getFunctionId())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasFunction()) { + hash = (37 * hash) + FUNCTION_FIELD_NUMBER; + hash = (53 * hash) + getFunction().hashCode(); + } + hash = (37 * hash) + FUNCTION_ID_FIELD_NUMBER; + hash = (53 * hash) + getFunctionId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2beta.CreateFunctionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.CreateFunctionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.CreateFunctionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.CreateFunctionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.CreateFunctionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.CreateFunctionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.CreateFunctionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.CreateFunctionRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.CreateFunctionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.CreateFunctionRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.CreateFunctionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.CreateFunctionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.functions.v2beta.CreateFunctionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the `CreateFunction` method.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.CreateFunctionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2beta.CreateFunctionRequest) + com.google.cloud.functions.v2beta.CreateFunctionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_CreateFunctionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_CreateFunctionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.CreateFunctionRequest.class, + com.google.cloud.functions.v2beta.CreateFunctionRequest.Builder.class); + } + + // Construct using com.google.cloud.functions.v2beta.CreateFunctionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + if (functionBuilder_ == null) { + function_ = null; + } else { + function_ = null; + functionBuilder_ = null; + } + functionId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_CreateFunctionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.CreateFunctionRequest getDefaultInstanceForType() { + return com.google.cloud.functions.v2beta.CreateFunctionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.CreateFunctionRequest build() { + com.google.cloud.functions.v2beta.CreateFunctionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.CreateFunctionRequest buildPartial() { + com.google.cloud.functions.v2beta.CreateFunctionRequest result = + new com.google.cloud.functions.v2beta.CreateFunctionRequest(this); + result.parent_ = parent_; + if (functionBuilder_ == null) { + result.function_ = function_; + } else { + result.function_ = functionBuilder_.build(); + } + result.functionId_ = functionId_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2beta.CreateFunctionRequest) { + return mergeFrom((com.google.cloud.functions.v2beta.CreateFunctionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2beta.CreateFunctionRequest other) { + if (other == com.google.cloud.functions.v2beta.CreateFunctionRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasFunction()) { + mergeFunction(other.getFunction()); + } + if (!other.getFunctionId().isEmpty()) { + functionId_ = other.functionId_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2beta.CreateFunctionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2beta.CreateFunctionRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The project and location in which the function should be created, specified
+     * in the format `projects/*/locations/*`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The project and location in which the function should be created, specified
+     * in the format `projects/*/locations/*`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The project and location in which the function should be created, specified
+     * in the format `projects/*/locations/*`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The project and location in which the function should be created, specified
+     * in the format `projects/*/locations/*`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The project and location in which the function should be created, specified
+     * in the format `projects/*/locations/*`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private com.google.cloud.functions.v2beta.Function function_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2beta.Function, + com.google.cloud.functions.v2beta.Function.Builder, + com.google.cloud.functions.v2beta.FunctionOrBuilder> + functionBuilder_; + /** + * + * + *
+     * Required. Function to be created.
+     * 
+ * + * + * .google.cloud.functions.v2beta.Function function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the function field is set. + */ + public boolean hasFunction() { + return functionBuilder_ != null || function_ != null; + } + /** + * + * + *
+     * Required. Function to be created.
+     * 
+ * + * + * .google.cloud.functions.v2beta.Function function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The function. + */ + public com.google.cloud.functions.v2beta.Function getFunction() { + if (functionBuilder_ == null) { + return function_ == null + ? com.google.cloud.functions.v2beta.Function.getDefaultInstance() + : function_; + } else { + return functionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Function to be created.
+     * 
+ * + * + * .google.cloud.functions.v2beta.Function function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setFunction(com.google.cloud.functions.v2beta.Function value) { + if (functionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + function_ = value; + onChanged(); + } else { + functionBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Function to be created.
+     * 
+ * + * + * .google.cloud.functions.v2beta.Function function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setFunction(com.google.cloud.functions.v2beta.Function.Builder builderForValue) { + if (functionBuilder_ == null) { + function_ = builderForValue.build(); + onChanged(); + } else { + functionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Function to be created.
+     * 
+ * + * + * .google.cloud.functions.v2beta.Function function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeFunction(com.google.cloud.functions.v2beta.Function value) { + if (functionBuilder_ == null) { + if (function_ != null) { + function_ = + com.google.cloud.functions.v2beta.Function.newBuilder(function_) + .mergeFrom(value) + .buildPartial(); + } else { + function_ = value; + } + onChanged(); + } else { + functionBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Function to be created.
+     * 
+ * + * + * .google.cloud.functions.v2beta.Function function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearFunction() { + if (functionBuilder_ == null) { + function_ = null; + onChanged(); + } else { + function_ = null; + functionBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Function to be created.
+     * 
+ * + * + * .google.cloud.functions.v2beta.Function function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.functions.v2beta.Function.Builder getFunctionBuilder() { + + onChanged(); + return getFunctionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Function to be created.
+     * 
+ * + * + * .google.cloud.functions.v2beta.Function function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.functions.v2beta.FunctionOrBuilder getFunctionOrBuilder() { + if (functionBuilder_ != null) { + return functionBuilder_.getMessageOrBuilder(); + } else { + return function_ == null + ? com.google.cloud.functions.v2beta.Function.getDefaultInstance() + : function_; + } + } + /** + * + * + *
+     * Required. Function to be created.
+     * 
+ * + * + * .google.cloud.functions.v2beta.Function function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2beta.Function, + com.google.cloud.functions.v2beta.Function.Builder, + com.google.cloud.functions.v2beta.FunctionOrBuilder> + getFunctionFieldBuilder() { + if (functionBuilder_ == null) { + functionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2beta.Function, + com.google.cloud.functions.v2beta.Function.Builder, + com.google.cloud.functions.v2beta.FunctionOrBuilder>( + getFunction(), getParentForChildren(), isClean()); + function_ = null; + } + return functionBuilder_; + } + + private java.lang.Object functionId_ = ""; + /** + * + * + *
+     * The ID to use for the function, which will become the final component of
+     * the function's resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-/.
+     * 
+ * + * string function_id = 3; + * + * @return The functionId. + */ + public java.lang.String getFunctionId() { + java.lang.Object ref = functionId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + functionId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The ID to use for the function, which will become the final component of
+     * the function's resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-/.
+     * 
+ * + * string function_id = 3; + * + * @return The bytes for functionId. + */ + public com.google.protobuf.ByteString getFunctionIdBytes() { + java.lang.Object ref = functionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + functionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The ID to use for the function, which will become the final component of
+     * the function's resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-/.
+     * 
+ * + * string function_id = 3; + * + * @param value The functionId to set. + * @return This builder for chaining. + */ + public Builder setFunctionId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + functionId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The ID to use for the function, which will become the final component of
+     * the function's resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-/.
+     * 
+ * + * string function_id = 3; + * + * @return This builder for chaining. + */ + public Builder clearFunctionId() { + + functionId_ = getDefaultInstance().getFunctionId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The ID to use for the function, which will become the final component of
+     * the function's resource name.
+     * This value should be 4-63 characters, and valid characters
+     * are /[a-z][0-9]-/.
+     * 
+ * + * string function_id = 3; + * + * @param value The bytes for functionId to set. + * @return This builder for chaining. + */ + public Builder setFunctionIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + functionId_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2beta.CreateFunctionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2beta.CreateFunctionRequest) + private static final com.google.cloud.functions.v2beta.CreateFunctionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2beta.CreateFunctionRequest(); + } + + public static com.google.cloud.functions.v2beta.CreateFunctionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateFunctionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateFunctionRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.CreateFunctionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/CreateFunctionRequestOrBuilder.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/CreateFunctionRequestOrBuilder.java new file mode 100644 index 00000000..165baa6b --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/CreateFunctionRequestOrBuilder.java @@ -0,0 +1,128 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +public interface CreateFunctionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2beta.CreateFunctionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The project and location in which the function should be created, specified
+   * in the format `projects/*/locations/*`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The project and location in which the function should be created, specified
+   * in the format `projects/*/locations/*`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. Function to be created.
+   * 
+ * + * + * .google.cloud.functions.v2beta.Function function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the function field is set. + */ + boolean hasFunction(); + /** + * + * + *
+   * Required. Function to be created.
+   * 
+ * + * + * .google.cloud.functions.v2beta.Function function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The function. + */ + com.google.cloud.functions.v2beta.Function getFunction(); + /** + * + * + *
+   * Required. Function to be created.
+   * 
+ * + * + * .google.cloud.functions.v2beta.Function function = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.functions.v2beta.FunctionOrBuilder getFunctionOrBuilder(); + + /** + * + * + *
+   * The ID to use for the function, which will become the final component of
+   * the function's resource name.
+   * This value should be 4-63 characters, and valid characters
+   * are /[a-z][0-9]-/.
+   * 
+ * + * string function_id = 3; + * + * @return The functionId. + */ + java.lang.String getFunctionId(); + /** + * + * + *
+   * The ID to use for the function, which will become the final component of
+   * the function's resource name.
+   * This value should be 4-63 characters, and valid characters
+   * are /[a-z][0-9]-/.
+   * 
+ * + * string function_id = 3; + * + * @return The bytes for functionId. + */ + com.google.protobuf.ByteString getFunctionIdBytes(); +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/DeleteFunctionRequest.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/DeleteFunctionRequest.java new file mode 100644 index 00000000..f0e5948b --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/DeleteFunctionRequest.java @@ -0,0 +1,653 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +/** + * + * + *
+ * Request for the `DeleteFunction` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.DeleteFunctionRequest} + */ +public final class DeleteFunctionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2beta.DeleteFunctionRequest) + DeleteFunctionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteFunctionRequest.newBuilder() to construct. + private DeleteFunctionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteFunctionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteFunctionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteFunctionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_DeleteFunctionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_DeleteFunctionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.DeleteFunctionRequest.class, + com.google.cloud.functions.v2beta.DeleteFunctionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the function which should be deleted.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the function which should be deleted.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2beta.DeleteFunctionRequest)) { + return super.equals(obj); + } + com.google.cloud.functions.v2beta.DeleteFunctionRequest other = + (com.google.cloud.functions.v2beta.DeleteFunctionRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2beta.DeleteFunctionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.DeleteFunctionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.DeleteFunctionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.DeleteFunctionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.DeleteFunctionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.DeleteFunctionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.DeleteFunctionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.DeleteFunctionRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.DeleteFunctionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.DeleteFunctionRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.DeleteFunctionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.DeleteFunctionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.functions.v2beta.DeleteFunctionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the `DeleteFunction` method.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.DeleteFunctionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2beta.DeleteFunctionRequest) + com.google.cloud.functions.v2beta.DeleteFunctionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_DeleteFunctionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_DeleteFunctionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.DeleteFunctionRequest.class, + com.google.cloud.functions.v2beta.DeleteFunctionRequest.Builder.class); + } + + // Construct using com.google.cloud.functions.v2beta.DeleteFunctionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_DeleteFunctionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.DeleteFunctionRequest getDefaultInstanceForType() { + return com.google.cloud.functions.v2beta.DeleteFunctionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.DeleteFunctionRequest build() { + com.google.cloud.functions.v2beta.DeleteFunctionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.DeleteFunctionRequest buildPartial() { + com.google.cloud.functions.v2beta.DeleteFunctionRequest result = + new com.google.cloud.functions.v2beta.DeleteFunctionRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2beta.DeleteFunctionRequest) { + return mergeFrom((com.google.cloud.functions.v2beta.DeleteFunctionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2beta.DeleteFunctionRequest other) { + if (other == com.google.cloud.functions.v2beta.DeleteFunctionRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2beta.DeleteFunctionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2beta.DeleteFunctionRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the function which should be deleted.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the function which should be deleted.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the function which should be deleted.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the function which should be deleted.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the function which should be deleted.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2beta.DeleteFunctionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2beta.DeleteFunctionRequest) + private static final com.google.cloud.functions.v2beta.DeleteFunctionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2beta.DeleteFunctionRequest(); + } + + public static com.google.cloud.functions.v2beta.DeleteFunctionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteFunctionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteFunctionRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.DeleteFunctionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/DeleteFunctionRequestOrBuilder.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/DeleteFunctionRequestOrBuilder.java new file mode 100644 index 00000000..1c465e85 --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/DeleteFunctionRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +public interface DeleteFunctionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2beta.DeleteFunctionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the function which should be deleted.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the function which should be deleted.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/Environment.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/Environment.java new file mode 100644 index 00000000..98e27688 --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/Environment.java @@ -0,0 +1,176 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +/** + * + * + *
+ * The environment the function is hosted on.
+ * 
+ * + * Protobuf enum {@code google.cloud.functions.v2beta.Environment} + */ +public enum Environment implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Unspecified
+   * 
+ * + * ENVIRONMENT_UNSPECIFIED = 0; + */ + ENVIRONMENT_UNSPECIFIED(0), + /** + * + * + *
+   * Gen 1
+   * 
+ * + * GEN_1 = 1; + */ + GEN_1(1), + /** + * + * + *
+   * Gen 2
+   * 
+ * + * GEN_2 = 2; + */ + GEN_2(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Unspecified
+   * 
+ * + * ENVIRONMENT_UNSPECIFIED = 0; + */ + public static final int ENVIRONMENT_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Gen 1
+   * 
+ * + * GEN_1 = 1; + */ + public static final int GEN_1_VALUE = 1; + /** + * + * + *
+   * Gen 2
+   * 
+ * + * GEN_2 = 2; + */ + public static final int GEN_2_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Environment valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Environment forNumber(int value) { + switch (value) { + case 0: + return ENVIRONMENT_UNSPECIFIED; + case 1: + return GEN_1; + case 2: + return GEN_2; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Environment findValueByNumber(int number) { + return Environment.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto.getDescriptor().getEnumTypes().get(0); + } + + private static final Environment[] VALUES = values(); + + public static Environment valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Environment(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.functions.v2beta.Environment) +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/EventFilter.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/EventFilter.java new file mode 100644 index 00000000..ba3b631e --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/EventFilter.java @@ -0,0 +1,1015 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +/** + * + * + *
+ * Filters events based on exact matches on the CloudEvents attributes.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.EventFilter} + */ +public final class EventFilter extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2beta.EventFilter) + EventFilterOrBuilder { + private static final long serialVersionUID = 0L; + // Use EventFilter.newBuilder() to construct. + private EventFilter(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EventFilter() { + attribute_ = ""; + value_ = ""; + operator_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EventFilter(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private EventFilter( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + attribute_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + value_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + operator_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_EventFilter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_EventFilter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.EventFilter.class, + com.google.cloud.functions.v2beta.EventFilter.Builder.class); + } + + public static final int ATTRIBUTE_FIELD_NUMBER = 1; + private volatile java.lang.Object attribute_; + /** + * + * + *
+   * Required. The name of a CloudEvents attribute.
+   * 
+ * + * string attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The attribute. + */ + @java.lang.Override + public java.lang.String getAttribute() { + java.lang.Object ref = attribute_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + attribute_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of a CloudEvents attribute.
+   * 
+ * + * string attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for attribute. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAttributeBytes() { + java.lang.Object ref = attribute_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attribute_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUE_FIELD_NUMBER = 2; + private volatile java.lang.Object value_; + /** + * + * + *
+   * Required. The value for the attribute.
+   * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The value. + */ + @java.lang.Override + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The value for the attribute.
+   * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OPERATOR_FIELD_NUMBER = 3; + private volatile java.lang.Object operator_; + /** + * + * + *
+   * Optional. The operator used for matching the events with the value of the
+   * filter. If not specified, only events that have an exact key-value pair
+   * specified in the filter are matched. The only allowed value is
+   * `match-path-pattern`.
+   * 
+ * + * string operator = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The operator. + */ + @java.lang.Override + public java.lang.String getOperator() { + java.lang.Object ref = operator_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + operator_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The operator used for matching the events with the value of the
+   * filter. If not specified, only events that have an exact key-value pair
+   * specified in the filter are matched. The only allowed value is
+   * `match-path-pattern`.
+   * 
+ * + * string operator = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for operator. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOperatorBytes() { + java.lang.Object ref = operator_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + operator_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attribute_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, attribute_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(value_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, value_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(operator_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, operator_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attribute_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, attribute_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(value_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, value_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(operator_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, operator_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2beta.EventFilter)) { + return super.equals(obj); + } + com.google.cloud.functions.v2beta.EventFilter other = + (com.google.cloud.functions.v2beta.EventFilter) obj; + + if (!getAttribute().equals(other.getAttribute())) return false; + if (!getValue().equals(other.getValue())) return false; + if (!getOperator().equals(other.getOperator())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ATTRIBUTE_FIELD_NUMBER; + hash = (53 * hash) + getAttribute().hashCode(); + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + hash = (37 * hash) + OPERATOR_FIELD_NUMBER; + hash = (53 * hash) + getOperator().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2beta.EventFilter parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.EventFilter parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.EventFilter parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.EventFilter parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.EventFilter parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.EventFilter parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.EventFilter parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.EventFilter parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.EventFilter parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.EventFilter parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.EventFilter parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.EventFilter parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v2beta.EventFilter prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Filters events based on exact matches on the CloudEvents attributes.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.EventFilter} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2beta.EventFilter) + com.google.cloud.functions.v2beta.EventFilterOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_EventFilter_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_EventFilter_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.EventFilter.class, + com.google.cloud.functions.v2beta.EventFilter.Builder.class); + } + + // Construct using com.google.cloud.functions.v2beta.EventFilter.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + attribute_ = ""; + + value_ = ""; + + operator_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_EventFilter_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.EventFilter getDefaultInstanceForType() { + return com.google.cloud.functions.v2beta.EventFilter.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.EventFilter build() { + com.google.cloud.functions.v2beta.EventFilter result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.EventFilter buildPartial() { + com.google.cloud.functions.v2beta.EventFilter result = + new com.google.cloud.functions.v2beta.EventFilter(this); + result.attribute_ = attribute_; + result.value_ = value_; + result.operator_ = operator_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2beta.EventFilter) { + return mergeFrom((com.google.cloud.functions.v2beta.EventFilter) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2beta.EventFilter other) { + if (other == com.google.cloud.functions.v2beta.EventFilter.getDefaultInstance()) return this; + if (!other.getAttribute().isEmpty()) { + attribute_ = other.attribute_; + onChanged(); + } + if (!other.getValue().isEmpty()) { + value_ = other.value_; + onChanged(); + } + if (!other.getOperator().isEmpty()) { + operator_ = other.operator_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2beta.EventFilter parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v2beta.EventFilter) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object attribute_ = ""; + /** + * + * + *
+     * Required. The name of a CloudEvents attribute.
+     * 
+ * + * string attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The attribute. + */ + public java.lang.String getAttribute() { + java.lang.Object ref = attribute_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + attribute_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of a CloudEvents attribute.
+     * 
+ * + * string attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for attribute. + */ + public com.google.protobuf.ByteString getAttributeBytes() { + java.lang.Object ref = attribute_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attribute_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of a CloudEvents attribute.
+     * 
+ * + * string attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The attribute to set. + * @return This builder for chaining. + */ + public Builder setAttribute(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + attribute_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of a CloudEvents attribute.
+     * 
+ * + * string attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearAttribute() { + + attribute_ = getDefaultInstance().getAttribute(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of a CloudEvents attribute.
+     * 
+ * + * string attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for attribute to set. + * @return This builder for chaining. + */ + public Builder setAttributeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + attribute_ = value; + onChanged(); + return this; + } + + private java.lang.Object value_ = ""; + /** + * + * + *
+     * Required. The value for the attribute.
+     * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The value. + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The value for the attribute.
+     * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for value. + */ + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The value for the attribute.
+     * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + value_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The value for the attribute.
+     * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + + value_ = getDefaultInstance().getValue(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The value for the attribute.
+     * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for value to set. + * @return This builder for chaining. + */ + public Builder setValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + value_ = value; + onChanged(); + return this; + } + + private java.lang.Object operator_ = ""; + /** + * + * + *
+     * Optional. The operator used for matching the events with the value of the
+     * filter. If not specified, only events that have an exact key-value pair
+     * specified in the filter are matched. The only allowed value is
+     * `match-path-pattern`.
+     * 
+ * + * string operator = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The operator. + */ + public java.lang.String getOperator() { + java.lang.Object ref = operator_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + operator_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The operator used for matching the events with the value of the
+     * filter. If not specified, only events that have an exact key-value pair
+     * specified in the filter are matched. The only allowed value is
+     * `match-path-pattern`.
+     * 
+ * + * string operator = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for operator. + */ + public com.google.protobuf.ByteString getOperatorBytes() { + java.lang.Object ref = operator_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + operator_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The operator used for matching the events with the value of the
+     * filter. If not specified, only events that have an exact key-value pair
+     * specified in the filter are matched. The only allowed value is
+     * `match-path-pattern`.
+     * 
+ * + * string operator = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The operator to set. + * @return This builder for chaining. + */ + public Builder setOperator(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + operator_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The operator used for matching the events with the value of the
+     * filter. If not specified, only events that have an exact key-value pair
+     * specified in the filter are matched. The only allowed value is
+     * `match-path-pattern`.
+     * 
+ * + * string operator = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearOperator() { + + operator_ = getDefaultInstance().getOperator(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The operator used for matching the events with the value of the
+     * filter. If not specified, only events that have an exact key-value pair
+     * specified in the filter are matched. The only allowed value is
+     * `match-path-pattern`.
+     * 
+ * + * string operator = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for operator to set. + * @return This builder for chaining. + */ + public Builder setOperatorBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + operator_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2beta.EventFilter) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2beta.EventFilter) + private static final com.google.cloud.functions.v2beta.EventFilter DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2beta.EventFilter(); + } + + public static com.google.cloud.functions.v2beta.EventFilter getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EventFilter parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EventFilter(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.EventFilter getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/EventFilterOrBuilder.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/EventFilterOrBuilder.java new file mode 100644 index 00000000..3ce1de81 --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/EventFilterOrBuilder.java @@ -0,0 +1,106 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +public interface EventFilterOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2beta.EventFilter) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of a CloudEvents attribute.
+   * 
+ * + * string attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The attribute. + */ + java.lang.String getAttribute(); + /** + * + * + *
+   * Required. The name of a CloudEvents attribute.
+   * 
+ * + * string attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for attribute. + */ + com.google.protobuf.ByteString getAttributeBytes(); + + /** + * + * + *
+   * Required. The value for the attribute.
+   * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The value. + */ + java.lang.String getValue(); + /** + * + * + *
+   * Required. The value for the attribute.
+   * 
+ * + * string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for value. + */ + com.google.protobuf.ByteString getValueBytes(); + + /** + * + * + *
+   * Optional. The operator used for matching the events with the value of the
+   * filter. If not specified, only events that have an exact key-value pair
+   * specified in the filter are matched. The only allowed value is
+   * `match-path-pattern`.
+   * 
+ * + * string operator = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The operator. + */ + java.lang.String getOperator(); + /** + * + * + *
+   * Optional. The operator used for matching the events with the value of the
+   * filter. If not specified, only events that have an exact key-value pair
+   * specified in the filter are matched. The only allowed value is
+   * `match-path-pattern`.
+   * 
+ * + * string operator = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for operator. + */ + com.google.protobuf.ByteString getOperatorBytes(); +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/EventTrigger.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/EventTrigger.java new file mode 100644 index 00000000..d699c52d --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/EventTrigger.java @@ -0,0 +1,2524 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +/** + * + * + *
+ * Describes EventTrigger, used to request events to be sent from another
+ * service.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.EventTrigger} + */ +public final class EventTrigger extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2beta.EventTrigger) + EventTriggerOrBuilder { + private static final long serialVersionUID = 0L; + // Use EventTrigger.newBuilder() to construct. + private EventTrigger(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EventTrigger() { + trigger_ = ""; + triggerRegion_ = ""; + eventType_ = ""; + eventFilters_ = java.util.Collections.emptyList(); + pubsubTopic_ = ""; + serviceAccountEmail_ = ""; + retryPolicy_ = 0; + channel_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EventTrigger(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private EventTrigger( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + trigger_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + triggerRegion_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + eventType_ = s; + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + eventFilters_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + eventFilters_.add( + input.readMessage( + com.google.cloud.functions.v2beta.EventFilter.parser(), extensionRegistry)); + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + pubsubTopic_ = s; + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + serviceAccountEmail_ = s; + break; + } + case 56: + { + int rawValue = input.readEnum(); + + retryPolicy_ = rawValue; + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + + channel_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + eventFilters_ = java.util.Collections.unmodifiableList(eventFilters_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_EventTrigger_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_EventTrigger_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.EventTrigger.class, + com.google.cloud.functions.v2beta.EventTrigger.Builder.class); + } + + /** + * + * + *
+   * Describes the retry policy in case of function's execution failure.
+   * Retried execution is charged as any other execution.
+   * 
+ * + * Protobuf enum {@code google.cloud.functions.v2beta.EventTrigger.RetryPolicy} + */ + public enum RetryPolicy implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not specified.
+     * 
+ * + * RETRY_POLICY_UNSPECIFIED = 0; + */ + RETRY_POLICY_UNSPECIFIED(0), + /** + * + * + *
+     * Do not retry.
+     * 
+ * + * RETRY_POLICY_DO_NOT_RETRY = 1; + */ + RETRY_POLICY_DO_NOT_RETRY(1), + /** + * + * + *
+     * Retry on any failure, retry up to 7 days with an exponential backoff
+     * (capped at 10 seconds).
+     * 
+ * + * RETRY_POLICY_RETRY = 2; + */ + RETRY_POLICY_RETRY(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not specified.
+     * 
+ * + * RETRY_POLICY_UNSPECIFIED = 0; + */ + public static final int RETRY_POLICY_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Do not retry.
+     * 
+ * + * RETRY_POLICY_DO_NOT_RETRY = 1; + */ + public static final int RETRY_POLICY_DO_NOT_RETRY_VALUE = 1; + /** + * + * + *
+     * Retry on any failure, retry up to 7 days with an exponential backoff
+     * (capped at 10 seconds).
+     * 
+ * + * RETRY_POLICY_RETRY = 2; + */ + public static final int RETRY_POLICY_RETRY_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static RetryPolicy valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static RetryPolicy forNumber(int value) { + switch (value) { + case 0: + return RETRY_POLICY_UNSPECIFIED; + case 1: + return RETRY_POLICY_DO_NOT_RETRY; + case 2: + return RETRY_POLICY_RETRY; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public RetryPolicy findValueByNumber(int number) { + return RetryPolicy.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.functions.v2beta.EventTrigger.getDescriptor().getEnumTypes().get(0); + } + + private static final RetryPolicy[] VALUES = values(); + + public static RetryPolicy valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private RetryPolicy(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.functions.v2beta.EventTrigger.RetryPolicy) + } + + public static final int TRIGGER_FIELD_NUMBER = 1; + private volatile java.lang.Object trigger_; + /** + * + * + *
+   * Output only. The resource name of the Eventarc trigger. The format of this field is
+   * `projects/{project}/locations/{region}/triggers/{trigger}`.
+   * 
+ * + * + * string trigger = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The trigger. + */ + @java.lang.Override + public java.lang.String getTrigger() { + java.lang.Object ref = trigger_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + trigger_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The resource name of the Eventarc trigger. The format of this field is
+   * `projects/{project}/locations/{region}/triggers/{trigger}`.
+   * 
+ * + * + * string trigger = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for trigger. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTriggerBytes() { + java.lang.Object ref = trigger_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + trigger_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TRIGGER_REGION_FIELD_NUMBER = 2; + private volatile java.lang.Object triggerRegion_; + /** + * + * + *
+   * The region that the trigger will be in. The trigger will only receive
+   * events originating in this region. It can be the same
+   * region as the function, a different region or multi-region, or the global
+   * region. If not provided, defaults to the same region as the function.
+   * 
+ * + * string trigger_region = 2; + * + * @return The triggerRegion. + */ + @java.lang.Override + public java.lang.String getTriggerRegion() { + java.lang.Object ref = triggerRegion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + triggerRegion_ = s; + return s; + } + } + /** + * + * + *
+   * The region that the trigger will be in. The trigger will only receive
+   * events originating in this region. It can be the same
+   * region as the function, a different region or multi-region, or the global
+   * region. If not provided, defaults to the same region as the function.
+   * 
+ * + * string trigger_region = 2; + * + * @return The bytes for triggerRegion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTriggerRegionBytes() { + java.lang.Object ref = triggerRegion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + triggerRegion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EVENT_TYPE_FIELD_NUMBER = 3; + private volatile java.lang.Object eventType_; + /** + * + * + *
+   * Required. The type of event to observe. For example:
+   * `google.cloud.audit.log.v1.written` or
+   * `google.cloud.pubsub.topic.v1.messagePublished`.
+   * 
+ * + * string event_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The eventType. + */ + @java.lang.Override + public java.lang.String getEventType() { + java.lang.Object ref = eventType_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + eventType_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The type of event to observe. For example:
+   * `google.cloud.audit.log.v1.written` or
+   * `google.cloud.pubsub.topic.v1.messagePublished`.
+   * 
+ * + * string event_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for eventType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEventTypeBytes() { + java.lang.Object ref = eventType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + eventType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EVENT_FILTERS_FIELD_NUMBER = 4; + private java.util.List eventFilters_; + /** + * + * + *
+   * Criteria used to filter events.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.EventFilter event_filters = 4; + */ + @java.lang.Override + public java.util.List getEventFiltersList() { + return eventFilters_; + } + /** + * + * + *
+   * Criteria used to filter events.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.EventFilter event_filters = 4; + */ + @java.lang.Override + public java.util.List + getEventFiltersOrBuilderList() { + return eventFilters_; + } + /** + * + * + *
+   * Criteria used to filter events.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.EventFilter event_filters = 4; + */ + @java.lang.Override + public int getEventFiltersCount() { + return eventFilters_.size(); + } + /** + * + * + *
+   * Criteria used to filter events.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.EventFilter event_filters = 4; + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.EventFilter getEventFilters(int index) { + return eventFilters_.get(index); + } + /** + * + * + *
+   * Criteria used to filter events.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.EventFilter event_filters = 4; + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.EventFilterOrBuilder getEventFiltersOrBuilder( + int index) { + return eventFilters_.get(index); + } + + public static final int PUBSUB_TOPIC_FIELD_NUMBER = 5; + private volatile java.lang.Object pubsubTopic_; + /** + * + * + *
+   * Optional. The name of a Pub/Sub topic in the same project that will be used
+   * as the transport topic for the event delivery. Format:
+   * `projects/{project}/topics/{topic}`.
+   * This is only valid for events of type
+   * `google.cloud.pubsub.topic.v1.messagePublished`. The topic provided here
+   * will not be deleted at function deletion.
+   * 
+ * + * + * string pubsub_topic = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The pubsubTopic. + */ + @java.lang.Override + public java.lang.String getPubsubTopic() { + java.lang.Object ref = pubsubTopic_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pubsubTopic_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The name of a Pub/Sub topic in the same project that will be used
+   * as the transport topic for the event delivery. Format:
+   * `projects/{project}/topics/{topic}`.
+   * This is only valid for events of type
+   * `google.cloud.pubsub.topic.v1.messagePublished`. The topic provided here
+   * will not be deleted at function deletion.
+   * 
+ * + * + * string pubsub_topic = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for pubsubTopic. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPubsubTopicBytes() { + java.lang.Object ref = pubsubTopic_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pubsubTopic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVICE_ACCOUNT_EMAIL_FIELD_NUMBER = 6; + private volatile java.lang.Object serviceAccountEmail_; + /** + * + * + *
+   * Optional. The email of the trigger's service account. The service account must have
+   * permission to invoke Cloud Run services, the permission is
+   * `run.routes.invoke`.
+   * If empty, defaults to the Compute Engine default service account:
+   * `{project_number}-compute@developer.gserviceaccount.com`.
+   * 
+ * + * string service_account_email = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The serviceAccountEmail. + */ + @java.lang.Override + public java.lang.String getServiceAccountEmail() { + java.lang.Object ref = serviceAccountEmail_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAccountEmail_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The email of the trigger's service account. The service account must have
+   * permission to invoke Cloud Run services, the permission is
+   * `run.routes.invoke`.
+   * If empty, defaults to the Compute Engine default service account:
+   * `{project_number}-compute@developer.gserviceaccount.com`.
+   * 
+ * + * string service_account_email = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for serviceAccountEmail. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceAccountEmailBytes() { + java.lang.Object ref = serviceAccountEmail_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAccountEmail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RETRY_POLICY_FIELD_NUMBER = 7; + private int retryPolicy_; + /** + * + * + *
+   * Optional. If unset, then defaults to ignoring failures (i.e. not retrying them).
+   * 
+ * + * + * .google.cloud.functions.v2beta.EventTrigger.RetryPolicy retry_policy = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for retryPolicy. + */ + @java.lang.Override + public int getRetryPolicyValue() { + return retryPolicy_; + } + /** + * + * + *
+   * Optional. If unset, then defaults to ignoring failures (i.e. not retrying them).
+   * 
+ * + * + * .google.cloud.functions.v2beta.EventTrigger.RetryPolicy retry_policy = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The retryPolicy. + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.EventTrigger.RetryPolicy getRetryPolicy() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2beta.EventTrigger.RetryPolicy result = + com.google.cloud.functions.v2beta.EventTrigger.RetryPolicy.valueOf(retryPolicy_); + return result == null + ? com.google.cloud.functions.v2beta.EventTrigger.RetryPolicy.UNRECOGNIZED + : result; + } + + public static final int CHANNEL_FIELD_NUMBER = 8; + private volatile java.lang.Object channel_; + /** + * + * + *
+   * Optional. The name of the channel associated with the trigger in
+   * `projects/{project}/locations/{location}/channels/{channel}` format.
+   * You must provide a channel to receive events from Eventarc SaaS partners.
+   * 
+ * + * + * string channel = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The channel. + */ + @java.lang.Override + public java.lang.String getChannel() { + java.lang.Object ref = channel_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + channel_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The name of the channel associated with the trigger in
+   * `projects/{project}/locations/{location}/channels/{channel}` format.
+   * You must provide a channel to receive events from Eventarc SaaS partners.
+   * 
+ * + * + * string channel = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for channel. + */ + @java.lang.Override + public com.google.protobuf.ByteString getChannelBytes() { + java.lang.Object ref = channel_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + channel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(trigger_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, trigger_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(triggerRegion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, triggerRegion_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(eventType_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, eventType_); + } + for (int i = 0; i < eventFilters_.size(); i++) { + output.writeMessage(4, eventFilters_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pubsubTopic_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, pubsubTopic_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccountEmail_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, serviceAccountEmail_); + } + if (retryPolicy_ + != com.google.cloud.functions.v2beta.EventTrigger.RetryPolicy.RETRY_POLICY_UNSPECIFIED + .getNumber()) { + output.writeEnum(7, retryPolicy_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(channel_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, channel_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(trigger_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, trigger_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(triggerRegion_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, triggerRegion_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(eventType_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, eventType_); + } + for (int i = 0; i < eventFilters_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, eventFilters_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pubsubTopic_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, pubsubTopic_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccountEmail_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, serviceAccountEmail_); + } + if (retryPolicy_ + != com.google.cloud.functions.v2beta.EventTrigger.RetryPolicy.RETRY_POLICY_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, retryPolicy_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(channel_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, channel_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2beta.EventTrigger)) { + return super.equals(obj); + } + com.google.cloud.functions.v2beta.EventTrigger other = + (com.google.cloud.functions.v2beta.EventTrigger) obj; + + if (!getTrigger().equals(other.getTrigger())) return false; + if (!getTriggerRegion().equals(other.getTriggerRegion())) return false; + if (!getEventType().equals(other.getEventType())) return false; + if (!getEventFiltersList().equals(other.getEventFiltersList())) return false; + if (!getPubsubTopic().equals(other.getPubsubTopic())) return false; + if (!getServiceAccountEmail().equals(other.getServiceAccountEmail())) return false; + if (retryPolicy_ != other.retryPolicy_) return false; + if (!getChannel().equals(other.getChannel())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TRIGGER_FIELD_NUMBER; + hash = (53 * hash) + getTrigger().hashCode(); + hash = (37 * hash) + TRIGGER_REGION_FIELD_NUMBER; + hash = (53 * hash) + getTriggerRegion().hashCode(); + hash = (37 * hash) + EVENT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getEventType().hashCode(); + if (getEventFiltersCount() > 0) { + hash = (37 * hash) + EVENT_FILTERS_FIELD_NUMBER; + hash = (53 * hash) + getEventFiltersList().hashCode(); + } + hash = (37 * hash) + PUBSUB_TOPIC_FIELD_NUMBER; + hash = (53 * hash) + getPubsubTopic().hashCode(); + hash = (37 * hash) + SERVICE_ACCOUNT_EMAIL_FIELD_NUMBER; + hash = (53 * hash) + getServiceAccountEmail().hashCode(); + hash = (37 * hash) + RETRY_POLICY_FIELD_NUMBER; + hash = (53 * hash) + retryPolicy_; + hash = (37 * hash) + CHANNEL_FIELD_NUMBER; + hash = (53 * hash) + getChannel().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2beta.EventTrigger parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.EventTrigger parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.EventTrigger parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.EventTrigger parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.EventTrigger parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.EventTrigger parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.EventTrigger parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.EventTrigger parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.EventTrigger parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.EventTrigger parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.EventTrigger parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.EventTrigger parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v2beta.EventTrigger prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Describes EventTrigger, used to request events to be sent from another
+   * service.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.EventTrigger} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2beta.EventTrigger) + com.google.cloud.functions.v2beta.EventTriggerOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_EventTrigger_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_EventTrigger_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.EventTrigger.class, + com.google.cloud.functions.v2beta.EventTrigger.Builder.class); + } + + // Construct using com.google.cloud.functions.v2beta.EventTrigger.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getEventFiltersFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + trigger_ = ""; + + triggerRegion_ = ""; + + eventType_ = ""; + + if (eventFiltersBuilder_ == null) { + eventFilters_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + eventFiltersBuilder_.clear(); + } + pubsubTopic_ = ""; + + serviceAccountEmail_ = ""; + + retryPolicy_ = 0; + + channel_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_EventTrigger_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.EventTrigger getDefaultInstanceForType() { + return com.google.cloud.functions.v2beta.EventTrigger.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.EventTrigger build() { + com.google.cloud.functions.v2beta.EventTrigger result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.EventTrigger buildPartial() { + com.google.cloud.functions.v2beta.EventTrigger result = + new com.google.cloud.functions.v2beta.EventTrigger(this); + int from_bitField0_ = bitField0_; + result.trigger_ = trigger_; + result.triggerRegion_ = triggerRegion_; + result.eventType_ = eventType_; + if (eventFiltersBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + eventFilters_ = java.util.Collections.unmodifiableList(eventFilters_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.eventFilters_ = eventFilters_; + } else { + result.eventFilters_ = eventFiltersBuilder_.build(); + } + result.pubsubTopic_ = pubsubTopic_; + result.serviceAccountEmail_ = serviceAccountEmail_; + result.retryPolicy_ = retryPolicy_; + result.channel_ = channel_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2beta.EventTrigger) { + return mergeFrom((com.google.cloud.functions.v2beta.EventTrigger) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2beta.EventTrigger other) { + if (other == com.google.cloud.functions.v2beta.EventTrigger.getDefaultInstance()) return this; + if (!other.getTrigger().isEmpty()) { + trigger_ = other.trigger_; + onChanged(); + } + if (!other.getTriggerRegion().isEmpty()) { + triggerRegion_ = other.triggerRegion_; + onChanged(); + } + if (!other.getEventType().isEmpty()) { + eventType_ = other.eventType_; + onChanged(); + } + if (eventFiltersBuilder_ == null) { + if (!other.eventFilters_.isEmpty()) { + if (eventFilters_.isEmpty()) { + eventFilters_ = other.eventFilters_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureEventFiltersIsMutable(); + eventFilters_.addAll(other.eventFilters_); + } + onChanged(); + } + } else { + if (!other.eventFilters_.isEmpty()) { + if (eventFiltersBuilder_.isEmpty()) { + eventFiltersBuilder_.dispose(); + eventFiltersBuilder_ = null; + eventFilters_ = other.eventFilters_; + bitField0_ = (bitField0_ & ~0x00000001); + eventFiltersBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getEventFiltersFieldBuilder() + : null; + } else { + eventFiltersBuilder_.addAllMessages(other.eventFilters_); + } + } + } + if (!other.getPubsubTopic().isEmpty()) { + pubsubTopic_ = other.pubsubTopic_; + onChanged(); + } + if (!other.getServiceAccountEmail().isEmpty()) { + serviceAccountEmail_ = other.serviceAccountEmail_; + onChanged(); + } + if (other.retryPolicy_ != 0) { + setRetryPolicyValue(other.getRetryPolicyValue()); + } + if (!other.getChannel().isEmpty()) { + channel_ = other.channel_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2beta.EventTrigger parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v2beta.EventTrigger) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object trigger_ = ""; + /** + * + * + *
+     * Output only. The resource name of the Eventarc trigger. The format of this field is
+     * `projects/{project}/locations/{region}/triggers/{trigger}`.
+     * 
+ * + * + * string trigger = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The trigger. + */ + public java.lang.String getTrigger() { + java.lang.Object ref = trigger_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + trigger_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The resource name of the Eventarc trigger. The format of this field is
+     * `projects/{project}/locations/{region}/triggers/{trigger}`.
+     * 
+ * + * + * string trigger = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for trigger. + */ + public com.google.protobuf.ByteString getTriggerBytes() { + java.lang.Object ref = trigger_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + trigger_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The resource name of the Eventarc trigger. The format of this field is
+     * `projects/{project}/locations/{region}/triggers/{trigger}`.
+     * 
+ * + * + * string trigger = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The trigger to set. + * @return This builder for chaining. + */ + public Builder setTrigger(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + trigger_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The resource name of the Eventarc trigger. The format of this field is
+     * `projects/{project}/locations/{region}/triggers/{trigger}`.
+     * 
+ * + * + * string trigger = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearTrigger() { + + trigger_ = getDefaultInstance().getTrigger(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The resource name of the Eventarc trigger. The format of this field is
+     * `projects/{project}/locations/{region}/triggers/{trigger}`.
+     * 
+ * + * + * string trigger = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for trigger to set. + * @return This builder for chaining. + */ + public Builder setTriggerBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + trigger_ = value; + onChanged(); + return this; + } + + private java.lang.Object triggerRegion_ = ""; + /** + * + * + *
+     * The region that the trigger will be in. The trigger will only receive
+     * events originating in this region. It can be the same
+     * region as the function, a different region or multi-region, or the global
+     * region. If not provided, defaults to the same region as the function.
+     * 
+ * + * string trigger_region = 2; + * + * @return The triggerRegion. + */ + public java.lang.String getTriggerRegion() { + java.lang.Object ref = triggerRegion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + triggerRegion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The region that the trigger will be in. The trigger will only receive
+     * events originating in this region. It can be the same
+     * region as the function, a different region or multi-region, or the global
+     * region. If not provided, defaults to the same region as the function.
+     * 
+ * + * string trigger_region = 2; + * + * @return The bytes for triggerRegion. + */ + public com.google.protobuf.ByteString getTriggerRegionBytes() { + java.lang.Object ref = triggerRegion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + triggerRegion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The region that the trigger will be in. The trigger will only receive
+     * events originating in this region. It can be the same
+     * region as the function, a different region or multi-region, or the global
+     * region. If not provided, defaults to the same region as the function.
+     * 
+ * + * string trigger_region = 2; + * + * @param value The triggerRegion to set. + * @return This builder for chaining. + */ + public Builder setTriggerRegion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + triggerRegion_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The region that the trigger will be in. The trigger will only receive
+     * events originating in this region. It can be the same
+     * region as the function, a different region or multi-region, or the global
+     * region. If not provided, defaults to the same region as the function.
+     * 
+ * + * string trigger_region = 2; + * + * @return This builder for chaining. + */ + public Builder clearTriggerRegion() { + + triggerRegion_ = getDefaultInstance().getTriggerRegion(); + onChanged(); + return this; + } + /** + * + * + *
+     * The region that the trigger will be in. The trigger will only receive
+     * events originating in this region. It can be the same
+     * region as the function, a different region or multi-region, or the global
+     * region. If not provided, defaults to the same region as the function.
+     * 
+ * + * string trigger_region = 2; + * + * @param value The bytes for triggerRegion to set. + * @return This builder for chaining. + */ + public Builder setTriggerRegionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + triggerRegion_ = value; + onChanged(); + return this; + } + + private java.lang.Object eventType_ = ""; + /** + * + * + *
+     * Required. The type of event to observe. For example:
+     * `google.cloud.audit.log.v1.written` or
+     * `google.cloud.pubsub.topic.v1.messagePublished`.
+     * 
+ * + * string event_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The eventType. + */ + public java.lang.String getEventType() { + java.lang.Object ref = eventType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + eventType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The type of event to observe. For example:
+     * `google.cloud.audit.log.v1.written` or
+     * `google.cloud.pubsub.topic.v1.messagePublished`.
+     * 
+ * + * string event_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for eventType. + */ + public com.google.protobuf.ByteString getEventTypeBytes() { + java.lang.Object ref = eventType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + eventType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The type of event to observe. For example:
+     * `google.cloud.audit.log.v1.written` or
+     * `google.cloud.pubsub.topic.v1.messagePublished`.
+     * 
+ * + * string event_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The eventType to set. + * @return This builder for chaining. + */ + public Builder setEventType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + eventType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The type of event to observe. For example:
+     * `google.cloud.audit.log.v1.written` or
+     * `google.cloud.pubsub.topic.v1.messagePublished`.
+     * 
+ * + * string event_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearEventType() { + + eventType_ = getDefaultInstance().getEventType(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The type of event to observe. For example:
+     * `google.cloud.audit.log.v1.written` or
+     * `google.cloud.pubsub.topic.v1.messagePublished`.
+     * 
+ * + * string event_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for eventType to set. + * @return This builder for chaining. + */ + public Builder setEventTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + eventType_ = value; + onChanged(); + return this; + } + + private java.util.List eventFilters_ = + java.util.Collections.emptyList(); + + private void ensureEventFiltersIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + eventFilters_ = + new java.util.ArrayList(eventFilters_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2beta.EventFilter, + com.google.cloud.functions.v2beta.EventFilter.Builder, + com.google.cloud.functions.v2beta.EventFilterOrBuilder> + eventFiltersBuilder_; + + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.EventFilter event_filters = 4; + */ + public java.util.List getEventFiltersList() { + if (eventFiltersBuilder_ == null) { + return java.util.Collections.unmodifiableList(eventFilters_); + } else { + return eventFiltersBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.EventFilter event_filters = 4; + */ + public int getEventFiltersCount() { + if (eventFiltersBuilder_ == null) { + return eventFilters_.size(); + } else { + return eventFiltersBuilder_.getCount(); + } + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.EventFilter event_filters = 4; + */ + public com.google.cloud.functions.v2beta.EventFilter getEventFilters(int index) { + if (eventFiltersBuilder_ == null) { + return eventFilters_.get(index); + } else { + return eventFiltersBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.EventFilter event_filters = 4; + */ + public Builder setEventFilters(int index, com.google.cloud.functions.v2beta.EventFilter value) { + if (eventFiltersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventFiltersIsMutable(); + eventFilters_.set(index, value); + onChanged(); + } else { + eventFiltersBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.EventFilter event_filters = 4; + */ + public Builder setEventFilters( + int index, com.google.cloud.functions.v2beta.EventFilter.Builder builderForValue) { + if (eventFiltersBuilder_ == null) { + ensureEventFiltersIsMutable(); + eventFilters_.set(index, builderForValue.build()); + onChanged(); + } else { + eventFiltersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.EventFilter event_filters = 4; + */ + public Builder addEventFilters(com.google.cloud.functions.v2beta.EventFilter value) { + if (eventFiltersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventFiltersIsMutable(); + eventFilters_.add(value); + onChanged(); + } else { + eventFiltersBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.EventFilter event_filters = 4; + */ + public Builder addEventFilters(int index, com.google.cloud.functions.v2beta.EventFilter value) { + if (eventFiltersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventFiltersIsMutable(); + eventFilters_.add(index, value); + onChanged(); + } else { + eventFiltersBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.EventFilter event_filters = 4; + */ + public Builder addEventFilters( + com.google.cloud.functions.v2beta.EventFilter.Builder builderForValue) { + if (eventFiltersBuilder_ == null) { + ensureEventFiltersIsMutable(); + eventFilters_.add(builderForValue.build()); + onChanged(); + } else { + eventFiltersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.EventFilter event_filters = 4; + */ + public Builder addEventFilters( + int index, com.google.cloud.functions.v2beta.EventFilter.Builder builderForValue) { + if (eventFiltersBuilder_ == null) { + ensureEventFiltersIsMutable(); + eventFilters_.add(index, builderForValue.build()); + onChanged(); + } else { + eventFiltersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.EventFilter event_filters = 4; + */ + public Builder addAllEventFilters( + java.lang.Iterable values) { + if (eventFiltersBuilder_ == null) { + ensureEventFiltersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, eventFilters_); + onChanged(); + } else { + eventFiltersBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.EventFilter event_filters = 4; + */ + public Builder clearEventFilters() { + if (eventFiltersBuilder_ == null) { + eventFilters_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + eventFiltersBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.EventFilter event_filters = 4; + */ + public Builder removeEventFilters(int index) { + if (eventFiltersBuilder_ == null) { + ensureEventFiltersIsMutable(); + eventFilters_.remove(index); + onChanged(); + } else { + eventFiltersBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.EventFilter event_filters = 4; + */ + public com.google.cloud.functions.v2beta.EventFilter.Builder getEventFiltersBuilder(int index) { + return getEventFiltersFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.EventFilter event_filters = 4; + */ + public com.google.cloud.functions.v2beta.EventFilterOrBuilder getEventFiltersOrBuilder( + int index) { + if (eventFiltersBuilder_ == null) { + return eventFilters_.get(index); + } else { + return eventFiltersBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.EventFilter event_filters = 4; + */ + public java.util.List + getEventFiltersOrBuilderList() { + if (eventFiltersBuilder_ != null) { + return eventFiltersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(eventFilters_); + } + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.EventFilter event_filters = 4; + */ + public com.google.cloud.functions.v2beta.EventFilter.Builder addEventFiltersBuilder() { + return getEventFiltersFieldBuilder() + .addBuilder(com.google.cloud.functions.v2beta.EventFilter.getDefaultInstance()); + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.EventFilter event_filters = 4; + */ + public com.google.cloud.functions.v2beta.EventFilter.Builder addEventFiltersBuilder(int index) { + return getEventFiltersFieldBuilder() + .addBuilder(index, com.google.cloud.functions.v2beta.EventFilter.getDefaultInstance()); + } + /** + * + * + *
+     * Criteria used to filter events.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.EventFilter event_filters = 4; + */ + public java.util.List + getEventFiltersBuilderList() { + return getEventFiltersFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2beta.EventFilter, + com.google.cloud.functions.v2beta.EventFilter.Builder, + com.google.cloud.functions.v2beta.EventFilterOrBuilder> + getEventFiltersFieldBuilder() { + if (eventFiltersBuilder_ == null) { + eventFiltersBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2beta.EventFilter, + com.google.cloud.functions.v2beta.EventFilter.Builder, + com.google.cloud.functions.v2beta.EventFilterOrBuilder>( + eventFilters_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + eventFilters_ = null; + } + return eventFiltersBuilder_; + } + + private java.lang.Object pubsubTopic_ = ""; + /** + * + * + *
+     * Optional. The name of a Pub/Sub topic in the same project that will be used
+     * as the transport topic for the event delivery. Format:
+     * `projects/{project}/topics/{topic}`.
+     * This is only valid for events of type
+     * `google.cloud.pubsub.topic.v1.messagePublished`. The topic provided here
+     * will not be deleted at function deletion.
+     * 
+ * + * + * string pubsub_topic = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The pubsubTopic. + */ + public java.lang.String getPubsubTopic() { + java.lang.Object ref = pubsubTopic_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pubsubTopic_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The name of a Pub/Sub topic in the same project that will be used
+     * as the transport topic for the event delivery. Format:
+     * `projects/{project}/topics/{topic}`.
+     * This is only valid for events of type
+     * `google.cloud.pubsub.topic.v1.messagePublished`. The topic provided here
+     * will not be deleted at function deletion.
+     * 
+ * + * + * string pubsub_topic = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for pubsubTopic. + */ + public com.google.protobuf.ByteString getPubsubTopicBytes() { + java.lang.Object ref = pubsubTopic_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pubsubTopic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The name of a Pub/Sub topic in the same project that will be used
+     * as the transport topic for the event delivery. Format:
+     * `projects/{project}/topics/{topic}`.
+     * This is only valid for events of type
+     * `google.cloud.pubsub.topic.v1.messagePublished`. The topic provided here
+     * will not be deleted at function deletion.
+     * 
+ * + * + * string pubsub_topic = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The pubsubTopic to set. + * @return This builder for chaining. + */ + public Builder setPubsubTopic(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pubsubTopic_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The name of a Pub/Sub topic in the same project that will be used
+     * as the transport topic for the event delivery. Format:
+     * `projects/{project}/topics/{topic}`.
+     * This is only valid for events of type
+     * `google.cloud.pubsub.topic.v1.messagePublished`. The topic provided here
+     * will not be deleted at function deletion.
+     * 
+ * + * + * string pubsub_topic = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearPubsubTopic() { + + pubsubTopic_ = getDefaultInstance().getPubsubTopic(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The name of a Pub/Sub topic in the same project that will be used
+     * as the transport topic for the event delivery. Format:
+     * `projects/{project}/topics/{topic}`.
+     * This is only valid for events of type
+     * `google.cloud.pubsub.topic.v1.messagePublished`. The topic provided here
+     * will not be deleted at function deletion.
+     * 
+ * + * + * string pubsub_topic = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for pubsubTopic to set. + * @return This builder for chaining. + */ + public Builder setPubsubTopicBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pubsubTopic_ = value; + onChanged(); + return this; + } + + private java.lang.Object serviceAccountEmail_ = ""; + /** + * + * + *
+     * Optional. The email of the trigger's service account. The service account must have
+     * permission to invoke Cloud Run services, the permission is
+     * `run.routes.invoke`.
+     * If empty, defaults to the Compute Engine default service account:
+     * `{project_number}-compute@developer.gserviceaccount.com`.
+     * 
+ * + * string service_account_email = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The serviceAccountEmail. + */ + public java.lang.String getServiceAccountEmail() { + java.lang.Object ref = serviceAccountEmail_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAccountEmail_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The email of the trigger's service account. The service account must have
+     * permission to invoke Cloud Run services, the permission is
+     * `run.routes.invoke`.
+     * If empty, defaults to the Compute Engine default service account:
+     * `{project_number}-compute@developer.gserviceaccount.com`.
+     * 
+ * + * string service_account_email = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for serviceAccountEmail. + */ + public com.google.protobuf.ByteString getServiceAccountEmailBytes() { + java.lang.Object ref = serviceAccountEmail_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAccountEmail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The email of the trigger's service account. The service account must have
+     * permission to invoke Cloud Run services, the permission is
+     * `run.routes.invoke`.
+     * If empty, defaults to the Compute Engine default service account:
+     * `{project_number}-compute@developer.gserviceaccount.com`.
+     * 
+ * + * string service_account_email = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The serviceAccountEmail to set. + * @return This builder for chaining. + */ + public Builder setServiceAccountEmail(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + serviceAccountEmail_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The email of the trigger's service account. The service account must have
+     * permission to invoke Cloud Run services, the permission is
+     * `run.routes.invoke`.
+     * If empty, defaults to the Compute Engine default service account:
+     * `{project_number}-compute@developer.gserviceaccount.com`.
+     * 
+ * + * string service_account_email = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearServiceAccountEmail() { + + serviceAccountEmail_ = getDefaultInstance().getServiceAccountEmail(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The email of the trigger's service account. The service account must have
+     * permission to invoke Cloud Run services, the permission is
+     * `run.routes.invoke`.
+     * If empty, defaults to the Compute Engine default service account:
+     * `{project_number}-compute@developer.gserviceaccount.com`.
+     * 
+ * + * string service_account_email = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for serviceAccountEmail to set. + * @return This builder for chaining. + */ + public Builder setServiceAccountEmailBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + serviceAccountEmail_ = value; + onChanged(); + return this; + } + + private int retryPolicy_ = 0; + /** + * + * + *
+     * Optional. If unset, then defaults to ignoring failures (i.e. not retrying them).
+     * 
+ * + * + * .google.cloud.functions.v2beta.EventTrigger.RetryPolicy retry_policy = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for retryPolicy. + */ + @java.lang.Override + public int getRetryPolicyValue() { + return retryPolicy_; + } + /** + * + * + *
+     * Optional. If unset, then defaults to ignoring failures (i.e. not retrying them).
+     * 
+ * + * + * .google.cloud.functions.v2beta.EventTrigger.RetryPolicy retry_policy = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for retryPolicy to set. + * @return This builder for chaining. + */ + public Builder setRetryPolicyValue(int value) { + + retryPolicy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If unset, then defaults to ignoring failures (i.e. not retrying them).
+     * 
+ * + * + * .google.cloud.functions.v2beta.EventTrigger.RetryPolicy retry_policy = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The retryPolicy. + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.EventTrigger.RetryPolicy getRetryPolicy() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2beta.EventTrigger.RetryPolicy result = + com.google.cloud.functions.v2beta.EventTrigger.RetryPolicy.valueOf(retryPolicy_); + return result == null + ? com.google.cloud.functions.v2beta.EventTrigger.RetryPolicy.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Optional. If unset, then defaults to ignoring failures (i.e. not retrying them).
+     * 
+ * + * + * .google.cloud.functions.v2beta.EventTrigger.RetryPolicy retry_policy = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The retryPolicy to set. + * @return This builder for chaining. + */ + public Builder setRetryPolicy( + com.google.cloud.functions.v2beta.EventTrigger.RetryPolicy value) { + if (value == null) { + throw new NullPointerException(); + } + + retryPolicy_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If unset, then defaults to ignoring failures (i.e. not retrying them).
+     * 
+ * + * + * .google.cloud.functions.v2beta.EventTrigger.RetryPolicy retry_policy = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearRetryPolicy() { + + retryPolicy_ = 0; + onChanged(); + return this; + } + + private java.lang.Object channel_ = ""; + /** + * + * + *
+     * Optional. The name of the channel associated with the trigger in
+     * `projects/{project}/locations/{location}/channels/{channel}` format.
+     * You must provide a channel to receive events from Eventarc SaaS partners.
+     * 
+ * + * + * string channel = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The channel. + */ + public java.lang.String getChannel() { + java.lang.Object ref = channel_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + channel_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The name of the channel associated with the trigger in
+     * `projects/{project}/locations/{location}/channels/{channel}` format.
+     * You must provide a channel to receive events from Eventarc SaaS partners.
+     * 
+ * + * + * string channel = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for channel. + */ + public com.google.protobuf.ByteString getChannelBytes() { + java.lang.Object ref = channel_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + channel_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The name of the channel associated with the trigger in
+     * `projects/{project}/locations/{location}/channels/{channel}` format.
+     * You must provide a channel to receive events from Eventarc SaaS partners.
+     * 
+ * + * + * string channel = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The channel to set. + * @return This builder for chaining. + */ + public Builder setChannel(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + channel_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The name of the channel associated with the trigger in
+     * `projects/{project}/locations/{location}/channels/{channel}` format.
+     * You must provide a channel to receive events from Eventarc SaaS partners.
+     * 
+ * + * + * string channel = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearChannel() { + + channel_ = getDefaultInstance().getChannel(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The name of the channel associated with the trigger in
+     * `projects/{project}/locations/{location}/channels/{channel}` format.
+     * You must provide a channel to receive events from Eventarc SaaS partners.
+     * 
+ * + * + * string channel = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for channel to set. + * @return This builder for chaining. + */ + public Builder setChannelBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + channel_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2beta.EventTrigger) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2beta.EventTrigger) + private static final com.google.cloud.functions.v2beta.EventTrigger DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2beta.EventTrigger(); + } + + public static com.google.cloud.functions.v2beta.EventTrigger getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EventTrigger parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EventTrigger(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.EventTrigger getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/EventTriggerOrBuilder.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/EventTriggerOrBuilder.java new file mode 100644 index 00000000..93c9551b --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/EventTriggerOrBuilder.java @@ -0,0 +1,302 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +public interface EventTriggerOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2beta.EventTrigger) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The resource name of the Eventarc trigger. The format of this field is
+   * `projects/{project}/locations/{region}/triggers/{trigger}`.
+   * 
+ * + * + * string trigger = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The trigger. + */ + java.lang.String getTrigger(); + /** + * + * + *
+   * Output only. The resource name of the Eventarc trigger. The format of this field is
+   * `projects/{project}/locations/{region}/triggers/{trigger}`.
+   * 
+ * + * + * string trigger = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for trigger. + */ + com.google.protobuf.ByteString getTriggerBytes(); + + /** + * + * + *
+   * The region that the trigger will be in. The trigger will only receive
+   * events originating in this region. It can be the same
+   * region as the function, a different region or multi-region, or the global
+   * region. If not provided, defaults to the same region as the function.
+   * 
+ * + * string trigger_region = 2; + * + * @return The triggerRegion. + */ + java.lang.String getTriggerRegion(); + /** + * + * + *
+   * The region that the trigger will be in. The trigger will only receive
+   * events originating in this region. It can be the same
+   * region as the function, a different region or multi-region, or the global
+   * region. If not provided, defaults to the same region as the function.
+   * 
+ * + * string trigger_region = 2; + * + * @return The bytes for triggerRegion. + */ + com.google.protobuf.ByteString getTriggerRegionBytes(); + + /** + * + * + *
+   * Required. The type of event to observe. For example:
+   * `google.cloud.audit.log.v1.written` or
+   * `google.cloud.pubsub.topic.v1.messagePublished`.
+   * 
+ * + * string event_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The eventType. + */ + java.lang.String getEventType(); + /** + * + * + *
+   * Required. The type of event to observe. For example:
+   * `google.cloud.audit.log.v1.written` or
+   * `google.cloud.pubsub.topic.v1.messagePublished`.
+   * 
+ * + * string event_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for eventType. + */ + com.google.protobuf.ByteString getEventTypeBytes(); + + /** + * + * + *
+   * Criteria used to filter events.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.EventFilter event_filters = 4; + */ + java.util.List getEventFiltersList(); + /** + * + * + *
+   * Criteria used to filter events.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.EventFilter event_filters = 4; + */ + com.google.cloud.functions.v2beta.EventFilter getEventFilters(int index); + /** + * + * + *
+   * Criteria used to filter events.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.EventFilter event_filters = 4; + */ + int getEventFiltersCount(); + /** + * + * + *
+   * Criteria used to filter events.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.EventFilter event_filters = 4; + */ + java.util.List + getEventFiltersOrBuilderList(); + /** + * + * + *
+   * Criteria used to filter events.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.EventFilter event_filters = 4; + */ + com.google.cloud.functions.v2beta.EventFilterOrBuilder getEventFiltersOrBuilder(int index); + + /** + * + * + *
+   * Optional. The name of a Pub/Sub topic in the same project that will be used
+   * as the transport topic for the event delivery. Format:
+   * `projects/{project}/topics/{topic}`.
+   * This is only valid for events of type
+   * `google.cloud.pubsub.topic.v1.messagePublished`. The topic provided here
+   * will not be deleted at function deletion.
+   * 
+ * + * + * string pubsub_topic = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The pubsubTopic. + */ + java.lang.String getPubsubTopic(); + /** + * + * + *
+   * Optional. The name of a Pub/Sub topic in the same project that will be used
+   * as the transport topic for the event delivery. Format:
+   * `projects/{project}/topics/{topic}`.
+   * This is only valid for events of type
+   * `google.cloud.pubsub.topic.v1.messagePublished`. The topic provided here
+   * will not be deleted at function deletion.
+   * 
+ * + * + * string pubsub_topic = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for pubsubTopic. + */ + com.google.protobuf.ByteString getPubsubTopicBytes(); + + /** + * + * + *
+   * Optional. The email of the trigger's service account. The service account must have
+   * permission to invoke Cloud Run services, the permission is
+   * `run.routes.invoke`.
+   * If empty, defaults to the Compute Engine default service account:
+   * `{project_number}-compute@developer.gserviceaccount.com`.
+   * 
+ * + * string service_account_email = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The serviceAccountEmail. + */ + java.lang.String getServiceAccountEmail(); + /** + * + * + *
+   * Optional. The email of the trigger's service account. The service account must have
+   * permission to invoke Cloud Run services, the permission is
+   * `run.routes.invoke`.
+   * If empty, defaults to the Compute Engine default service account:
+   * `{project_number}-compute@developer.gserviceaccount.com`.
+   * 
+ * + * string service_account_email = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for serviceAccountEmail. + */ + com.google.protobuf.ByteString getServiceAccountEmailBytes(); + + /** + * + * + *
+   * Optional. If unset, then defaults to ignoring failures (i.e. not retrying them).
+   * 
+ * + * + * .google.cloud.functions.v2beta.EventTrigger.RetryPolicy retry_policy = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for retryPolicy. + */ + int getRetryPolicyValue(); + /** + * + * + *
+   * Optional. If unset, then defaults to ignoring failures (i.e. not retrying them).
+   * 
+ * + * + * .google.cloud.functions.v2beta.EventTrigger.RetryPolicy retry_policy = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The retryPolicy. + */ + com.google.cloud.functions.v2beta.EventTrigger.RetryPolicy getRetryPolicy(); + + /** + * + * + *
+   * Optional. The name of the channel associated with the trigger in
+   * `projects/{project}/locations/{location}/channels/{channel}` format.
+   * You must provide a channel to receive events from Eventarc SaaS partners.
+   * 
+ * + * + * string channel = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The channel. + */ + java.lang.String getChannel(); + /** + * + * + *
+   * Optional. The name of the channel associated with the trigger in
+   * `projects/{project}/locations/{location}/channels/{channel}` format.
+   * You must provide a channel to receive events from Eventarc SaaS partners.
+   * 
+ * + * + * string channel = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for channel. + */ + com.google.protobuf.ByteString getChannelBytes(); +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/Function.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/Function.java new file mode 100644 index 00000000..9074b95b --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/Function.java @@ -0,0 +1,3401 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +/** + * + * + *
+ * Describes a Cloud Function that contains user computation executed in
+ * response to an event. It encapsulates function and trigger configurations.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.Function} + */ +public final class Function extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2beta.Function) + FunctionOrBuilder { + private static final long serialVersionUID = 0L; + // Use Function.newBuilder() to construct. + private Function(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Function() { + name_ = ""; + environment_ = 0; + description_ = ""; + state_ = 0; + stateMessages_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Function(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Function( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 26: + { + com.google.cloud.functions.v2beta.BuildConfig.Builder subBuilder = null; + if (buildConfig_ != null) { + subBuilder = buildConfig_.toBuilder(); + } + buildConfig_ = + input.readMessage( + com.google.cloud.functions.v2beta.BuildConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(buildConfig_); + buildConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + com.google.cloud.functions.v2beta.ServiceConfig.Builder subBuilder = null; + if (serviceConfig_ != null) { + subBuilder = serviceConfig_.toBuilder(); + } + serviceConfig_ = + input.readMessage( + com.google.cloud.functions.v2beta.ServiceConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(serviceConfig_); + serviceConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + com.google.cloud.functions.v2beta.EventTrigger.Builder subBuilder = null; + if (eventTrigger_ != null) { + subBuilder = eventTrigger_.toBuilder(); + } + eventTrigger_ = + input.readMessage( + com.google.cloud.functions.v2beta.EventTrigger.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(eventTrigger_); + eventTrigger_ = subBuilder.buildPartial(); + } + + break; + } + case 48: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 58: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + case 66: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + case 74: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + stateMessages_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + stateMessages_.add( + input.readMessage( + com.google.cloud.functions.v2beta.StateMessage.parser(), extensionRegistry)); + break; + } + case 80: + { + int rawValue = input.readEnum(); + + environment_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) != 0)) { + stateMessages_ = java.util.Collections.unmodifiableList(stateMessages_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_Function_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 8: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_Function_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.Function.class, + com.google.cloud.functions.v2beta.Function.Builder.class); + } + + /** + * + * + *
+   * Describes the current state of the function.
+   * 
+ * + * Protobuf enum {@code google.cloud.functions.v2beta.Function.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not specified. Invalid state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Function has been successfully deployed and is serving.
+     * 
+ * + * ACTIVE = 1; + */ + ACTIVE(1), + /** + * + * + *
+     * Function deployment failed and the function is not serving.
+     * 
+ * + * FAILED = 2; + */ + FAILED(2), + /** + * + * + *
+     * Function is being created or updated.
+     * 
+ * + * DEPLOYING = 3; + */ + DEPLOYING(3), + /** + * + * + *
+     * Function is being deleted.
+     * 
+ * + * DELETING = 4; + */ + DELETING(4), + /** + * + * + *
+     * Function deployment failed and the function serving state is undefined.
+     * The function should be updated or deleted to move it out of this state.
+     * 
+ * + * UNKNOWN = 5; + */ + UNKNOWN(5), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not specified. Invalid state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Function has been successfully deployed and is serving.
+     * 
+ * + * ACTIVE = 1; + */ + public static final int ACTIVE_VALUE = 1; + /** + * + * + *
+     * Function deployment failed and the function is not serving.
+     * 
+ * + * FAILED = 2; + */ + public static final int FAILED_VALUE = 2; + /** + * + * + *
+     * Function is being created or updated.
+     * 
+ * + * DEPLOYING = 3; + */ + public static final int DEPLOYING_VALUE = 3; + /** + * + * + *
+     * Function is being deleted.
+     * 
+ * + * DELETING = 4; + */ + public static final int DELETING_VALUE = 4; + /** + * + * + *
+     * Function deployment failed and the function serving state is undefined.
+     * The function should be updated or deleted to move it out of this state.
+     * 
+ * + * UNKNOWN = 5; + */ + public static final int UNKNOWN_VALUE = 5; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static State valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 1: + return ACTIVE; + case 2: + return FAILED; + case 3: + return DEPLOYING; + case 4: + return DELETING; + case 5: + return UNKNOWN; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.functions.v2beta.Function.getDescriptor().getEnumTypes().get(0); + } + + private static final State[] VALUES = values(); + + public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.functions.v2beta.Function.State) + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * A user-defined name of the function. Function names must be unique
+   * globally and match pattern `projects/*/locations/*/functions/*`
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * A user-defined name of the function. Function names must be unique
+   * globally and match pattern `projects/*/locations/*/functions/*`
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENVIRONMENT_FIELD_NUMBER = 10; + private int environment_; + /** + * + * + *
+   * Describe whether the function is gen1 or gen2.
+   * 
+ * + * .google.cloud.functions.v2beta.Environment environment = 10; + * + * @return The enum numeric value on the wire for environment. + */ + @java.lang.Override + public int getEnvironmentValue() { + return environment_; + } + /** + * + * + *
+   * Describe whether the function is gen1 or gen2.
+   * 
+ * + * .google.cloud.functions.v2beta.Environment environment = 10; + * + * @return The environment. + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.Environment getEnvironment() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2beta.Environment result = + com.google.cloud.functions.v2beta.Environment.valueOf(environment_); + return result == null ? com.google.cloud.functions.v2beta.Environment.UNRECOGNIZED : result; + } + + public static final int DESCRIPTION_FIELD_NUMBER = 2; + private volatile java.lang.Object description_; + /** + * + * + *
+   * User-provided description of a function.
+   * 
+ * + * string description = 2; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + * + * + *
+   * User-provided description of a function.
+   * 
+ * + * string description = 2; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BUILD_CONFIG_FIELD_NUMBER = 3; + private com.google.cloud.functions.v2beta.BuildConfig buildConfig_; + /** + * + * + *
+   * Describes the Build step of the function that builds a container from the
+   * given source.
+   * 
+ * + * .google.cloud.functions.v2beta.BuildConfig build_config = 3; + * + * @return Whether the buildConfig field is set. + */ + @java.lang.Override + public boolean hasBuildConfig() { + return buildConfig_ != null; + } + /** + * + * + *
+   * Describes the Build step of the function that builds a container from the
+   * given source.
+   * 
+ * + * .google.cloud.functions.v2beta.BuildConfig build_config = 3; + * + * @return The buildConfig. + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.BuildConfig getBuildConfig() { + return buildConfig_ == null + ? com.google.cloud.functions.v2beta.BuildConfig.getDefaultInstance() + : buildConfig_; + } + /** + * + * + *
+   * Describes the Build step of the function that builds a container from the
+   * given source.
+   * 
+ * + * .google.cloud.functions.v2beta.BuildConfig build_config = 3; + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.BuildConfigOrBuilder getBuildConfigOrBuilder() { + return getBuildConfig(); + } + + public static final int SERVICE_CONFIG_FIELD_NUMBER = 4; + private com.google.cloud.functions.v2beta.ServiceConfig serviceConfig_; + /** + * + * + *
+   * Describes the Service being deployed. Currently deploys services to Cloud
+   * Run (fully managed).
+   * 
+ * + * .google.cloud.functions.v2beta.ServiceConfig service_config = 4; + * + * @return Whether the serviceConfig field is set. + */ + @java.lang.Override + public boolean hasServiceConfig() { + return serviceConfig_ != null; + } + /** + * + * + *
+   * Describes the Service being deployed. Currently deploys services to Cloud
+   * Run (fully managed).
+   * 
+ * + * .google.cloud.functions.v2beta.ServiceConfig service_config = 4; + * + * @return The serviceConfig. + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.ServiceConfig getServiceConfig() { + return serviceConfig_ == null + ? com.google.cloud.functions.v2beta.ServiceConfig.getDefaultInstance() + : serviceConfig_; + } + /** + * + * + *
+   * Describes the Service being deployed. Currently deploys services to Cloud
+   * Run (fully managed).
+   * 
+ * + * .google.cloud.functions.v2beta.ServiceConfig service_config = 4; + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.ServiceConfigOrBuilder getServiceConfigOrBuilder() { + return getServiceConfig(); + } + + public static final int EVENT_TRIGGER_FIELD_NUMBER = 5; + private com.google.cloud.functions.v2beta.EventTrigger eventTrigger_; + /** + * + * + *
+   * An Eventarc trigger managed by Google Cloud Functions that fires events in
+   * response to a condition in another service.
+   * 
+ * + * .google.cloud.functions.v2beta.EventTrigger event_trigger = 5; + * + * @return Whether the eventTrigger field is set. + */ + @java.lang.Override + public boolean hasEventTrigger() { + return eventTrigger_ != null; + } + /** + * + * + *
+   * An Eventarc trigger managed by Google Cloud Functions that fires events in
+   * response to a condition in another service.
+   * 
+ * + * .google.cloud.functions.v2beta.EventTrigger event_trigger = 5; + * + * @return The eventTrigger. + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.EventTrigger getEventTrigger() { + return eventTrigger_ == null + ? com.google.cloud.functions.v2beta.EventTrigger.getDefaultInstance() + : eventTrigger_; + } + /** + * + * + *
+   * An Eventarc trigger managed by Google Cloud Functions that fires events in
+   * response to a condition in another service.
+   * 
+ * + * .google.cloud.functions.v2beta.EventTrigger event_trigger = 5; + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.EventTriggerOrBuilder getEventTriggerOrBuilder() { + return getEventTrigger(); + } + + public static final int STATE_FIELD_NUMBER = 6; + private int state_; + /** + * + * + *
+   * Output only. State of the function.
+   * 
+ * + * + * .google.cloud.functions.v2beta.Function.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Output only. State of the function.
+   * 
+ * + * + * .google.cloud.functions.v2beta.Function.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.Function.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2beta.Function.State result = + com.google.cloud.functions.v2beta.Function.State.valueOf(state_); + return result == null ? com.google.cloud.functions.v2beta.Function.State.UNRECOGNIZED : result; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 7; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The last update timestamp of a Cloud Function.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. The last update timestamp of a Cloud Function.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. The last update timestamp of a Cloud Function.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int LABELS_FIELD_NUMBER = 8; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_Function_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Labels associated with this Cloud Function.
+   * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Labels associated with this Cloud Function.
+   * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Labels associated with this Cloud Function.
+   * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Labels associated with this Cloud Function.
+   * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int STATE_MESSAGES_FIELD_NUMBER = 9; + private java.util.List stateMessages_; + /** + * + * + *
+   * Output only. State Messages for this Cloud Function.
+   * 
+ * + * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getStateMessagesList() { + return stateMessages_; + } + /** + * + * + *
+   * Output only. State Messages for this Cloud Function.
+   * 
+ * + * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getStateMessagesOrBuilderList() { + return stateMessages_; + } + /** + * + * + *
+   * Output only. State Messages for this Cloud Function.
+   * 
+ * + * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getStateMessagesCount() { + return stateMessages_.size(); + } + /** + * + * + *
+   * Output only. State Messages for this Cloud Function.
+   * 
+ * + * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.StateMessage getStateMessages(int index) { + return stateMessages_.get(index); + } + /** + * + * + *
+   * Output only. State Messages for this Cloud Function.
+   * 
+ * + * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.StateMessageOrBuilder getStateMessagesOrBuilder( + int index) { + return stateMessages_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + } + if (buildConfig_ != null) { + output.writeMessage(3, getBuildConfig()); + } + if (serviceConfig_ != null) { + output.writeMessage(4, getServiceConfig()); + } + if (eventTrigger_ != null) { + output.writeMessage(5, getEventTrigger()); + } + if (state_ != com.google.cloud.functions.v2beta.Function.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(6, state_); + } + if (updateTime_ != null) { + output.writeMessage(7, getUpdateTime()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 8); + for (int i = 0; i < stateMessages_.size(); i++) { + output.writeMessage(9, stateMessages_.get(i)); + } + if (environment_ + != com.google.cloud.functions.v2beta.Environment.ENVIRONMENT_UNSPECIFIED.getNumber()) { + output.writeEnum(10, environment_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + } + if (buildConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getBuildConfig()); + } + if (serviceConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getServiceConfig()); + } + if (eventTrigger_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getEventTrigger()); + } + if (state_ != com.google.cloud.functions.v2beta.Function.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, state_); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getUpdateTime()); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, labels__); + } + for (int i = 0; i < stateMessages_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, stateMessages_.get(i)); + } + if (environment_ + != com.google.cloud.functions.v2beta.Environment.ENVIRONMENT_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(10, environment_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2beta.Function)) { + return super.equals(obj); + } + com.google.cloud.functions.v2beta.Function other = + (com.google.cloud.functions.v2beta.Function) obj; + + if (!getName().equals(other.getName())) return false; + if (environment_ != other.environment_) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (hasBuildConfig() != other.hasBuildConfig()) return false; + if (hasBuildConfig()) { + if (!getBuildConfig().equals(other.getBuildConfig())) return false; + } + if (hasServiceConfig() != other.hasServiceConfig()) return false; + if (hasServiceConfig()) { + if (!getServiceConfig().equals(other.getServiceConfig())) return false; + } + if (hasEventTrigger() != other.hasEventTrigger()) return false; + if (hasEventTrigger()) { + if (!getEventTrigger().equals(other.getEventTrigger())) return false; + } + if (state_ != other.state_) return false; + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (!getStateMessagesList().equals(other.getStateMessagesList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + ENVIRONMENT_FIELD_NUMBER; + hash = (53 * hash) + environment_; + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (hasBuildConfig()) { + hash = (37 * hash) + BUILD_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getBuildConfig().hashCode(); + } + if (hasServiceConfig()) { + hash = (37 * hash) + SERVICE_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getServiceConfig().hashCode(); + } + if (hasEventTrigger()) { + hash = (37 * hash) + EVENT_TRIGGER_FIELD_NUMBER; + hash = (53 * hash) + getEventTrigger().hashCode(); + } + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + if (getStateMessagesCount() > 0) { + hash = (37 * hash) + STATE_MESSAGES_FIELD_NUMBER; + hash = (53 * hash) + getStateMessagesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2beta.Function parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.Function parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.Function parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.Function parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.Function parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.Function parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.Function parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.Function parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.Function parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.Function parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.Function parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.Function parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v2beta.Function prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Describes a Cloud Function that contains user computation executed in
+   * response to an event. It encapsulates function and trigger configurations.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.Function} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2beta.Function) + com.google.cloud.functions.v2beta.FunctionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_Function_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 8: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 8: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_Function_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.Function.class, + com.google.cloud.functions.v2beta.Function.Builder.class); + } + + // Construct using com.google.cloud.functions.v2beta.Function.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getStateMessagesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + environment_ = 0; + + description_ = ""; + + if (buildConfigBuilder_ == null) { + buildConfig_ = null; + } else { + buildConfig_ = null; + buildConfigBuilder_ = null; + } + if (serviceConfigBuilder_ == null) { + serviceConfig_ = null; + } else { + serviceConfig_ = null; + serviceConfigBuilder_ = null; + } + if (eventTriggerBuilder_ == null) { + eventTrigger_ = null; + } else { + eventTrigger_ = null; + eventTriggerBuilder_ = null; + } + state_ = 0; + + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + internalGetMutableLabels().clear(); + if (stateMessagesBuilder_ == null) { + stateMessages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + stateMessagesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_Function_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.Function getDefaultInstanceForType() { + return com.google.cloud.functions.v2beta.Function.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.Function build() { + com.google.cloud.functions.v2beta.Function result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.Function buildPartial() { + com.google.cloud.functions.v2beta.Function result = + new com.google.cloud.functions.v2beta.Function(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.environment_ = environment_; + result.description_ = description_; + if (buildConfigBuilder_ == null) { + result.buildConfig_ = buildConfig_; + } else { + result.buildConfig_ = buildConfigBuilder_.build(); + } + if (serviceConfigBuilder_ == null) { + result.serviceConfig_ = serviceConfig_; + } else { + result.serviceConfig_ = serviceConfigBuilder_.build(); + } + if (eventTriggerBuilder_ == null) { + result.eventTrigger_ = eventTrigger_; + } else { + result.eventTrigger_ = eventTriggerBuilder_.build(); + } + result.state_ = state_; + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + if (stateMessagesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + stateMessages_ = java.util.Collections.unmodifiableList(stateMessages_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.stateMessages_ = stateMessages_; + } else { + result.stateMessages_ = stateMessagesBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2beta.Function) { + return mergeFrom((com.google.cloud.functions.v2beta.Function) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2beta.Function other) { + if (other == com.google.cloud.functions.v2beta.Function.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.environment_ != 0) { + setEnvironmentValue(other.getEnvironmentValue()); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (other.hasBuildConfig()) { + mergeBuildConfig(other.getBuildConfig()); + } + if (other.hasServiceConfig()) { + mergeServiceConfig(other.getServiceConfig()); + } + if (other.hasEventTrigger()) { + mergeEventTrigger(other.getEventTrigger()); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + if (stateMessagesBuilder_ == null) { + if (!other.stateMessages_.isEmpty()) { + if (stateMessages_.isEmpty()) { + stateMessages_ = other.stateMessages_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureStateMessagesIsMutable(); + stateMessages_.addAll(other.stateMessages_); + } + onChanged(); + } + } else { + if (!other.stateMessages_.isEmpty()) { + if (stateMessagesBuilder_.isEmpty()) { + stateMessagesBuilder_.dispose(); + stateMessagesBuilder_ = null; + stateMessages_ = other.stateMessages_; + bitField0_ = (bitField0_ & ~0x00000002); + stateMessagesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getStateMessagesFieldBuilder() + : null; + } else { + stateMessagesBuilder_.addAllMessages(other.stateMessages_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2beta.Function parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v2beta.Function) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * A user-defined name of the function. Function names must be unique
+     * globally and match pattern `projects/*/locations/*/functions/*`
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A user-defined name of the function. Function names must be unique
+     * globally and match pattern `projects/*/locations/*/functions/*`
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A user-defined name of the function. Function names must be unique
+     * globally and match pattern `projects/*/locations/*/functions/*`
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A user-defined name of the function. Function names must be unique
+     * globally and match pattern `projects/*/locations/*/functions/*`
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * A user-defined name of the function. Function names must be unique
+     * globally and match pattern `projects/*/locations/*/functions/*`
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private int environment_ = 0; + /** + * + * + *
+     * Describe whether the function is gen1 or gen2.
+     * 
+ * + * .google.cloud.functions.v2beta.Environment environment = 10; + * + * @return The enum numeric value on the wire for environment. + */ + @java.lang.Override + public int getEnvironmentValue() { + return environment_; + } + /** + * + * + *
+     * Describe whether the function is gen1 or gen2.
+     * 
+ * + * .google.cloud.functions.v2beta.Environment environment = 10; + * + * @param value The enum numeric value on the wire for environment to set. + * @return This builder for chaining. + */ + public Builder setEnvironmentValue(int value) { + + environment_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Describe whether the function is gen1 or gen2.
+     * 
+ * + * .google.cloud.functions.v2beta.Environment environment = 10; + * + * @return The environment. + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.Environment getEnvironment() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2beta.Environment result = + com.google.cloud.functions.v2beta.Environment.valueOf(environment_); + return result == null ? com.google.cloud.functions.v2beta.Environment.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Describe whether the function is gen1 or gen2.
+     * 
+ * + * .google.cloud.functions.v2beta.Environment environment = 10; + * + * @param value The environment to set. + * @return This builder for chaining. + */ + public Builder setEnvironment(com.google.cloud.functions.v2beta.Environment value) { + if (value == null) { + throw new NullPointerException(); + } + + environment_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Describe whether the function is gen1 or gen2.
+     * 
+ * + * .google.cloud.functions.v2beta.Environment environment = 10; + * + * @return This builder for chaining. + */ + public Builder clearEnvironment() { + + environment_ = 0; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * User-provided description of a function.
+     * 
+ * + * string description = 2; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * User-provided description of a function.
+     * 
+ * + * string description = 2; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * User-provided description of a function.
+     * 
+ * + * string description = 2; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * User-provided description of a function.
+     * 
+ * + * string description = 2; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * User-provided description of a function.
+     * 
+ * + * string description = 2; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private com.google.cloud.functions.v2beta.BuildConfig buildConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2beta.BuildConfig, + com.google.cloud.functions.v2beta.BuildConfig.Builder, + com.google.cloud.functions.v2beta.BuildConfigOrBuilder> + buildConfigBuilder_; + /** + * + * + *
+     * Describes the Build step of the function that builds a container from the
+     * given source.
+     * 
+ * + * .google.cloud.functions.v2beta.BuildConfig build_config = 3; + * + * @return Whether the buildConfig field is set. + */ + public boolean hasBuildConfig() { + return buildConfigBuilder_ != null || buildConfig_ != null; + } + /** + * + * + *
+     * Describes the Build step of the function that builds a container from the
+     * given source.
+     * 
+ * + * .google.cloud.functions.v2beta.BuildConfig build_config = 3; + * + * @return The buildConfig. + */ + public com.google.cloud.functions.v2beta.BuildConfig getBuildConfig() { + if (buildConfigBuilder_ == null) { + return buildConfig_ == null + ? com.google.cloud.functions.v2beta.BuildConfig.getDefaultInstance() + : buildConfig_; + } else { + return buildConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Describes the Build step of the function that builds a container from the
+     * given source.
+     * 
+ * + * .google.cloud.functions.v2beta.BuildConfig build_config = 3; + */ + public Builder setBuildConfig(com.google.cloud.functions.v2beta.BuildConfig value) { + if (buildConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + buildConfig_ = value; + onChanged(); + } else { + buildConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Describes the Build step of the function that builds a container from the
+     * given source.
+     * 
+ * + * .google.cloud.functions.v2beta.BuildConfig build_config = 3; + */ + public Builder setBuildConfig( + com.google.cloud.functions.v2beta.BuildConfig.Builder builderForValue) { + if (buildConfigBuilder_ == null) { + buildConfig_ = builderForValue.build(); + onChanged(); + } else { + buildConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Describes the Build step of the function that builds a container from the
+     * given source.
+     * 
+ * + * .google.cloud.functions.v2beta.BuildConfig build_config = 3; + */ + public Builder mergeBuildConfig(com.google.cloud.functions.v2beta.BuildConfig value) { + if (buildConfigBuilder_ == null) { + if (buildConfig_ != null) { + buildConfig_ = + com.google.cloud.functions.v2beta.BuildConfig.newBuilder(buildConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + buildConfig_ = value; + } + onChanged(); + } else { + buildConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Describes the Build step of the function that builds a container from the
+     * given source.
+     * 
+ * + * .google.cloud.functions.v2beta.BuildConfig build_config = 3; + */ + public Builder clearBuildConfig() { + if (buildConfigBuilder_ == null) { + buildConfig_ = null; + onChanged(); + } else { + buildConfig_ = null; + buildConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Describes the Build step of the function that builds a container from the
+     * given source.
+     * 
+ * + * .google.cloud.functions.v2beta.BuildConfig build_config = 3; + */ + public com.google.cloud.functions.v2beta.BuildConfig.Builder getBuildConfigBuilder() { + + onChanged(); + return getBuildConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Describes the Build step of the function that builds a container from the
+     * given source.
+     * 
+ * + * .google.cloud.functions.v2beta.BuildConfig build_config = 3; + */ + public com.google.cloud.functions.v2beta.BuildConfigOrBuilder getBuildConfigOrBuilder() { + if (buildConfigBuilder_ != null) { + return buildConfigBuilder_.getMessageOrBuilder(); + } else { + return buildConfig_ == null + ? com.google.cloud.functions.v2beta.BuildConfig.getDefaultInstance() + : buildConfig_; + } + } + /** + * + * + *
+     * Describes the Build step of the function that builds a container from the
+     * given source.
+     * 
+ * + * .google.cloud.functions.v2beta.BuildConfig build_config = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2beta.BuildConfig, + com.google.cloud.functions.v2beta.BuildConfig.Builder, + com.google.cloud.functions.v2beta.BuildConfigOrBuilder> + getBuildConfigFieldBuilder() { + if (buildConfigBuilder_ == null) { + buildConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2beta.BuildConfig, + com.google.cloud.functions.v2beta.BuildConfig.Builder, + com.google.cloud.functions.v2beta.BuildConfigOrBuilder>( + getBuildConfig(), getParentForChildren(), isClean()); + buildConfig_ = null; + } + return buildConfigBuilder_; + } + + private com.google.cloud.functions.v2beta.ServiceConfig serviceConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2beta.ServiceConfig, + com.google.cloud.functions.v2beta.ServiceConfig.Builder, + com.google.cloud.functions.v2beta.ServiceConfigOrBuilder> + serviceConfigBuilder_; + /** + * + * + *
+     * Describes the Service being deployed. Currently deploys services to Cloud
+     * Run (fully managed).
+     * 
+ * + * .google.cloud.functions.v2beta.ServiceConfig service_config = 4; + * + * @return Whether the serviceConfig field is set. + */ + public boolean hasServiceConfig() { + return serviceConfigBuilder_ != null || serviceConfig_ != null; + } + /** + * + * + *
+     * Describes the Service being deployed. Currently deploys services to Cloud
+     * Run (fully managed).
+     * 
+ * + * .google.cloud.functions.v2beta.ServiceConfig service_config = 4; + * + * @return The serviceConfig. + */ + public com.google.cloud.functions.v2beta.ServiceConfig getServiceConfig() { + if (serviceConfigBuilder_ == null) { + return serviceConfig_ == null + ? com.google.cloud.functions.v2beta.ServiceConfig.getDefaultInstance() + : serviceConfig_; + } else { + return serviceConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Describes the Service being deployed. Currently deploys services to Cloud
+     * Run (fully managed).
+     * 
+ * + * .google.cloud.functions.v2beta.ServiceConfig service_config = 4; + */ + public Builder setServiceConfig(com.google.cloud.functions.v2beta.ServiceConfig value) { + if (serviceConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + serviceConfig_ = value; + onChanged(); + } else { + serviceConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Describes the Service being deployed. Currently deploys services to Cloud
+     * Run (fully managed).
+     * 
+ * + * .google.cloud.functions.v2beta.ServiceConfig service_config = 4; + */ + public Builder setServiceConfig( + com.google.cloud.functions.v2beta.ServiceConfig.Builder builderForValue) { + if (serviceConfigBuilder_ == null) { + serviceConfig_ = builderForValue.build(); + onChanged(); + } else { + serviceConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Describes the Service being deployed. Currently deploys services to Cloud
+     * Run (fully managed).
+     * 
+ * + * .google.cloud.functions.v2beta.ServiceConfig service_config = 4; + */ + public Builder mergeServiceConfig(com.google.cloud.functions.v2beta.ServiceConfig value) { + if (serviceConfigBuilder_ == null) { + if (serviceConfig_ != null) { + serviceConfig_ = + com.google.cloud.functions.v2beta.ServiceConfig.newBuilder(serviceConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + serviceConfig_ = value; + } + onChanged(); + } else { + serviceConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Describes the Service being deployed. Currently deploys services to Cloud
+     * Run (fully managed).
+     * 
+ * + * .google.cloud.functions.v2beta.ServiceConfig service_config = 4; + */ + public Builder clearServiceConfig() { + if (serviceConfigBuilder_ == null) { + serviceConfig_ = null; + onChanged(); + } else { + serviceConfig_ = null; + serviceConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Describes the Service being deployed. Currently deploys services to Cloud
+     * Run (fully managed).
+     * 
+ * + * .google.cloud.functions.v2beta.ServiceConfig service_config = 4; + */ + public com.google.cloud.functions.v2beta.ServiceConfig.Builder getServiceConfigBuilder() { + + onChanged(); + return getServiceConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Describes the Service being deployed. Currently deploys services to Cloud
+     * Run (fully managed).
+     * 
+ * + * .google.cloud.functions.v2beta.ServiceConfig service_config = 4; + */ + public com.google.cloud.functions.v2beta.ServiceConfigOrBuilder getServiceConfigOrBuilder() { + if (serviceConfigBuilder_ != null) { + return serviceConfigBuilder_.getMessageOrBuilder(); + } else { + return serviceConfig_ == null + ? com.google.cloud.functions.v2beta.ServiceConfig.getDefaultInstance() + : serviceConfig_; + } + } + /** + * + * + *
+     * Describes the Service being deployed. Currently deploys services to Cloud
+     * Run (fully managed).
+     * 
+ * + * .google.cloud.functions.v2beta.ServiceConfig service_config = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2beta.ServiceConfig, + com.google.cloud.functions.v2beta.ServiceConfig.Builder, + com.google.cloud.functions.v2beta.ServiceConfigOrBuilder> + getServiceConfigFieldBuilder() { + if (serviceConfigBuilder_ == null) { + serviceConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2beta.ServiceConfig, + com.google.cloud.functions.v2beta.ServiceConfig.Builder, + com.google.cloud.functions.v2beta.ServiceConfigOrBuilder>( + getServiceConfig(), getParentForChildren(), isClean()); + serviceConfig_ = null; + } + return serviceConfigBuilder_; + } + + private com.google.cloud.functions.v2beta.EventTrigger eventTrigger_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2beta.EventTrigger, + com.google.cloud.functions.v2beta.EventTrigger.Builder, + com.google.cloud.functions.v2beta.EventTriggerOrBuilder> + eventTriggerBuilder_; + /** + * + * + *
+     * An Eventarc trigger managed by Google Cloud Functions that fires events in
+     * response to a condition in another service.
+     * 
+ * + * .google.cloud.functions.v2beta.EventTrigger event_trigger = 5; + * + * @return Whether the eventTrigger field is set. + */ + public boolean hasEventTrigger() { + return eventTriggerBuilder_ != null || eventTrigger_ != null; + } + /** + * + * + *
+     * An Eventarc trigger managed by Google Cloud Functions that fires events in
+     * response to a condition in another service.
+     * 
+ * + * .google.cloud.functions.v2beta.EventTrigger event_trigger = 5; + * + * @return The eventTrigger. + */ + public com.google.cloud.functions.v2beta.EventTrigger getEventTrigger() { + if (eventTriggerBuilder_ == null) { + return eventTrigger_ == null + ? com.google.cloud.functions.v2beta.EventTrigger.getDefaultInstance() + : eventTrigger_; + } else { + return eventTriggerBuilder_.getMessage(); + } + } + /** + * + * + *
+     * An Eventarc trigger managed by Google Cloud Functions that fires events in
+     * response to a condition in another service.
+     * 
+ * + * .google.cloud.functions.v2beta.EventTrigger event_trigger = 5; + */ + public Builder setEventTrigger(com.google.cloud.functions.v2beta.EventTrigger value) { + if (eventTriggerBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + eventTrigger_ = value; + onChanged(); + } else { + eventTriggerBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * An Eventarc trigger managed by Google Cloud Functions that fires events in
+     * response to a condition in another service.
+     * 
+ * + * .google.cloud.functions.v2beta.EventTrigger event_trigger = 5; + */ + public Builder setEventTrigger( + com.google.cloud.functions.v2beta.EventTrigger.Builder builderForValue) { + if (eventTriggerBuilder_ == null) { + eventTrigger_ = builderForValue.build(); + onChanged(); + } else { + eventTriggerBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * An Eventarc trigger managed by Google Cloud Functions that fires events in
+     * response to a condition in another service.
+     * 
+ * + * .google.cloud.functions.v2beta.EventTrigger event_trigger = 5; + */ + public Builder mergeEventTrigger(com.google.cloud.functions.v2beta.EventTrigger value) { + if (eventTriggerBuilder_ == null) { + if (eventTrigger_ != null) { + eventTrigger_ = + com.google.cloud.functions.v2beta.EventTrigger.newBuilder(eventTrigger_) + .mergeFrom(value) + .buildPartial(); + } else { + eventTrigger_ = value; + } + onChanged(); + } else { + eventTriggerBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * An Eventarc trigger managed by Google Cloud Functions that fires events in
+     * response to a condition in another service.
+     * 
+ * + * .google.cloud.functions.v2beta.EventTrigger event_trigger = 5; + */ + public Builder clearEventTrigger() { + if (eventTriggerBuilder_ == null) { + eventTrigger_ = null; + onChanged(); + } else { + eventTrigger_ = null; + eventTriggerBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * An Eventarc trigger managed by Google Cloud Functions that fires events in
+     * response to a condition in another service.
+     * 
+ * + * .google.cloud.functions.v2beta.EventTrigger event_trigger = 5; + */ + public com.google.cloud.functions.v2beta.EventTrigger.Builder getEventTriggerBuilder() { + + onChanged(); + return getEventTriggerFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * An Eventarc trigger managed by Google Cloud Functions that fires events in
+     * response to a condition in another service.
+     * 
+ * + * .google.cloud.functions.v2beta.EventTrigger event_trigger = 5; + */ + public com.google.cloud.functions.v2beta.EventTriggerOrBuilder getEventTriggerOrBuilder() { + if (eventTriggerBuilder_ != null) { + return eventTriggerBuilder_.getMessageOrBuilder(); + } else { + return eventTrigger_ == null + ? com.google.cloud.functions.v2beta.EventTrigger.getDefaultInstance() + : eventTrigger_; + } + } + /** + * + * + *
+     * An Eventarc trigger managed by Google Cloud Functions that fires events in
+     * response to a condition in another service.
+     * 
+ * + * .google.cloud.functions.v2beta.EventTrigger event_trigger = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2beta.EventTrigger, + com.google.cloud.functions.v2beta.EventTrigger.Builder, + com.google.cloud.functions.v2beta.EventTriggerOrBuilder> + getEventTriggerFieldBuilder() { + if (eventTriggerBuilder_ == null) { + eventTriggerBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2beta.EventTrigger, + com.google.cloud.functions.v2beta.EventTrigger.Builder, + com.google.cloud.functions.v2beta.EventTriggerOrBuilder>( + getEventTrigger(), getParentForChildren(), isClean()); + eventTrigger_ = null; + } + return eventTriggerBuilder_; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. State of the function.
+     * 
+ * + * + * .google.cloud.functions.v2beta.Function.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Output only. State of the function.
+     * 
+ * + * + * .google.cloud.functions.v2beta.Function.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + + state_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. State of the function.
+     * 
+ * + * + * .google.cloud.functions.v2beta.Function.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.Function.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2beta.Function.State result = + com.google.cloud.functions.v2beta.Function.State.valueOf(state_); + return result == null + ? com.google.cloud.functions.v2beta.Function.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. State of the function.
+     * 
+ * + * + * .google.cloud.functions.v2beta.Function.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.functions.v2beta.Function.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. State of the function.
+     * 
+ * + * + * .google.cloud.functions.v2beta.Function.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. The last update timestamp of a Cloud Function.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. The last update timestamp of a Cloud Function.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The last update timestamp of a Cloud Function.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The last update timestamp of a Cloud Function.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The last update timestamp of a Cloud Function.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The last update timestamp of a Cloud Function.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The last update timestamp of a Cloud Function.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The last update timestamp of a Cloud Function.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. The last update timestamp of a Cloud Function.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Labels associated with this Cloud Function.
+     * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Labels associated with this Cloud Function.
+     * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Labels associated with this Cloud Function.
+     * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Labels associated with this Cloud Function.
+     * 
+ * + * map<string, string> labels = 8; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Labels associated with this Cloud Function.
+     * 
+ * + * map<string, string> labels = 8; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Labels associated with this Cloud Function.
+     * 
+ * + * map<string, string> labels = 8; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Labels associated with this Cloud Function.
+     * 
+ * + * map<string, string> labels = 8; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + private java.util.List stateMessages_ = + java.util.Collections.emptyList(); + + private void ensureStateMessagesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + stateMessages_ = + new java.util.ArrayList(stateMessages_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2beta.StateMessage, + com.google.cloud.functions.v2beta.StateMessage.Builder, + com.google.cloud.functions.v2beta.StateMessageOrBuilder> + stateMessagesBuilder_; + + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getStateMessagesList() { + if (stateMessagesBuilder_ == null) { + return java.util.Collections.unmodifiableList(stateMessages_); + } else { + return stateMessagesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getStateMessagesCount() { + if (stateMessagesBuilder_ == null) { + return stateMessages_.size(); + } else { + return stateMessagesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.functions.v2beta.StateMessage getStateMessages(int index) { + if (stateMessagesBuilder_ == null) { + return stateMessages_.get(index); + } else { + return stateMessagesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStateMessages( + int index, com.google.cloud.functions.v2beta.StateMessage value) { + if (stateMessagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStateMessagesIsMutable(); + stateMessages_.set(index, value); + onChanged(); + } else { + stateMessagesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStateMessages( + int index, com.google.cloud.functions.v2beta.StateMessage.Builder builderForValue) { + if (stateMessagesBuilder_ == null) { + ensureStateMessagesIsMutable(); + stateMessages_.set(index, builderForValue.build()); + onChanged(); + } else { + stateMessagesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addStateMessages(com.google.cloud.functions.v2beta.StateMessage value) { + if (stateMessagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStateMessagesIsMutable(); + stateMessages_.add(value); + onChanged(); + } else { + stateMessagesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addStateMessages( + int index, com.google.cloud.functions.v2beta.StateMessage value) { + if (stateMessagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStateMessagesIsMutable(); + stateMessages_.add(index, value); + onChanged(); + } else { + stateMessagesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addStateMessages( + com.google.cloud.functions.v2beta.StateMessage.Builder builderForValue) { + if (stateMessagesBuilder_ == null) { + ensureStateMessagesIsMutable(); + stateMessages_.add(builderForValue.build()); + onChanged(); + } else { + stateMessagesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addStateMessages( + int index, com.google.cloud.functions.v2beta.StateMessage.Builder builderForValue) { + if (stateMessagesBuilder_ == null) { + ensureStateMessagesIsMutable(); + stateMessages_.add(index, builderForValue.build()); + onChanged(); + } else { + stateMessagesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllStateMessages( + java.lang.Iterable values) { + if (stateMessagesBuilder_ == null) { + ensureStateMessagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, stateMessages_); + onChanged(); + } else { + stateMessagesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearStateMessages() { + if (stateMessagesBuilder_ == null) { + stateMessages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + stateMessagesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeStateMessages(int index) { + if (stateMessagesBuilder_ == null) { + ensureStateMessagesIsMutable(); + stateMessages_.remove(index); + onChanged(); + } else { + stateMessagesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.functions.v2beta.StateMessage.Builder getStateMessagesBuilder( + int index) { + return getStateMessagesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.functions.v2beta.StateMessageOrBuilder getStateMessagesOrBuilder( + int index) { + if (stateMessagesBuilder_ == null) { + return stateMessages_.get(index); + } else { + return stateMessagesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getStateMessagesOrBuilderList() { + if (stateMessagesBuilder_ != null) { + return stateMessagesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(stateMessages_); + } + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.functions.v2beta.StateMessage.Builder addStateMessagesBuilder() { + return getStateMessagesFieldBuilder() + .addBuilder(com.google.cloud.functions.v2beta.StateMessage.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.functions.v2beta.StateMessage.Builder addStateMessagesBuilder( + int index) { + return getStateMessagesFieldBuilder() + .addBuilder(index, com.google.cloud.functions.v2beta.StateMessage.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. State Messages for this Cloud Function.
+     * 
+ * + * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getStateMessagesBuilderList() { + return getStateMessagesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2beta.StateMessage, + com.google.cloud.functions.v2beta.StateMessage.Builder, + com.google.cloud.functions.v2beta.StateMessageOrBuilder> + getStateMessagesFieldBuilder() { + if (stateMessagesBuilder_ == null) { + stateMessagesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2beta.StateMessage, + com.google.cloud.functions.v2beta.StateMessage.Builder, + com.google.cloud.functions.v2beta.StateMessageOrBuilder>( + stateMessages_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + stateMessages_ = null; + } + return stateMessagesBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2beta.Function) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2beta.Function) + private static final com.google.cloud.functions.v2beta.Function DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2beta.Function(); + } + + public static com.google.cloud.functions.v2beta.Function getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Function parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Function(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.Function getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/FunctionName.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/FunctionName.java new file mode 100644 index 00000000..d99058f7 --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/FunctionName.java @@ -0,0 +1,223 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v2beta; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class FunctionName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_FUNCTION = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/functions/{function}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String function; + + @Deprecated + protected FunctionName() { + project = null; + location = null; + function = null; + } + + private FunctionName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + function = Preconditions.checkNotNull(builder.getFunction()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getFunction() { + return function; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static FunctionName of(String project, String location, String function) { + return newBuilder().setProject(project).setLocation(location).setFunction(function).build(); + } + + public static String format(String project, String location, String function) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setFunction(function) + .build() + .toString(); + } + + public static FunctionName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_FUNCTION.validatedMatch( + formattedString, "FunctionName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("function")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (FunctionName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_FUNCTION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (function != null) { + fieldMapBuilder.put("function", function); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_FUNCTION.instantiate( + "project", project, "location", location, "function", function); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + FunctionName that = ((FunctionName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.function, that.function); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(function); + return h; + } + + /** Builder for projects/{project}/locations/{location}/functions/{function}. */ + public static class Builder { + private String project; + private String location; + private String function; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getFunction() { + return function; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setFunction(String function) { + this.function = function; + return this; + } + + private Builder(FunctionName functionName) { + this.project = functionName.project; + this.location = functionName.location; + this.function = functionName.function; + } + + public FunctionName build() { + return new FunctionName(this); + } + } +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/FunctionOrBuilder.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/FunctionOrBuilder.java new file mode 100644 index 00000000..60b4d58b --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/FunctionOrBuilder.java @@ -0,0 +1,404 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +public interface FunctionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2beta.Function) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A user-defined name of the function. Function names must be unique
+   * globally and match pattern `projects/*/locations/*/functions/*`
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * A user-defined name of the function. Function names must be unique
+   * globally and match pattern `projects/*/locations/*/functions/*`
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Describe whether the function is gen1 or gen2.
+   * 
+ * + * .google.cloud.functions.v2beta.Environment environment = 10; + * + * @return The enum numeric value on the wire for environment. + */ + int getEnvironmentValue(); + /** + * + * + *
+   * Describe whether the function is gen1 or gen2.
+   * 
+ * + * .google.cloud.functions.v2beta.Environment environment = 10; + * + * @return The environment. + */ + com.google.cloud.functions.v2beta.Environment getEnvironment(); + + /** + * + * + *
+   * User-provided description of a function.
+   * 
+ * + * string description = 2; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * User-provided description of a function.
+   * 
+ * + * string description = 2; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Describes the Build step of the function that builds a container from the
+   * given source.
+   * 
+ * + * .google.cloud.functions.v2beta.BuildConfig build_config = 3; + * + * @return Whether the buildConfig field is set. + */ + boolean hasBuildConfig(); + /** + * + * + *
+   * Describes the Build step of the function that builds a container from the
+   * given source.
+   * 
+ * + * .google.cloud.functions.v2beta.BuildConfig build_config = 3; + * + * @return The buildConfig. + */ + com.google.cloud.functions.v2beta.BuildConfig getBuildConfig(); + /** + * + * + *
+   * Describes the Build step of the function that builds a container from the
+   * given source.
+   * 
+ * + * .google.cloud.functions.v2beta.BuildConfig build_config = 3; + */ + com.google.cloud.functions.v2beta.BuildConfigOrBuilder getBuildConfigOrBuilder(); + + /** + * + * + *
+   * Describes the Service being deployed. Currently deploys services to Cloud
+   * Run (fully managed).
+   * 
+ * + * .google.cloud.functions.v2beta.ServiceConfig service_config = 4; + * + * @return Whether the serviceConfig field is set. + */ + boolean hasServiceConfig(); + /** + * + * + *
+   * Describes the Service being deployed. Currently deploys services to Cloud
+   * Run (fully managed).
+   * 
+ * + * .google.cloud.functions.v2beta.ServiceConfig service_config = 4; + * + * @return The serviceConfig. + */ + com.google.cloud.functions.v2beta.ServiceConfig getServiceConfig(); + /** + * + * + *
+   * Describes the Service being deployed. Currently deploys services to Cloud
+   * Run (fully managed).
+   * 
+ * + * .google.cloud.functions.v2beta.ServiceConfig service_config = 4; + */ + com.google.cloud.functions.v2beta.ServiceConfigOrBuilder getServiceConfigOrBuilder(); + + /** + * + * + *
+   * An Eventarc trigger managed by Google Cloud Functions that fires events in
+   * response to a condition in another service.
+   * 
+ * + * .google.cloud.functions.v2beta.EventTrigger event_trigger = 5; + * + * @return Whether the eventTrigger field is set. + */ + boolean hasEventTrigger(); + /** + * + * + *
+   * An Eventarc trigger managed by Google Cloud Functions that fires events in
+   * response to a condition in another service.
+   * 
+ * + * .google.cloud.functions.v2beta.EventTrigger event_trigger = 5; + * + * @return The eventTrigger. + */ + com.google.cloud.functions.v2beta.EventTrigger getEventTrigger(); + /** + * + * + *
+   * An Eventarc trigger managed by Google Cloud Functions that fires events in
+   * response to a condition in another service.
+   * 
+ * + * .google.cloud.functions.v2beta.EventTrigger event_trigger = 5; + */ + com.google.cloud.functions.v2beta.EventTriggerOrBuilder getEventTriggerOrBuilder(); + + /** + * + * + *
+   * Output only. State of the function.
+   * 
+ * + * + * .google.cloud.functions.v2beta.Function.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. State of the function.
+   * 
+ * + * + * .google.cloud.functions.v2beta.Function.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.functions.v2beta.Function.State getState(); + + /** + * + * + *
+   * Output only. The last update timestamp of a Cloud Function.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The last update timestamp of a Cloud Function.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The last update timestamp of a Cloud Function.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Labels associated with this Cloud Function.
+   * 
+ * + * map<string, string> labels = 8; + */ + int getLabelsCount(); + /** + * + * + *
+   * Labels associated with this Cloud Function.
+   * 
+ * + * map<string, string> labels = 8; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Labels associated with this Cloud Function.
+   * 
+ * + * map<string, string> labels = 8; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Labels associated with this Cloud Function.
+   * 
+ * + * map<string, string> labels = 8; + */ + + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Labels associated with this Cloud Function.
+   * 
+ * + * map<string, string> labels = 8; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. State Messages for this Cloud Function.
+   * 
+ * + * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getStateMessagesList(); + /** + * + * + *
+   * Output only. State Messages for this Cloud Function.
+   * 
+ * + * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.functions.v2beta.StateMessage getStateMessages(int index); + /** + * + * + *
+   * Output only. State Messages for this Cloud Function.
+   * 
+ * + * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getStateMessagesCount(); + /** + * + * + *
+   * Output only. State Messages for this Cloud Function.
+   * 
+ * + * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getStateMessagesOrBuilderList(); + /** + * + * + *
+   * Output only. State Messages for this Cloud Function.
+   * 
+ * + * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.functions.v2beta.StateMessageOrBuilder getStateMessagesOrBuilder(int index); +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/FunctionsProto.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/FunctionsProto.java new file mode 100644 index 00000000..c6097d91 --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/FunctionsProto.java @@ -0,0 +1,756 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +public final class FunctionsProto { + private FunctionsProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2beta_Function_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2beta_Function_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2beta_Function_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2beta_Function_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2beta_StateMessage_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2beta_StateMessage_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2beta_StorageSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2beta_StorageSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2beta_RepoSource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2beta_RepoSource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2beta_Source_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2beta_Source_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2beta_SourceProvenance_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2beta_SourceProvenance_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2beta_BuildConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2beta_BuildConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2beta_BuildConfig_EnvironmentVariablesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2beta_BuildConfig_EnvironmentVariablesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2beta_ServiceConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2beta_ServiceConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2beta_ServiceConfig_EnvironmentVariablesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2beta_ServiceConfig_EnvironmentVariablesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2beta_SecretEnvVar_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2beta_SecretEnvVar_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2beta_SecretVolume_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2beta_SecretVolume_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2beta_SecretVolume_SecretVersion_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2beta_SecretVolume_SecretVersion_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2beta_EventTrigger_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2beta_EventTrigger_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2beta_EventFilter_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2beta_EventFilter_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2beta_GetFunctionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2beta_GetFunctionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2beta_ListFunctionsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2beta_ListFunctionsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2beta_ListFunctionsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2beta_ListFunctionsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2beta_CreateFunctionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2beta_CreateFunctionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2beta_UpdateFunctionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2beta_UpdateFunctionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2beta_DeleteFunctionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2beta_DeleteFunctionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2beta_GenerateUploadUrlRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2beta_GenerateUploadUrlRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2beta_GenerateUploadUrlResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2beta_GenerateUploadUrlResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2beta_GenerateDownloadUrlRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2beta_GenerateDownloadUrlRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2beta_GenerateDownloadUrlResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2beta_GenerateDownloadUrlResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2beta_ListRuntimesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2beta_ListRuntimesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2beta_ListRuntimesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2beta_ListRuntimesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2beta_ListRuntimesResponse_Runtime_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2beta_ListRuntimesResponse_Runtime_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2beta_OperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2beta_OperationMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_functions_v2beta_Stage_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_functions_v2beta_Stage_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n-google/cloud/functions/v2beta/function" + + "s.proto\022\035google.cloud.functions.v2beta\032\034" + + "google/api/annotations.proto\032\027google/api" + + "/client.proto\032\037google/api/field_behavior" + + ".proto\032\031google/api/resource.proto\032#googl" + + "e/longrunning/operations.proto\032\031google/p" + + "rotobuf/any.proto\032 google/protobuf/field" + + "_mask.proto\032\037google/protobuf/timestamp.p" + + "roto\"\323\006\n\010Function\022\014\n\004name\030\001 \001(\t\022?\n\013envir" + + "onment\030\n \001(\0162*.google.cloud.functions.v2" + + "beta.Environment\022\023\n\013description\030\002 \001(\t\022@\n" + + "\014build_config\030\003 \001(\0132*.google.cloud.funct" + + "ions.v2beta.BuildConfig\022D\n\016service_confi" + + "g\030\004 \001(\0132,.google.cloud.functions.v2beta." + + "ServiceConfig\022B\n\revent_trigger\030\005 \001(\0132+.g" + + "oogle.cloud.functions.v2beta.EventTrigge" + + "r\022A\n\005state\030\006 \001(\0162-.google.cloud.function" + + "s.v2beta.Function.StateB\003\340A\003\0224\n\013update_t" + + "ime\030\007 \001(\0132\032.google.protobuf.TimestampB\003\340" + + "A\003\022C\n\006labels\030\010 \003(\01323.google.cloud.functi" + + "ons.v2beta.Function.LabelsEntry\022H\n\016state" + + "_messages\030\t \003(\0132+.google.cloud.functions" + + ".v2beta.StateMessageB\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\005Stat" + + "e\022\025\n\021STATE_UNSPECIFIED\020\000\022\n\n\006ACTIVE\020\001\022\n\n\006" + + "FAILED\020\002\022\r\n\tDEPLOYING\020\003\022\014\n\010DELETING\020\004\022\013\n" + + "\007UNKNOWN\020\005:~\352A{\n&cloudfunctions.googleap" + + "is.com/Function\022\n\013worker_pool\030\005" + + " \001(\tB)\372A&\n$cloudbuild.googleapis.com/Wor" + + "kerPool\022c\n\025environment_variables\030\006 \003(\0132D" + + ".google.cloud.functions.v2beta.BuildConf" + + "ig.EnvironmentVariablesEntry\022M\n\021docker_r" + + "epository\030\007 \001(\tB2\340A\001\372A,\n*artifactregistr" + + "y.googleapis.com/Repository\032;\n\031Environme" + + "ntVariablesEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002" + + " \001(\t:\0028\001\"\324\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\020available_me" + + "mory\030\r \001(\t\022e\n\025environment_variables\030\004 \003(" + + "\0132F.google.cloud.functions.v2beta.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\022n\n\035vpc" + + "_connector_egress_settings\030\007 \001(\0162G.googl" + + "e.cloud.functions.v2beta.ServiceConfig.V" + + "pcConnectorEgressSettings\022V\n\020ingress_set" + + "tings\030\010 \001(\0162<.google.cloud.functions.v2b" + + "eta.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\022Q\n\034secret_environment_variables\030\021 \003(\013" + + "2+.google.cloud.functions.v2beta.SecretE" + + "nvVar\022C\n\016secret_volumes\030\023 \003(\0132+.google.c" + + "loud.functions.v2beta.SecretVolume\022\025\n\010re" + + "vision\030\022 \001(\tB\003\340A\003\032;\n\031EnvironmentVariable" + + "sEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"u" + + "\n\032VpcConnectorEgressSettings\022-\n)VPC_CONN" + + "ECTOR_EGRESS_SETTINGS_UNSPECIFIED\020\000\022\027\n\023P" + + "RIVATE_RANGES_ONLY\020\001\022\017\n\013ALL_TRAFFIC\020\002\"x\n" + + "\017IngressSettings\022 \n\034INGRESS_SETTINGS_UNS" + + "PECIFIED\020\000\022\r\n\tALLOW_ALL\020\001\022\027\n\023ALLOW_INTER" + + "NAL_ONLY\020\002\022\033\n\027ALLOW_INTERNAL_AND_GCLB\020\003\"" + + "P\n\014SecretEnvVar\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\"\303\001\n\014SecretVolume\022\022\n\nmount_path\030\001 \001(\t\022\022" + + "\n\nproject_id\030\002 \001(\t\022\016\n\006secret\030\003 \001(\t\022K\n\010ve" + + "rsions\030\004 \003(\01329.google.cloud.functions.v2" + + "beta.SecretVolume.SecretVersion\032.\n\rSecre" + + "tVersion\022\017\n\007version\030\001 \001(\t\022\014\n\004path\030\002 \001(\t\"" + + "\215\004\n\014EventTrigger\0228\n\007trigger\030\001 \001(\tB\'\340A\003\372A" + + "!\n\037eventarc.googleapis.com/Trigger\022\026\n\016tr" + + "igger_region\030\002 \001(\t\022\027\n\nevent_type\030\003 \001(\tB\003" + + "\340A\002\022A\n\revent_filters\030\004 \003(\0132*.google.clou" + + "d.functions.v2beta.EventFilter\0229\n\014pubsub" + + "_topic\030\005 \001(\tB#\340A\001\372A\035\n\033pubsub.googleapis." + + "com/Topic\022\"\n\025service_account_email\030\006 \001(\t" + + "B\003\340A\001\022R\n\014retry_policy\030\007 \001(\01627.google.clo" + + "ud.functions.v2beta.EventTrigger.RetryPo" + + "licyB\003\340A\001\0228\n\007channel\030\010 \001(\tB\'\340A\001\372A!\n\037even" + + "tarc.googleapis.com/Channel\"b\n\013RetryPoli" + + "cy\022\034\n\030RETRY_POLICY_UNSPECIFIED\020\000\022\035\n\031RETR" + + "Y_POLICY_DO_NOT_RETRY\020\001\022\026\n\022RETRY_POLICY_" + + "RETRY\020\002\"P\n\013EventFilter\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\022GetFunctionRequest\022<\n\004name\030" + + "\001 \001(\tB.\340A\002\372A(\n&cloudfunctions.googleapis" + + ".com/Function\"\237\001\n\024ListFunctionsRequest\022>" + + "\n\006parent\030\001 \001(\tB.\340A\002\372A(\022&cloudfunctions.g" + + "oogleapis.com/Function\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\"\201\001\n\025ListFunctionsRespons" + + "e\022:\n\tfunctions\030\001 \003(\0132\'.google.cloud.func" + + "tions.v2beta.Function\022\027\n\017next_page_token" + + "\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\"\247\001\n\025CreateFu" + + "nctionRequest\0229\n\006parent\030\001 \001(\tB)\340A\002\372A#\n!l" + + "ocations.googleapis.com/Location\022>\n\010func" + + "tion\030\002 \001(\0132\'.google.cloud.functions.v2be" + + "ta.FunctionB\003\340A\002\022\023\n\013function_id\030\003 \001(\t\"\210\001" + + "\n\025UpdateFunctionRequest\022>\n\010function\030\001 \001(" + + "\0132\'.google.cloud.functions.v2beta.Functi" + + "onB\003\340A\002\022/\n\013update_mask\030\002 \001(\0132\032.google.pr" + + "otobuf.FieldMask\"U\n\025DeleteFunctionReques" + + "t\022<\n\004name\030\001 \001(\tB.\340A\002\372A(\n&cloudfunctions." + + "googleapis.com/Function\"U\n\030GenerateUploa" + + "dUrlRequest\0229\n\006parent\030\001 \001(\tB)\340A\002\372A#\n!loc" + + "ations.googleapis.com/Location\"u\n\031Genera" + + "teUploadUrlResponse\022\022\n\nupload_url\030\001 \001(\t\022" + + "D\n\016storage_source\030\002 \001(\0132,.google.cloud.f" + + "unctions.v2beta.StorageSource\"Z\n\032Generat" + + "eDownloadUrlRequest\022<\n\004name\030\001 \001(\tB.\340A\002\372A" + + "(\n&cloudfunctions.googleapis.com/Functio" + + "n\"3\n\033GenerateDownloadUrlResponse\022\024\n\014down" + + "load_url\030\001 \001(\t\"`\n\023ListRuntimesRequest\0229\n" + + "\006parent\030\001 \001(\tB)\340A\002\372A#\n!locations.googlea" + + "pis.com/Location\022\016\n\006filter\030\002 \001(\t\"\272\003\n\024Lis" + + "tRuntimesResponse\022M\n\010runtimes\030\001 \003(\0132;.go" + + "ogle.cloud.functions.v2beta.ListRuntimes" + + "Response.Runtime\032\321\001\n\007Runtime\022\014\n\004name\030\001 \001" + + "(\t\022\024\n\014display_name\030\005 \001(\t\022O\n\005stage\030\002 \001(\0162" + + "@.google.cloud.functions.v2beta.ListRunt" + + "imesResponse.RuntimeStage\022\020\n\010warnings\030\003 " + + "\003(\t\022?\n\013environment\030\004 \001(\0162*.google.cloud." + + "functions.v2beta.Environment\"\177\n\014RuntimeS" + + "tage\022\035\n\031RUNTIME_STAGE_UNSPECIFIED\020\000\022\017\n\013D" + + "EVELOPMENT\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\016DECOMMISSIONED\020\006\"\274\002" + + "\n\021OperationMetadata\022/\n\013create_time\030\001 \001(\013" + + "2\032.google.protobuf.Timestamp\022,\n\010end_time" + + "\030\002 \001(\0132\032.google.protobuf.Timestamp\022\016\n\006ta" + + "rget\030\003 \001(\t\022\014\n\004verb\030\004 \001(\t\022\025\n\rstatus_detai" + + "l\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(\013" + + "2\024.google.protobuf.Any\0224\n\006stages\030\t \003(\0132$" + + ".google.cloud.functions.v2beta.Stage\"\320\003\n" + + "\005Stage\0227\n\004name\030\001 \001(\0162).google.cloud.func" + + "tions.v2beta.Stage.Name\022\017\n\007message\030\002 \001(\t" + + "\0229\n\005state\030\003 \001(\0162*.google.cloud.functions" + + ".v2beta.Stage.State\022\020\n\010resource\030\004 \001(\t\022\024\n" + + "\014resource_uri\030\005 \001(\t\022C\n\016state_messages\030\006 " + + "\003(\0132+.google.cloud.functions.v2beta.Stat" + + "eMessage\"\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\007SER" + + "VICE\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\021STAT" + + "E_UNSPECIFIED\020\000\022\017\n\013NOT_STARTED\020\001\022\017\n\013IN_P" + + "ROGRESS\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\222\017\n\017FunctionService\022\253\001\n\013GetFun" + + "ction\0221.google.cloud.functions.v2beta.Ge" + + "tFunctionRequest\032\'.google.cloud.function" + + "s.v2beta.Function\"@\202\323\344\223\0023\0221/v2beta/{name" + + "=projects/*/locations/*/functions/*}\332A\004n" + + "ame\022\276\001\n\rListFunctions\0223.google.cloud.fun" + + "ctions.v2beta.ListFunctionsRequest\0324.goo" + + "gle.cloud.functions.v2beta.ListFunctions" + + "Response\"B\202\323\344\223\0023\0221/v2beta/{parent=projec" + + "ts/*/locations/*}/functions\332A\006parent\022\245\002\n" + + "\016CreateFunction\0224.google.cloud.functions" + + ".v2beta.CreateFunctionRequest\032\035.google.l" + + "ongrunning.Operation\"\275\001\202\323\344\223\002=\"1/v2beta/{" + + "parent=projects/*/locations/*}/functions" + + ":\010function\332A\033parent,function,function_id" + + "\312AY\n&google.cloud.functions.v2beta.Funct" + + "ion\022/google.cloud.functions.v2beta.Opera" + + "tionMetadata\022\247\002\n\016UpdateFunction\0224.google" + + ".cloud.functions.v2beta.UpdateFunctionRe" + + "quest\032\035.google.longrunning.Operation\"\277\001\202" + + "\323\344\223\002F2:/v2beta/{function.name=projects/*" + + "/locations/*/functions/*}:\010function\332A\024fu" + + "nction,update_mask\312AY\n&google.cloud.func" + + "tions.v2beta.Function\022/google.cloud.func" + + "tions.v2beta.OperationMetadata\022\363\001\n\016Delet" + + "eFunction\0224.google.cloud.functions.v2bet" + + "a.DeleteFunctionRequest\032\035.google.longrun" + + "ning.Operation\"\213\001\202\323\344\223\0023*1/v2beta/{name=p" + + "rojects/*/locations/*/functions/*}\332A\004nam" + + "e\312AH\n\025google.protobuf.Empty\022/google.clou" + + "d.functions.v2beta.OperationMetadata\022\326\001\n" + + "\021GenerateUploadUrl\0227.google.cloud.functi" + + "ons.v2beta.GenerateUploadUrlRequest\0328.go" + + "ogle.cloud.functions.v2beta.GenerateUplo" + + "adUrlResponse\"N\202\323\344\223\002H\"C/v2beta/{parent=p" + + "rojects/*/locations/*}/functions:generat" + + "eUploadUrl:\001*\022\336\001\n\023GenerateDownloadUrl\0229." + + "google.cloud.functions.v2beta.GenerateDo" + + "wnloadUrlRequest\032:.google.cloud.function" + + "s.v2beta.GenerateDownloadUrlResponse\"P\202\323" + + "\344\223\002J\"E/v2beta/{name=projects/*/locations" + + "/*/functions/*}:generateDownloadUrl:\001*\022\272" + + "\001\n\014ListRuntimes\0222.google.cloud.functions" + + ".v2beta.ListRuntimesRequest\0323.google.clo" + + "ud.functions.v2beta.ListRuntimesResponse" + + "\"A\202\323\344\223\0022\0220/v2beta/{parent=projects/*/loc" + + "ations/*}/runtimes\332A\006parent\032Q\312A\035cloudfun" + + "ctions.googleapis.com\322A.https://www.goog" + + "leapis.com/auth/cloud-platformB\202\007\n!com.g" + + "oogle.cloud.functions.v2betaB\016FunctionsP" + + "rotoP\001ZFgoogle.golang.org/genproto/googl" + + "eapis/cloud/functions/v2beta;functions\242\002" + + "\003GCF\352Ao\n*artifactregistry.googleapis.com" + + "/Repository\022Aprojects/{project}/location" + + "s/{location}/repositories/{repository}\352A" + + "Y\n\037cloudbuild.googleapis.com/Build\0226proj" + + "ects/{project}/locations/{location}/buil" + + "ds/{build}\352Ai\n$cloudbuild.googleapis.com" + + "/WorkerPool\022Aprojects/{project}/location" + + "s/{location}/workerPools/{worker_pool}\352A" + + "X\n\032run.googleapis.com/Service\022:projects/" + + "{project}/locations/{location}/services/" + + "{service}\352Ad\n\"vpcaccess.googleapis.com/C" + + "onnector\022>projects/{project}/locations/{" + + "location}/connectors/{connector}\352A]\n\037eve" + + "ntarc.googleapis.com/Trigger\022:projects/{" + + "project}/locations/{location}/triggers/{" + + "trigger}\352A]\n\037eventarc.googleapis.com/Cha" + + "nnel\022:projects/{project}/locations/{loca" + + "tion}/channels/{channel}\352A@\n\033pubsub.goog" + + "leapis.com/Topic\022!projects/{project}/top" + + "ics/{topic}b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.AnyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_functions_v2beta_Function_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_functions_v2beta_Function_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2beta_Function_descriptor, + new java.lang.String[] { + "Name", + "Environment", + "Description", + "BuildConfig", + "ServiceConfig", + "EventTrigger", + "State", + "UpdateTime", + "Labels", + "StateMessages", + }); + internal_static_google_cloud_functions_v2beta_Function_LabelsEntry_descriptor = + internal_static_google_cloud_functions_v2beta_Function_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_functions_v2beta_Function_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2beta_Function_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_functions_v2beta_StateMessage_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_functions_v2beta_StateMessage_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2beta_StateMessage_descriptor, + new java.lang.String[] { + "Severity", "Type", "Message", + }); + internal_static_google_cloud_functions_v2beta_StorageSource_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_functions_v2beta_StorageSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2beta_StorageSource_descriptor, + new java.lang.String[] { + "Bucket", "Object", "Generation", + }); + internal_static_google_cloud_functions_v2beta_RepoSource_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_functions_v2beta_RepoSource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2beta_RepoSource_descriptor, + new java.lang.String[] { + "BranchName", + "TagName", + "CommitSha", + "ProjectId", + "RepoName", + "Dir", + "InvertRegex", + "Revision", + }); + internal_static_google_cloud_functions_v2beta_Source_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_functions_v2beta_Source_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2beta_Source_descriptor, + new java.lang.String[] { + "StorageSource", "RepoSource", "Source", + }); + internal_static_google_cloud_functions_v2beta_SourceProvenance_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_functions_v2beta_SourceProvenance_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2beta_SourceProvenance_descriptor, + new java.lang.String[] { + "ResolvedStorageSource", "ResolvedRepoSource", + }); + internal_static_google_cloud_functions_v2beta_BuildConfig_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_functions_v2beta_BuildConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2beta_BuildConfig_descriptor, + new java.lang.String[] { + "Build", + "Runtime", + "EntryPoint", + "Source", + "SourceProvenance", + "WorkerPool", + "EnvironmentVariables", + "DockerRepository", + }); + internal_static_google_cloud_functions_v2beta_BuildConfig_EnvironmentVariablesEntry_descriptor = + internal_static_google_cloud_functions_v2beta_BuildConfig_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_functions_v2beta_BuildConfig_EnvironmentVariablesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2beta_BuildConfig_EnvironmentVariablesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_functions_v2beta_ServiceConfig_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_functions_v2beta_ServiceConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2beta_ServiceConfig_descriptor, + new java.lang.String[] { + "Service", + "TimeoutSeconds", + "AvailableMemory", + "EnvironmentVariables", + "MaxInstanceCount", + "MinInstanceCount", + "VpcConnector", + "VpcConnectorEgressSettings", + "IngressSettings", + "Uri", + "ServiceAccountEmail", + "AllTrafficOnLatestRevision", + "SecretEnvironmentVariables", + "SecretVolumes", + "Revision", + }); + internal_static_google_cloud_functions_v2beta_ServiceConfig_EnvironmentVariablesEntry_descriptor = + internal_static_google_cloud_functions_v2beta_ServiceConfig_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_functions_v2beta_ServiceConfig_EnvironmentVariablesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2beta_ServiceConfig_EnvironmentVariablesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_functions_v2beta_SecretEnvVar_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_functions_v2beta_SecretEnvVar_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2beta_SecretEnvVar_descriptor, + new java.lang.String[] { + "Key", "ProjectId", "Secret", "Version", + }); + internal_static_google_cloud_functions_v2beta_SecretVolume_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_functions_v2beta_SecretVolume_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2beta_SecretVolume_descriptor, + new java.lang.String[] { + "MountPath", "ProjectId", "Secret", "Versions", + }); + internal_static_google_cloud_functions_v2beta_SecretVolume_SecretVersion_descriptor = + internal_static_google_cloud_functions_v2beta_SecretVolume_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_functions_v2beta_SecretVolume_SecretVersion_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2beta_SecretVolume_SecretVersion_descriptor, + new java.lang.String[] { + "Version", "Path", + }); + internal_static_google_cloud_functions_v2beta_EventTrigger_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_functions_v2beta_EventTrigger_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2beta_EventTrigger_descriptor, + new java.lang.String[] { + "Trigger", + "TriggerRegion", + "EventType", + "EventFilters", + "PubsubTopic", + "ServiceAccountEmail", + "RetryPolicy", + "Channel", + }); + internal_static_google_cloud_functions_v2beta_EventFilter_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_functions_v2beta_EventFilter_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2beta_EventFilter_descriptor, + new java.lang.String[] { + "Attribute", "Value", "Operator", + }); + internal_static_google_cloud_functions_v2beta_GetFunctionRequest_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_functions_v2beta_GetFunctionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2beta_GetFunctionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_functions_v2beta_ListFunctionsRequest_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_functions_v2beta_ListFunctionsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2beta_ListFunctionsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_functions_v2beta_ListFunctionsResponse_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_functions_v2beta_ListFunctionsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2beta_ListFunctionsResponse_descriptor, + new java.lang.String[] { + "Functions", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_functions_v2beta_CreateFunctionRequest_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_functions_v2beta_CreateFunctionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2beta_CreateFunctionRequest_descriptor, + new java.lang.String[] { + "Parent", "Function", "FunctionId", + }); + internal_static_google_cloud_functions_v2beta_UpdateFunctionRequest_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_cloud_functions_v2beta_UpdateFunctionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2beta_UpdateFunctionRequest_descriptor, + new java.lang.String[] { + "Function", "UpdateMask", + }); + internal_static_google_cloud_functions_v2beta_DeleteFunctionRequest_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_cloud_functions_v2beta_DeleteFunctionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2beta_DeleteFunctionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_functions_v2beta_GenerateUploadUrlRequest_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_google_cloud_functions_v2beta_GenerateUploadUrlRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2beta_GenerateUploadUrlRequest_descriptor, + new java.lang.String[] { + "Parent", + }); + internal_static_google_cloud_functions_v2beta_GenerateUploadUrlResponse_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_google_cloud_functions_v2beta_GenerateUploadUrlResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2beta_GenerateUploadUrlResponse_descriptor, + new java.lang.String[] { + "UploadUrl", "StorageSource", + }); + internal_static_google_cloud_functions_v2beta_GenerateDownloadUrlRequest_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_google_cloud_functions_v2beta_GenerateDownloadUrlRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2beta_GenerateDownloadUrlRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_functions_v2beta_GenerateDownloadUrlResponse_descriptor = + getDescriptor().getMessageTypes().get(21); + internal_static_google_cloud_functions_v2beta_GenerateDownloadUrlResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2beta_GenerateDownloadUrlResponse_descriptor, + new java.lang.String[] { + "DownloadUrl", + }); + internal_static_google_cloud_functions_v2beta_ListRuntimesRequest_descriptor = + getDescriptor().getMessageTypes().get(22); + internal_static_google_cloud_functions_v2beta_ListRuntimesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2beta_ListRuntimesRequest_descriptor, + new java.lang.String[] { + "Parent", "Filter", + }); + internal_static_google_cloud_functions_v2beta_ListRuntimesResponse_descriptor = + getDescriptor().getMessageTypes().get(23); + internal_static_google_cloud_functions_v2beta_ListRuntimesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2beta_ListRuntimesResponse_descriptor, + new java.lang.String[] { + "Runtimes", + }); + internal_static_google_cloud_functions_v2beta_ListRuntimesResponse_Runtime_descriptor = + internal_static_google_cloud_functions_v2beta_ListRuntimesResponse_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_functions_v2beta_ListRuntimesResponse_Runtime_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2beta_ListRuntimesResponse_Runtime_descriptor, + new java.lang.String[] { + "Name", "DisplayName", "Stage", "Warnings", "Environment", + }); + internal_static_google_cloud_functions_v2beta_OperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(24); + internal_static_google_cloud_functions_v2beta_OperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2beta_OperationMetadata_descriptor, + new java.lang.String[] { + "CreateTime", + "EndTime", + "Target", + "Verb", + "StatusDetail", + "CancelRequested", + "ApiVersion", + "RequestResource", + "Stages", + }); + internal_static_google_cloud_functions_v2beta_Stage_descriptor = + getDescriptor().getMessageTypes().get(25); + internal_static_google_cloud_functions_v2beta_Stage_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_functions_v2beta_Stage_descriptor, + new java.lang.String[] { + "Name", "Message", "State", "Resource", "ResourceUri", "StateMessages", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceDefinition); + registry.add(com.google.api.ResourceProto.resourceReference); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.AnyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/GenerateDownloadUrlRequest.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/GenerateDownloadUrlRequest.java new file mode 100644 index 00000000..b2ecc701 --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/GenerateDownloadUrlRequest.java @@ -0,0 +1,663 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +/** + * + * + *
+ * Request of `GenerateDownloadUrl` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.GenerateDownloadUrlRequest} + */ +public final class GenerateDownloadUrlRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2beta.GenerateDownloadUrlRequest) + GenerateDownloadUrlRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GenerateDownloadUrlRequest.newBuilder() to construct. + private GenerateDownloadUrlRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GenerateDownloadUrlRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GenerateDownloadUrlRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GenerateDownloadUrlRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_GenerateDownloadUrlRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_GenerateDownloadUrlRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest.class, + com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of function for which source code Google Cloud Storage signed
+   * URL should be generated.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of function for which source code Google Cloud Storage signed
+   * URL should be generated.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest)) { + return super.equals(obj); + } + com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest other = + (com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request of `GenerateDownloadUrl` method.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.GenerateDownloadUrlRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2beta.GenerateDownloadUrlRequest) + com.google.cloud.functions.v2beta.GenerateDownloadUrlRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_GenerateDownloadUrlRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_GenerateDownloadUrlRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest.class, + com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest.Builder.class); + } + + // Construct using com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_GenerateDownloadUrlRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest + getDefaultInstanceForType() { + return com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest build() { + com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest buildPartial() { + com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest result = + new com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest) { + return mergeFrom((com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest other) { + if (other + == com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of function for which source code Google Cloud Storage signed
+     * URL should be generated.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of function for which source code Google Cloud Storage signed
+     * URL should be generated.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of function for which source code Google Cloud Storage signed
+     * URL should be generated.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of function for which source code Google Cloud Storage signed
+     * URL should be generated.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of function for which source code Google Cloud Storage signed
+     * URL should be generated.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2beta.GenerateDownloadUrlRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2beta.GenerateDownloadUrlRequest) + private static final com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest(); + } + + public static com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GenerateDownloadUrlRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GenerateDownloadUrlRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.GenerateDownloadUrlRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/GenerateDownloadUrlRequestOrBuilder.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/GenerateDownloadUrlRequestOrBuilder.java new file mode 100644 index 00000000..cc4f6c5c --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/GenerateDownloadUrlRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +public interface GenerateDownloadUrlRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2beta.GenerateDownloadUrlRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of function for which source code Google Cloud Storage signed
+   * URL should be generated.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of function for which source code Google Cloud Storage signed
+   * URL should be generated.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/GenerateDownloadUrlResponse.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/GenerateDownloadUrlResponse.java new file mode 100644 index 00000000..ca2ce3bf --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/GenerateDownloadUrlResponse.java @@ -0,0 +1,650 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +/** + * + * + *
+ * Response of `GenerateDownloadUrl` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.GenerateDownloadUrlResponse} + */ +public final class GenerateDownloadUrlResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2beta.GenerateDownloadUrlResponse) + GenerateDownloadUrlResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use GenerateDownloadUrlResponse.newBuilder() to construct. + private GenerateDownloadUrlResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GenerateDownloadUrlResponse() { + downloadUrl_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GenerateDownloadUrlResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GenerateDownloadUrlResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + downloadUrl_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_GenerateDownloadUrlResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_GenerateDownloadUrlResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse.class, + com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse.Builder.class); + } + + public static final int DOWNLOAD_URL_FIELD_NUMBER = 1; + private volatile java.lang.Object downloadUrl_; + /** + * + * + *
+   * The generated Google Cloud Storage signed URL that should be used for
+   * function source code download.
+   * 
+ * + * string download_url = 1; + * + * @return The downloadUrl. + */ + @java.lang.Override + public java.lang.String getDownloadUrl() { + java.lang.Object ref = downloadUrl_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + downloadUrl_ = s; + return s; + } + } + /** + * + * + *
+   * The generated Google Cloud Storage signed URL that should be used for
+   * function source code download.
+   * 
+ * + * string download_url = 1; + * + * @return The bytes for downloadUrl. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDownloadUrlBytes() { + java.lang.Object ref = downloadUrl_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + downloadUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(downloadUrl_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, downloadUrl_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(downloadUrl_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, downloadUrl_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse)) { + return super.equals(obj); + } + com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse other = + (com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse) obj; + + if (!getDownloadUrl().equals(other.getDownloadUrl())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DOWNLOAD_URL_FIELD_NUMBER; + hash = (53 * hash) + getDownloadUrl().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response of `GenerateDownloadUrl` method.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.GenerateDownloadUrlResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2beta.GenerateDownloadUrlResponse) + com.google.cloud.functions.v2beta.GenerateDownloadUrlResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_GenerateDownloadUrlResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_GenerateDownloadUrlResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse.class, + com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse.Builder.class); + } + + // Construct using com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + downloadUrl_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_GenerateDownloadUrlResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse + getDefaultInstanceForType() { + return com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse build() { + com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse buildPartial() { + com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse result = + new com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse(this); + result.downloadUrl_ = downloadUrl_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse) { + return mergeFrom((com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse other) { + if (other + == com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse.getDefaultInstance()) + return this; + if (!other.getDownloadUrl().isEmpty()) { + downloadUrl_ = other.downloadUrl_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object downloadUrl_ = ""; + /** + * + * + *
+     * The generated Google Cloud Storage signed URL that should be used for
+     * function source code download.
+     * 
+ * + * string download_url = 1; + * + * @return The downloadUrl. + */ + public java.lang.String getDownloadUrl() { + java.lang.Object ref = downloadUrl_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + downloadUrl_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The generated Google Cloud Storage signed URL that should be used for
+     * function source code download.
+     * 
+ * + * string download_url = 1; + * + * @return The bytes for downloadUrl. + */ + public com.google.protobuf.ByteString getDownloadUrlBytes() { + java.lang.Object ref = downloadUrl_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + downloadUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The generated Google Cloud Storage signed URL that should be used for
+     * function source code download.
+     * 
+ * + * string download_url = 1; + * + * @param value The downloadUrl to set. + * @return This builder for chaining. + */ + public Builder setDownloadUrl(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + downloadUrl_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The generated Google Cloud Storage signed URL that should be used for
+     * function source code download.
+     * 
+ * + * string download_url = 1; + * + * @return This builder for chaining. + */ + public Builder clearDownloadUrl() { + + downloadUrl_ = getDefaultInstance().getDownloadUrl(); + onChanged(); + return this; + } + /** + * + * + *
+     * The generated Google Cloud Storage signed URL that should be used for
+     * function source code download.
+     * 
+ * + * string download_url = 1; + * + * @param value The bytes for downloadUrl to set. + * @return This builder for chaining. + */ + public Builder setDownloadUrlBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + downloadUrl_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2beta.GenerateDownloadUrlResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2beta.GenerateDownloadUrlResponse) + private static final com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse(); + } + + public static com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GenerateDownloadUrlResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GenerateDownloadUrlResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.GenerateDownloadUrlResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/GenerateDownloadUrlResponseOrBuilder.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/GenerateDownloadUrlResponseOrBuilder.java new file mode 100644 index 00000000..38f50641 --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/GenerateDownloadUrlResponseOrBuilder.java @@ -0,0 +1,52 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +public interface GenerateDownloadUrlResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2beta.GenerateDownloadUrlResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The generated Google Cloud Storage signed URL that should be used for
+   * function source code download.
+   * 
+ * + * string download_url = 1; + * + * @return The downloadUrl. + */ + java.lang.String getDownloadUrl(); + /** + * + * + *
+   * The generated Google Cloud Storage signed URL that should be used for
+   * function source code download.
+   * 
+ * + * string download_url = 1; + * + * @return The bytes for downloadUrl. + */ + com.google.protobuf.ByteString getDownloadUrlBytes(); +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/GenerateUploadUrlRequest.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/GenerateUploadUrlRequest.java new file mode 100644 index 00000000..44dc62e3 --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/GenerateUploadUrlRequest.java @@ -0,0 +1,660 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +/** + * + * + *
+ * Request of `GenerateSourceUploadUrl` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.GenerateUploadUrlRequest} + */ +public final class GenerateUploadUrlRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2beta.GenerateUploadUrlRequest) + GenerateUploadUrlRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GenerateUploadUrlRequest.newBuilder() to construct. + private GenerateUploadUrlRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GenerateUploadUrlRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GenerateUploadUrlRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GenerateUploadUrlRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_GenerateUploadUrlRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_GenerateUploadUrlRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.GenerateUploadUrlRequest.class, + com.google.cloud.functions.v2beta.GenerateUploadUrlRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The project and location in which the Google Cloud Storage signed URL
+   * should be generated, specified in the format `projects/*/locations/*`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The project and location in which the Google Cloud Storage signed URL
+   * should be generated, specified in the format `projects/*/locations/*`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2beta.GenerateUploadUrlRequest)) { + return super.equals(obj); + } + com.google.cloud.functions.v2beta.GenerateUploadUrlRequest other = + (com.google.cloud.functions.v2beta.GenerateUploadUrlRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2beta.GenerateUploadUrlRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.GenerateUploadUrlRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.GenerateUploadUrlRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.GenerateUploadUrlRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.GenerateUploadUrlRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.GenerateUploadUrlRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.GenerateUploadUrlRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.GenerateUploadUrlRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.GenerateUploadUrlRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.GenerateUploadUrlRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.GenerateUploadUrlRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.GenerateUploadUrlRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.functions.v2beta.GenerateUploadUrlRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request of `GenerateSourceUploadUrl` method.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.GenerateUploadUrlRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2beta.GenerateUploadUrlRequest) + com.google.cloud.functions.v2beta.GenerateUploadUrlRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_GenerateUploadUrlRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_GenerateUploadUrlRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.GenerateUploadUrlRequest.class, + com.google.cloud.functions.v2beta.GenerateUploadUrlRequest.Builder.class); + } + + // Construct using com.google.cloud.functions.v2beta.GenerateUploadUrlRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_GenerateUploadUrlRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.GenerateUploadUrlRequest getDefaultInstanceForType() { + return com.google.cloud.functions.v2beta.GenerateUploadUrlRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.GenerateUploadUrlRequest build() { + com.google.cloud.functions.v2beta.GenerateUploadUrlRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.GenerateUploadUrlRequest buildPartial() { + com.google.cloud.functions.v2beta.GenerateUploadUrlRequest result = + new com.google.cloud.functions.v2beta.GenerateUploadUrlRequest(this); + result.parent_ = parent_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2beta.GenerateUploadUrlRequest) { + return mergeFrom((com.google.cloud.functions.v2beta.GenerateUploadUrlRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2beta.GenerateUploadUrlRequest other) { + if (other == com.google.cloud.functions.v2beta.GenerateUploadUrlRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2beta.GenerateUploadUrlRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2beta.GenerateUploadUrlRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The project and location in which the Google Cloud Storage signed URL
+     * should be generated, specified in the format `projects/*/locations/*`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The project and location in which the Google Cloud Storage signed URL
+     * should be generated, specified in the format `projects/*/locations/*`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The project and location in which the Google Cloud Storage signed URL
+     * should be generated, specified in the format `projects/*/locations/*`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The project and location in which the Google Cloud Storage signed URL
+     * should be generated, specified in the format `projects/*/locations/*`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The project and location in which the Google Cloud Storage signed URL
+     * should be generated, specified in the format `projects/*/locations/*`.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2beta.GenerateUploadUrlRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2beta.GenerateUploadUrlRequest) + private static final com.google.cloud.functions.v2beta.GenerateUploadUrlRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2beta.GenerateUploadUrlRequest(); + } + + public static com.google.cloud.functions.v2beta.GenerateUploadUrlRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GenerateUploadUrlRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GenerateUploadUrlRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.GenerateUploadUrlRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/GenerateUploadUrlRequestOrBuilder.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/GenerateUploadUrlRequestOrBuilder.java new file mode 100644 index 00000000..f113fe3c --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/GenerateUploadUrlRequestOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +public interface GenerateUploadUrlRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2beta.GenerateUploadUrlRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The project and location in which the Google Cloud Storage signed URL
+   * should be generated, specified in the format `projects/*/locations/*`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The project and location in which the Google Cloud Storage signed URL
+   * should be generated, specified in the format `projects/*/locations/*`.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/GenerateUploadUrlResponse.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/GenerateUploadUrlResponse.java new file mode 100644 index 00000000..fae8cd20 --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/GenerateUploadUrlResponse.java @@ -0,0 +1,991 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +/** + * + * + *
+ * Response of `GenerateSourceUploadUrl` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.GenerateUploadUrlResponse} + */ +public final class GenerateUploadUrlResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2beta.GenerateUploadUrlResponse) + GenerateUploadUrlResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use GenerateUploadUrlResponse.newBuilder() to construct. + private GenerateUploadUrlResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GenerateUploadUrlResponse() { + uploadUrl_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GenerateUploadUrlResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GenerateUploadUrlResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + uploadUrl_ = s; + break; + } + case 18: + { + com.google.cloud.functions.v2beta.StorageSource.Builder subBuilder = null; + if (storageSource_ != null) { + subBuilder = storageSource_.toBuilder(); + } + storageSource_ = + input.readMessage( + com.google.cloud.functions.v2beta.StorageSource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(storageSource_); + storageSource_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_GenerateUploadUrlResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_GenerateUploadUrlResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.GenerateUploadUrlResponse.class, + com.google.cloud.functions.v2beta.GenerateUploadUrlResponse.Builder.class); + } + + public static final int UPLOAD_URL_FIELD_NUMBER = 1; + private volatile java.lang.Object uploadUrl_; + /** + * + * + *
+   * The generated Google Cloud Storage signed URL that should be used for a
+   * function source code upload. The uploaded file should be a zip archive
+   * which contains a function.
+   * 
+ * + * string upload_url = 1; + * + * @return The uploadUrl. + */ + @java.lang.Override + public java.lang.String getUploadUrl() { + java.lang.Object ref = uploadUrl_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uploadUrl_ = s; + return s; + } + } + /** + * + * + *
+   * The generated Google Cloud Storage signed URL that should be used for a
+   * function source code upload. The uploaded file should be a zip archive
+   * which contains a function.
+   * 
+ * + * string upload_url = 1; + * + * @return The bytes for uploadUrl. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUploadUrlBytes() { + java.lang.Object ref = uploadUrl_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uploadUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STORAGE_SOURCE_FIELD_NUMBER = 2; + private com.google.cloud.functions.v2beta.StorageSource storageSource_; + /** + * + * + *
+   * The location of the source code in the upload bucket.
+   * Once the archive is uploaded using the `upload_url` use this field to
+   * set the `function.build_config.source.storage_source`
+   * during CreateFunction and UpdateFunction.
+   * Generation defaults to 0, as Cloud Storage provides a new generation only
+   * upon uploading a new object or version of an object.
+   * 
+ * + * .google.cloud.functions.v2beta.StorageSource storage_source = 2; + * + * @return Whether the storageSource field is set. + */ + @java.lang.Override + public boolean hasStorageSource() { + return storageSource_ != null; + } + /** + * + * + *
+   * The location of the source code in the upload bucket.
+   * Once the archive is uploaded using the `upload_url` use this field to
+   * set the `function.build_config.source.storage_source`
+   * during CreateFunction and UpdateFunction.
+   * Generation defaults to 0, as Cloud Storage provides a new generation only
+   * upon uploading a new object or version of an object.
+   * 
+ * + * .google.cloud.functions.v2beta.StorageSource storage_source = 2; + * + * @return The storageSource. + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.StorageSource getStorageSource() { + return storageSource_ == null + ? com.google.cloud.functions.v2beta.StorageSource.getDefaultInstance() + : storageSource_; + } + /** + * + * + *
+   * The location of the source code in the upload bucket.
+   * Once the archive is uploaded using the `upload_url` use this field to
+   * set the `function.build_config.source.storage_source`
+   * during CreateFunction and UpdateFunction.
+   * Generation defaults to 0, as Cloud Storage provides a new generation only
+   * upon uploading a new object or version of an object.
+   * 
+ * + * .google.cloud.functions.v2beta.StorageSource storage_source = 2; + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.StorageSourceOrBuilder getStorageSourceOrBuilder() { + return getStorageSource(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uploadUrl_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uploadUrl_); + } + if (storageSource_ != null) { + output.writeMessage(2, getStorageSource()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uploadUrl_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, uploadUrl_); + } + if (storageSource_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStorageSource()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2beta.GenerateUploadUrlResponse)) { + return super.equals(obj); + } + com.google.cloud.functions.v2beta.GenerateUploadUrlResponse other = + (com.google.cloud.functions.v2beta.GenerateUploadUrlResponse) obj; + + if (!getUploadUrl().equals(other.getUploadUrl())) return false; + if (hasStorageSource() != other.hasStorageSource()) return false; + if (hasStorageSource()) { + if (!getStorageSource().equals(other.getStorageSource())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + UPLOAD_URL_FIELD_NUMBER; + hash = (53 * hash) + getUploadUrl().hashCode(); + if (hasStorageSource()) { + hash = (37 * hash) + STORAGE_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getStorageSource().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2beta.GenerateUploadUrlResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.GenerateUploadUrlResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.GenerateUploadUrlResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.GenerateUploadUrlResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.GenerateUploadUrlResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.GenerateUploadUrlResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.GenerateUploadUrlResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.GenerateUploadUrlResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.GenerateUploadUrlResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.GenerateUploadUrlResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.GenerateUploadUrlResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.GenerateUploadUrlResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.functions.v2beta.GenerateUploadUrlResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response of `GenerateSourceUploadUrl` method.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.GenerateUploadUrlResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2beta.GenerateUploadUrlResponse) + com.google.cloud.functions.v2beta.GenerateUploadUrlResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_GenerateUploadUrlResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_GenerateUploadUrlResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.GenerateUploadUrlResponse.class, + com.google.cloud.functions.v2beta.GenerateUploadUrlResponse.Builder.class); + } + + // Construct using com.google.cloud.functions.v2beta.GenerateUploadUrlResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + uploadUrl_ = ""; + + if (storageSourceBuilder_ == null) { + storageSource_ = null; + } else { + storageSource_ = null; + storageSourceBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_GenerateUploadUrlResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.GenerateUploadUrlResponse getDefaultInstanceForType() { + return com.google.cloud.functions.v2beta.GenerateUploadUrlResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.GenerateUploadUrlResponse build() { + com.google.cloud.functions.v2beta.GenerateUploadUrlResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.GenerateUploadUrlResponse buildPartial() { + com.google.cloud.functions.v2beta.GenerateUploadUrlResponse result = + new com.google.cloud.functions.v2beta.GenerateUploadUrlResponse(this); + result.uploadUrl_ = uploadUrl_; + if (storageSourceBuilder_ == null) { + result.storageSource_ = storageSource_; + } else { + result.storageSource_ = storageSourceBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2beta.GenerateUploadUrlResponse) { + return mergeFrom((com.google.cloud.functions.v2beta.GenerateUploadUrlResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2beta.GenerateUploadUrlResponse other) { + if (other == com.google.cloud.functions.v2beta.GenerateUploadUrlResponse.getDefaultInstance()) + return this; + if (!other.getUploadUrl().isEmpty()) { + uploadUrl_ = other.uploadUrl_; + onChanged(); + } + if (other.hasStorageSource()) { + mergeStorageSource(other.getStorageSource()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2beta.GenerateUploadUrlResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2beta.GenerateUploadUrlResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object uploadUrl_ = ""; + /** + * + * + *
+     * The generated Google Cloud Storage signed URL that should be used for a
+     * function source code upload. The uploaded file should be a zip archive
+     * which contains a function.
+     * 
+ * + * string upload_url = 1; + * + * @return The uploadUrl. + */ + public java.lang.String getUploadUrl() { + java.lang.Object ref = uploadUrl_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uploadUrl_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The generated Google Cloud Storage signed URL that should be used for a
+     * function source code upload. The uploaded file should be a zip archive
+     * which contains a function.
+     * 
+ * + * string upload_url = 1; + * + * @return The bytes for uploadUrl. + */ + public com.google.protobuf.ByteString getUploadUrlBytes() { + java.lang.Object ref = uploadUrl_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uploadUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The generated Google Cloud Storage signed URL that should be used for a
+     * function source code upload. The uploaded file should be a zip archive
+     * which contains a function.
+     * 
+ * + * string upload_url = 1; + * + * @param value The uploadUrl to set. + * @return This builder for chaining. + */ + public Builder setUploadUrl(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + uploadUrl_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The generated Google Cloud Storage signed URL that should be used for a
+     * function source code upload. The uploaded file should be a zip archive
+     * which contains a function.
+     * 
+ * + * string upload_url = 1; + * + * @return This builder for chaining. + */ + public Builder clearUploadUrl() { + + uploadUrl_ = getDefaultInstance().getUploadUrl(); + onChanged(); + return this; + } + /** + * + * + *
+     * The generated Google Cloud Storage signed URL that should be used for a
+     * function source code upload. The uploaded file should be a zip archive
+     * which contains a function.
+     * 
+ * + * string upload_url = 1; + * + * @param value The bytes for uploadUrl to set. + * @return This builder for chaining. + */ + public Builder setUploadUrlBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + uploadUrl_ = value; + onChanged(); + return this; + } + + private com.google.cloud.functions.v2beta.StorageSource storageSource_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2beta.StorageSource, + com.google.cloud.functions.v2beta.StorageSource.Builder, + com.google.cloud.functions.v2beta.StorageSourceOrBuilder> + storageSourceBuilder_; + /** + * + * + *
+     * The location of the source code in the upload bucket.
+     * Once the archive is uploaded using the `upload_url` use this field to
+     * set the `function.build_config.source.storage_source`
+     * during CreateFunction and UpdateFunction.
+     * Generation defaults to 0, as Cloud Storage provides a new generation only
+     * upon uploading a new object or version of an object.
+     * 
+ * + * .google.cloud.functions.v2beta.StorageSource storage_source = 2; + * + * @return Whether the storageSource field is set. + */ + public boolean hasStorageSource() { + return storageSourceBuilder_ != null || storageSource_ != null; + } + /** + * + * + *
+     * The location of the source code in the upload bucket.
+     * Once the archive is uploaded using the `upload_url` use this field to
+     * set the `function.build_config.source.storage_source`
+     * during CreateFunction and UpdateFunction.
+     * Generation defaults to 0, as Cloud Storage provides a new generation only
+     * upon uploading a new object or version of an object.
+     * 
+ * + * .google.cloud.functions.v2beta.StorageSource storage_source = 2; + * + * @return The storageSource. + */ + public com.google.cloud.functions.v2beta.StorageSource getStorageSource() { + if (storageSourceBuilder_ == null) { + return storageSource_ == null + ? com.google.cloud.functions.v2beta.StorageSource.getDefaultInstance() + : storageSource_; + } else { + return storageSourceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The location of the source code in the upload bucket.
+     * Once the archive is uploaded using the `upload_url` use this field to
+     * set the `function.build_config.source.storage_source`
+     * during CreateFunction and UpdateFunction.
+     * Generation defaults to 0, as Cloud Storage provides a new generation only
+     * upon uploading a new object or version of an object.
+     * 
+ * + * .google.cloud.functions.v2beta.StorageSource storage_source = 2; + */ + public Builder setStorageSource(com.google.cloud.functions.v2beta.StorageSource value) { + if (storageSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + storageSource_ = value; + onChanged(); + } else { + storageSourceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The location of the source code in the upload bucket.
+     * Once the archive is uploaded using the `upload_url` use this field to
+     * set the `function.build_config.source.storage_source`
+     * during CreateFunction and UpdateFunction.
+     * Generation defaults to 0, as Cloud Storage provides a new generation only
+     * upon uploading a new object or version of an object.
+     * 
+ * + * .google.cloud.functions.v2beta.StorageSource storage_source = 2; + */ + public Builder setStorageSource( + com.google.cloud.functions.v2beta.StorageSource.Builder builderForValue) { + if (storageSourceBuilder_ == null) { + storageSource_ = builderForValue.build(); + onChanged(); + } else { + storageSourceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The location of the source code in the upload bucket.
+     * Once the archive is uploaded using the `upload_url` use this field to
+     * set the `function.build_config.source.storage_source`
+     * during CreateFunction and UpdateFunction.
+     * Generation defaults to 0, as Cloud Storage provides a new generation only
+     * upon uploading a new object or version of an object.
+     * 
+ * + * .google.cloud.functions.v2beta.StorageSource storage_source = 2; + */ + public Builder mergeStorageSource(com.google.cloud.functions.v2beta.StorageSource value) { + if (storageSourceBuilder_ == null) { + if (storageSource_ != null) { + storageSource_ = + com.google.cloud.functions.v2beta.StorageSource.newBuilder(storageSource_) + .mergeFrom(value) + .buildPartial(); + } else { + storageSource_ = value; + } + onChanged(); + } else { + storageSourceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The location of the source code in the upload bucket.
+     * Once the archive is uploaded using the `upload_url` use this field to
+     * set the `function.build_config.source.storage_source`
+     * during CreateFunction and UpdateFunction.
+     * Generation defaults to 0, as Cloud Storage provides a new generation only
+     * upon uploading a new object or version of an object.
+     * 
+ * + * .google.cloud.functions.v2beta.StorageSource storage_source = 2; + */ + public Builder clearStorageSource() { + if (storageSourceBuilder_ == null) { + storageSource_ = null; + onChanged(); + } else { + storageSource_ = null; + storageSourceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The location of the source code in the upload bucket.
+     * Once the archive is uploaded using the `upload_url` use this field to
+     * set the `function.build_config.source.storage_source`
+     * during CreateFunction and UpdateFunction.
+     * Generation defaults to 0, as Cloud Storage provides a new generation only
+     * upon uploading a new object or version of an object.
+     * 
+ * + * .google.cloud.functions.v2beta.StorageSource storage_source = 2; + */ + public com.google.cloud.functions.v2beta.StorageSource.Builder getStorageSourceBuilder() { + + onChanged(); + return getStorageSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The location of the source code in the upload bucket.
+     * Once the archive is uploaded using the `upload_url` use this field to
+     * set the `function.build_config.source.storage_source`
+     * during CreateFunction and UpdateFunction.
+     * Generation defaults to 0, as Cloud Storage provides a new generation only
+     * upon uploading a new object or version of an object.
+     * 
+ * + * .google.cloud.functions.v2beta.StorageSource storage_source = 2; + */ + public com.google.cloud.functions.v2beta.StorageSourceOrBuilder getStorageSourceOrBuilder() { + if (storageSourceBuilder_ != null) { + return storageSourceBuilder_.getMessageOrBuilder(); + } else { + return storageSource_ == null + ? com.google.cloud.functions.v2beta.StorageSource.getDefaultInstance() + : storageSource_; + } + } + /** + * + * + *
+     * The location of the source code in the upload bucket.
+     * Once the archive is uploaded using the `upload_url` use this field to
+     * set the `function.build_config.source.storage_source`
+     * during CreateFunction and UpdateFunction.
+     * Generation defaults to 0, as Cloud Storage provides a new generation only
+     * upon uploading a new object or version of an object.
+     * 
+ * + * .google.cloud.functions.v2beta.StorageSource storage_source = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2beta.StorageSource, + com.google.cloud.functions.v2beta.StorageSource.Builder, + com.google.cloud.functions.v2beta.StorageSourceOrBuilder> + getStorageSourceFieldBuilder() { + if (storageSourceBuilder_ == null) { + storageSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2beta.StorageSource, + com.google.cloud.functions.v2beta.StorageSource.Builder, + com.google.cloud.functions.v2beta.StorageSourceOrBuilder>( + getStorageSource(), getParentForChildren(), isClean()); + storageSource_ = null; + } + return storageSourceBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2beta.GenerateUploadUrlResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2beta.GenerateUploadUrlResponse) + private static final com.google.cloud.functions.v2beta.GenerateUploadUrlResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2beta.GenerateUploadUrlResponse(); + } + + public static com.google.cloud.functions.v2beta.GenerateUploadUrlResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GenerateUploadUrlResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GenerateUploadUrlResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.GenerateUploadUrlResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/GenerateUploadUrlResponseOrBuilder.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/GenerateUploadUrlResponseOrBuilder.java new file mode 100644 index 00000000..aa64d6b2 --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/GenerateUploadUrlResponseOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +public interface GenerateUploadUrlResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2beta.GenerateUploadUrlResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The generated Google Cloud Storage signed URL that should be used for a
+   * function source code upload. The uploaded file should be a zip archive
+   * which contains a function.
+   * 
+ * + * string upload_url = 1; + * + * @return The uploadUrl. + */ + java.lang.String getUploadUrl(); + /** + * + * + *
+   * The generated Google Cloud Storage signed URL that should be used for a
+   * function source code upload. The uploaded file should be a zip archive
+   * which contains a function.
+   * 
+ * + * string upload_url = 1; + * + * @return The bytes for uploadUrl. + */ + com.google.protobuf.ByteString getUploadUrlBytes(); + + /** + * + * + *
+   * The location of the source code in the upload bucket.
+   * Once the archive is uploaded using the `upload_url` use this field to
+   * set the `function.build_config.source.storage_source`
+   * during CreateFunction and UpdateFunction.
+   * Generation defaults to 0, as Cloud Storage provides a new generation only
+   * upon uploading a new object or version of an object.
+   * 
+ * + * .google.cloud.functions.v2beta.StorageSource storage_source = 2; + * + * @return Whether the storageSource field is set. + */ + boolean hasStorageSource(); + /** + * + * + *
+   * The location of the source code in the upload bucket.
+   * Once the archive is uploaded using the `upload_url` use this field to
+   * set the `function.build_config.source.storage_source`
+   * during CreateFunction and UpdateFunction.
+   * Generation defaults to 0, as Cloud Storage provides a new generation only
+   * upon uploading a new object or version of an object.
+   * 
+ * + * .google.cloud.functions.v2beta.StorageSource storage_source = 2; + * + * @return The storageSource. + */ + com.google.cloud.functions.v2beta.StorageSource getStorageSource(); + /** + * + * + *
+   * The location of the source code in the upload bucket.
+   * Once the archive is uploaded using the `upload_url` use this field to
+   * set the `function.build_config.source.storage_source`
+   * during CreateFunction and UpdateFunction.
+   * Generation defaults to 0, as Cloud Storage provides a new generation only
+   * upon uploading a new object or version of an object.
+   * 
+ * + * .google.cloud.functions.v2beta.StorageSource storage_source = 2; + */ + com.google.cloud.functions.v2beta.StorageSourceOrBuilder getStorageSourceOrBuilder(); +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/GetFunctionRequest.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/GetFunctionRequest.java new file mode 100644 index 00000000..0c37e6ca --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/GetFunctionRequest.java @@ -0,0 +1,652 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +/** + * + * + *
+ * Request for the `GetFunction` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.GetFunctionRequest} + */ +public final class GetFunctionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2beta.GetFunctionRequest) + GetFunctionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetFunctionRequest.newBuilder() to construct. + private GetFunctionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetFunctionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetFunctionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetFunctionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_GetFunctionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_GetFunctionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.GetFunctionRequest.class, + com.google.cloud.functions.v2beta.GetFunctionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the function which details should be obtained.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the function which details should be obtained.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2beta.GetFunctionRequest)) { + return super.equals(obj); + } + com.google.cloud.functions.v2beta.GetFunctionRequest other = + (com.google.cloud.functions.v2beta.GetFunctionRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2beta.GetFunctionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.GetFunctionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.GetFunctionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.GetFunctionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.GetFunctionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.GetFunctionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.GetFunctionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.GetFunctionRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.GetFunctionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.GetFunctionRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.GetFunctionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.GetFunctionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v2beta.GetFunctionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the `GetFunction` method.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.GetFunctionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2beta.GetFunctionRequest) + com.google.cloud.functions.v2beta.GetFunctionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_GetFunctionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_GetFunctionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.GetFunctionRequest.class, + com.google.cloud.functions.v2beta.GetFunctionRequest.Builder.class); + } + + // Construct using com.google.cloud.functions.v2beta.GetFunctionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_GetFunctionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.GetFunctionRequest getDefaultInstanceForType() { + return com.google.cloud.functions.v2beta.GetFunctionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.GetFunctionRequest build() { + com.google.cloud.functions.v2beta.GetFunctionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.GetFunctionRequest buildPartial() { + com.google.cloud.functions.v2beta.GetFunctionRequest result = + new com.google.cloud.functions.v2beta.GetFunctionRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2beta.GetFunctionRequest) { + return mergeFrom((com.google.cloud.functions.v2beta.GetFunctionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2beta.GetFunctionRequest other) { + if (other == com.google.cloud.functions.v2beta.GetFunctionRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2beta.GetFunctionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2beta.GetFunctionRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the function which details should be obtained.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the function which details should be obtained.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the function which details should be obtained.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the function which details should be obtained.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the function which details should be obtained.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2beta.GetFunctionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2beta.GetFunctionRequest) + private static final com.google.cloud.functions.v2beta.GetFunctionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2beta.GetFunctionRequest(); + } + + public static com.google.cloud.functions.v2beta.GetFunctionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetFunctionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetFunctionRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.GetFunctionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/GetFunctionRequestOrBuilder.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/GetFunctionRequestOrBuilder.java new file mode 100644 index 00000000..62e422a4 --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/GetFunctionRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +public interface GetFunctionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2beta.GetFunctionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the function which details should be obtained.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the function which details should be obtained.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/ListFunctionsRequest.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/ListFunctionsRequest.java new file mode 100644 index 00000000..f499d9e1 --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/ListFunctionsRequest.java @@ -0,0 +1,1357 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +/** + * + * + *
+ * Request for the `ListFunctions` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.ListFunctionsRequest} + */ +public final class ListFunctionsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2beta.ListFunctionsRequest) + ListFunctionsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListFunctionsRequest.newBuilder() to construct. + private ListFunctionsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListFunctionsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListFunctionsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListFunctionsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + orderBy_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_ListFunctionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_ListFunctionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.ListFunctionsRequest.class, + com.google.cloud.functions.v2beta.ListFunctionsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The project and location from which the function should be listed,
+   * specified in the format `projects/*/locations/*`
+   * If you want to list functions in all locations, use "-" in place of a
+   * location. When listing functions in all locations, if one or more
+   * location(s) are unreachable, the response will contain functions from all
+   * reachable locations along with the names of any unreachable locations.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The project and location from which the function should be listed,
+   * specified in the format `projects/*/locations/*`
+   * If you want to list functions in all locations, use "-" in place of a
+   * location. When listing functions in all locations, if one or more
+   * location(s) are unreachable, the response will contain functions from all
+   * reachable locations along with the names of any unreachable locations.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * Maximum number of functions to return per call.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The value returned by the last
+   * `ListFunctionsResponse`; indicates that
+   * this is a continuation of a prior `ListFunctions` call, and that the
+   * system should return the next page of data.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The value returned by the last
+   * `ListFunctionsResponse`; indicates that
+   * this is a continuation of a prior `ListFunctions` call, and that the
+   * system should return the next page of data.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * The filter for Functions that match the filter expression,
+   * following the syntax outlined in https://google.aip.dev/160.
+   * 
+ * + * string filter = 4; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * The filter for Functions that match the filter expression,
+   * following the syntax outlined in https://google.aip.dev/160.
+   * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 5; + private volatile java.lang.Object orderBy_; + /** + * + * + *
+   * The sorting order of the resources returned. Value should be a comma
+   * separated list of fields. The default sorting oder is ascending.
+   * See https://google.aip.dev/132#ordering.
+   * 
+ * + * string order_by = 5; + * + * @return The orderBy. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * The sorting order of the resources returned. Value should be a comma
+   * separated list of fields. The default sorting oder is ascending.
+   * See https://google.aip.dev/132#ordering.
+   * 
+ * + * string order_by = 5; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, orderBy_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, orderBy_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2beta.ListFunctionsRequest)) { + return super.equals(obj); + } + com.google.cloud.functions.v2beta.ListFunctionsRequest other = + (com.google.cloud.functions.v2beta.ListFunctionsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2beta.ListFunctionsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.ListFunctionsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.ListFunctionsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.ListFunctionsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.ListFunctionsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.ListFunctionsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.ListFunctionsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.ListFunctionsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.ListFunctionsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.ListFunctionsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.ListFunctionsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.ListFunctionsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.functions.v2beta.ListFunctionsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the `ListFunctions` method.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.ListFunctionsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2beta.ListFunctionsRequest) + com.google.cloud.functions.v2beta.ListFunctionsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_ListFunctionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_ListFunctionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.ListFunctionsRequest.class, + com.google.cloud.functions.v2beta.ListFunctionsRequest.Builder.class); + } + + // Construct using com.google.cloud.functions.v2beta.ListFunctionsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + filter_ = ""; + + orderBy_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_ListFunctionsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.ListFunctionsRequest getDefaultInstanceForType() { + return com.google.cloud.functions.v2beta.ListFunctionsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.ListFunctionsRequest build() { + com.google.cloud.functions.v2beta.ListFunctionsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.ListFunctionsRequest buildPartial() { + com.google.cloud.functions.v2beta.ListFunctionsRequest result = + new com.google.cloud.functions.v2beta.ListFunctionsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.filter_ = filter_; + result.orderBy_ = orderBy_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2beta.ListFunctionsRequest) { + return mergeFrom((com.google.cloud.functions.v2beta.ListFunctionsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2beta.ListFunctionsRequest other) { + if (other == com.google.cloud.functions.v2beta.ListFunctionsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2beta.ListFunctionsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2beta.ListFunctionsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The project and location from which the function should be listed,
+     * specified in the format `projects/*/locations/*`
+     * If you want to list functions in all locations, use "-" in place of a
+     * location. When listing functions in all locations, if one or more
+     * location(s) are unreachable, the response will contain functions from all
+     * reachable locations along with the names of any unreachable locations.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The project and location from which the function should be listed,
+     * specified in the format `projects/*/locations/*`
+     * If you want to list functions in all locations, use "-" in place of a
+     * location. When listing functions in all locations, if one or more
+     * location(s) are unreachable, the response will contain functions from all
+     * reachable locations along with the names of any unreachable locations.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The project and location from which the function should be listed,
+     * specified in the format `projects/*/locations/*`
+     * If you want to list functions in all locations, use "-" in place of a
+     * location. When listing functions in all locations, if one or more
+     * location(s) are unreachable, the response will contain functions from all
+     * reachable locations along with the names of any unreachable locations.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The project and location from which the function should be listed,
+     * specified in the format `projects/*/locations/*`
+     * If you want to list functions in all locations, use "-" in place of a
+     * location. When listing functions in all locations, if one or more
+     * location(s) are unreachable, the response will contain functions from all
+     * reachable locations along with the names of any unreachable locations.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The project and location from which the function should be listed,
+     * specified in the format `projects/*/locations/*`
+     * If you want to list functions in all locations, use "-" in place of a
+     * location. When listing functions in all locations, if one or more
+     * location(s) are unreachable, the response will contain functions from all
+     * reachable locations along with the names of any unreachable locations.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Maximum number of functions to return per call.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Maximum number of functions to return per call.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Maximum number of functions to return per call.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The value returned by the last
+     * `ListFunctionsResponse`; indicates that
+     * this is a continuation of a prior `ListFunctions` call, and that the
+     * system should return the next page of data.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The value returned by the last
+     * `ListFunctionsResponse`; indicates that
+     * this is a continuation of a prior `ListFunctions` call, and that the
+     * system should return the next page of data.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The value returned by the last
+     * `ListFunctionsResponse`; indicates that
+     * this is a continuation of a prior `ListFunctions` call, and that the
+     * system should return the next page of data.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The value returned by the last
+     * `ListFunctionsResponse`; indicates that
+     * this is a continuation of a prior `ListFunctions` call, and that the
+     * system should return the next page of data.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The value returned by the last
+     * `ListFunctionsResponse`; indicates that
+     * this is a continuation of a prior `ListFunctions` call, and that the
+     * system should return the next page of data.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * The filter for Functions that match the filter expression,
+     * following the syntax outlined in https://google.aip.dev/160.
+     * 
+ * + * string filter = 4; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The filter for Functions that match the filter expression,
+     * following the syntax outlined in https://google.aip.dev/160.
+     * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The filter for Functions that match the filter expression,
+     * following the syntax outlined in https://google.aip.dev/160.
+     * 
+ * + * string filter = 4; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The filter for Functions that match the filter expression,
+     * following the syntax outlined in https://google.aip.dev/160.
+     * 
+ * + * string filter = 4; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * The filter for Functions that match the filter expression,
+     * following the syntax outlined in https://google.aip.dev/160.
+     * 
+ * + * string filter = 4; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * The sorting order of the resources returned. Value should be a comma
+     * separated list of fields. The default sorting oder is ascending.
+     * See https://google.aip.dev/132#ordering.
+     * 
+ * + * string order_by = 5; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The sorting order of the resources returned. Value should be a comma
+     * separated list of fields. The default sorting oder is ascending.
+     * See https://google.aip.dev/132#ordering.
+     * 
+ * + * string order_by = 5; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The sorting order of the resources returned. Value should be a comma
+     * separated list of fields. The default sorting oder is ascending.
+     * See https://google.aip.dev/132#ordering.
+     * 
+ * + * string order_by = 5; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + orderBy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The sorting order of the resources returned. Value should be a comma
+     * separated list of fields. The default sorting oder is ascending.
+     * See https://google.aip.dev/132#ordering.
+     * 
+ * + * string order_by = 5; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + + orderBy_ = getDefaultInstance().getOrderBy(); + onChanged(); + return this; + } + /** + * + * + *
+     * The sorting order of the resources returned. Value should be a comma
+     * separated list of fields. The default sorting oder is ascending.
+     * See https://google.aip.dev/132#ordering.
+     * 
+ * + * string order_by = 5; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + orderBy_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2beta.ListFunctionsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2beta.ListFunctionsRequest) + private static final com.google.cloud.functions.v2beta.ListFunctionsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2beta.ListFunctionsRequest(); + } + + public static com.google.cloud.functions.v2beta.ListFunctionsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListFunctionsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListFunctionsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.ListFunctionsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/ListFunctionsRequestOrBuilder.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/ListFunctionsRequestOrBuilder.java new file mode 100644 index 00000000..688096c2 --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/ListFunctionsRequestOrBuilder.java @@ -0,0 +1,164 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +public interface ListFunctionsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2beta.ListFunctionsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The project and location from which the function should be listed,
+   * specified in the format `projects/*/locations/*`
+   * If you want to list functions in all locations, use "-" in place of a
+   * location. When listing functions in all locations, if one or more
+   * location(s) are unreachable, the response will contain functions from all
+   * reachable locations along with the names of any unreachable locations.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The project and location from which the function should be listed,
+   * specified in the format `projects/*/locations/*`
+   * If you want to list functions in all locations, use "-" in place of a
+   * location. When listing functions in all locations, if one or more
+   * location(s) are unreachable, the response will contain functions from all
+   * reachable locations along with the names of any unreachable locations.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Maximum number of functions to return per call.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The value returned by the last
+   * `ListFunctionsResponse`; indicates that
+   * this is a continuation of a prior `ListFunctions` call, and that the
+   * system should return the next page of data.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The value returned by the last
+   * `ListFunctionsResponse`; indicates that
+   * this is a continuation of a prior `ListFunctions` call, and that the
+   * system should return the next page of data.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * The filter for Functions that match the filter expression,
+   * following the syntax outlined in https://google.aip.dev/160.
+   * 
+ * + * string filter = 4; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * The filter for Functions that match the filter expression,
+   * following the syntax outlined in https://google.aip.dev/160.
+   * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * The sorting order of the resources returned. Value should be a comma
+   * separated list of fields. The default sorting oder is ascending.
+   * See https://google.aip.dev/132#ordering.
+   * 
+ * + * string order_by = 5; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * The sorting order of the resources returned. Value should be a comma
+   * separated list of fields. The default sorting oder is ascending.
+   * See https://google.aip.dev/132#ordering.
+   * 
+ * + * string order_by = 5; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/ListFunctionsResponse.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/ListFunctionsResponse.java new file mode 100644 index 00000000..77841b33 --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/ListFunctionsResponse.java @@ -0,0 +1,1429 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +/** + * + * + *
+ * Response for the `ListFunctions` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.ListFunctionsResponse} + */ +public final class ListFunctionsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2beta.ListFunctionsResponse) + ListFunctionsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListFunctionsResponse.newBuilder() to construct. + private ListFunctionsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListFunctionsResponse() { + functions_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListFunctionsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListFunctionsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + functions_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + functions_.add( + input.readMessage( + com.google.cloud.functions.v2beta.Function.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + unreachable_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + functions_ = java.util.Collections.unmodifiableList(functions_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_ListFunctionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_ListFunctionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.ListFunctionsResponse.class, + com.google.cloud.functions.v2beta.ListFunctionsResponse.Builder.class); + } + + public static final int FUNCTIONS_FIELD_NUMBER = 1; + private java.util.List functions_; + /** + * + * + *
+   * The functions that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.Function functions = 1; + */ + @java.lang.Override + public java.util.List getFunctionsList() { + return functions_; + } + /** + * + * + *
+   * The functions that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.Function functions = 1; + */ + @java.lang.Override + public java.util.List + getFunctionsOrBuilderList() { + return functions_; + } + /** + * + * + *
+   * The functions that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.Function functions = 1; + */ + @java.lang.Override + public int getFunctionsCount() { + return functions_.size(); + } + /** + * + * + *
+   * The functions that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.Function functions = 1; + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.Function getFunctions(int index) { + return functions_.get(index); + } + /** + * + * + *
+   * The functions that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.Function functions = 1; + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.FunctionOrBuilder getFunctionsOrBuilder(int index) { + return functions_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UNREACHABLE_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList unreachable_; + /** + * + * + *
+   * Locations that could not be reached. The response does not include any
+   * functions from these locations.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * Locations that could not be reached. The response does not include any
+   * functions from these locations.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * Locations that could not be reached. The response does not include any
+   * functions from these locations.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+   * Locations that could not be reached. The response does not include any
+   * functions from these locations.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < functions_.size(); i++) { + output.writeMessage(1, functions_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < functions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, functions_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2beta.ListFunctionsResponse)) { + return super.equals(obj); + } + com.google.cloud.functions.v2beta.ListFunctionsResponse other = + (com.google.cloud.functions.v2beta.ListFunctionsResponse) obj; + + if (!getFunctionsList().equals(other.getFunctionsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getFunctionsCount() > 0) { + hash = (37 * hash) + FUNCTIONS_FIELD_NUMBER; + hash = (53 * hash) + getFunctionsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2beta.ListFunctionsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.ListFunctionsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.ListFunctionsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.ListFunctionsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.ListFunctionsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.ListFunctionsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.ListFunctionsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.ListFunctionsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.ListFunctionsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.ListFunctionsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.ListFunctionsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.ListFunctionsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.functions.v2beta.ListFunctionsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response for the `ListFunctions` method.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.ListFunctionsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2beta.ListFunctionsResponse) + com.google.cloud.functions.v2beta.ListFunctionsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_ListFunctionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_ListFunctionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.ListFunctionsResponse.class, + com.google.cloud.functions.v2beta.ListFunctionsResponse.Builder.class); + } + + // Construct using com.google.cloud.functions.v2beta.ListFunctionsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getFunctionsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (functionsBuilder_ == null) { + functions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + functionsBuilder_.clear(); + } + nextPageToken_ = ""; + + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_ListFunctionsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.ListFunctionsResponse getDefaultInstanceForType() { + return com.google.cloud.functions.v2beta.ListFunctionsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.ListFunctionsResponse build() { + com.google.cloud.functions.v2beta.ListFunctionsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.ListFunctionsResponse buildPartial() { + com.google.cloud.functions.v2beta.ListFunctionsResponse result = + new com.google.cloud.functions.v2beta.ListFunctionsResponse(this); + int from_bitField0_ = bitField0_; + if (functionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + functions_ = java.util.Collections.unmodifiableList(functions_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.functions_ = functions_; + } else { + result.functions_ = functionsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + if (((bitField0_ & 0x00000002) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.unreachable_ = unreachable_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2beta.ListFunctionsResponse) { + return mergeFrom((com.google.cloud.functions.v2beta.ListFunctionsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2beta.ListFunctionsResponse other) { + if (other == com.google.cloud.functions.v2beta.ListFunctionsResponse.getDefaultInstance()) + return this; + if (functionsBuilder_ == null) { + if (!other.functions_.isEmpty()) { + if (functions_.isEmpty()) { + functions_ = other.functions_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureFunctionsIsMutable(); + functions_.addAll(other.functions_); + } + onChanged(); + } + } else { + if (!other.functions_.isEmpty()) { + if (functionsBuilder_.isEmpty()) { + functionsBuilder_.dispose(); + functionsBuilder_ = null; + functions_ = other.functions_; + bitField0_ = (bitField0_ & ~0x00000001); + functionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getFunctionsFieldBuilder() + : null; + } else { + functionsBuilder_.addAllMessages(other.functions_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2beta.ListFunctionsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2beta.ListFunctionsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List functions_ = + java.util.Collections.emptyList(); + + private void ensureFunctionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + functions_ = + new java.util.ArrayList(functions_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2beta.Function, + com.google.cloud.functions.v2beta.Function.Builder, + com.google.cloud.functions.v2beta.FunctionOrBuilder> + functionsBuilder_; + + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.Function functions = 1; + */ + public java.util.List getFunctionsList() { + if (functionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(functions_); + } else { + return functionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.Function functions = 1; + */ + public int getFunctionsCount() { + if (functionsBuilder_ == null) { + return functions_.size(); + } else { + return functionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.Function functions = 1; + */ + public com.google.cloud.functions.v2beta.Function getFunctions(int index) { + if (functionsBuilder_ == null) { + return functions_.get(index); + } else { + return functionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.Function functions = 1; + */ + public Builder setFunctions(int index, com.google.cloud.functions.v2beta.Function value) { + if (functionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFunctionsIsMutable(); + functions_.set(index, value); + onChanged(); + } else { + functionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.Function functions = 1; + */ + public Builder setFunctions( + int index, com.google.cloud.functions.v2beta.Function.Builder builderForValue) { + if (functionsBuilder_ == null) { + ensureFunctionsIsMutable(); + functions_.set(index, builderForValue.build()); + onChanged(); + } else { + functionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.Function functions = 1; + */ + public Builder addFunctions(com.google.cloud.functions.v2beta.Function value) { + if (functionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFunctionsIsMutable(); + functions_.add(value); + onChanged(); + } else { + functionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.Function functions = 1; + */ + public Builder addFunctions(int index, com.google.cloud.functions.v2beta.Function value) { + if (functionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFunctionsIsMutable(); + functions_.add(index, value); + onChanged(); + } else { + functionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.Function functions = 1; + */ + public Builder addFunctions( + com.google.cloud.functions.v2beta.Function.Builder builderForValue) { + if (functionsBuilder_ == null) { + ensureFunctionsIsMutable(); + functions_.add(builderForValue.build()); + onChanged(); + } else { + functionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.Function functions = 1; + */ + public Builder addFunctions( + int index, com.google.cloud.functions.v2beta.Function.Builder builderForValue) { + if (functionsBuilder_ == null) { + ensureFunctionsIsMutable(); + functions_.add(index, builderForValue.build()); + onChanged(); + } else { + functionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.Function functions = 1; + */ + public Builder addAllFunctions( + java.lang.Iterable values) { + if (functionsBuilder_ == null) { + ensureFunctionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, functions_); + onChanged(); + } else { + functionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.Function functions = 1; + */ + public Builder clearFunctions() { + if (functionsBuilder_ == null) { + functions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + functionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.Function functions = 1; + */ + public Builder removeFunctions(int index) { + if (functionsBuilder_ == null) { + ensureFunctionsIsMutable(); + functions_.remove(index); + onChanged(); + } else { + functionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.Function functions = 1; + */ + public com.google.cloud.functions.v2beta.Function.Builder getFunctionsBuilder(int index) { + return getFunctionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.Function functions = 1; + */ + public com.google.cloud.functions.v2beta.FunctionOrBuilder getFunctionsOrBuilder(int index) { + if (functionsBuilder_ == null) { + return functions_.get(index); + } else { + return functionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.Function functions = 1; + */ + public java.util.List + getFunctionsOrBuilderList() { + if (functionsBuilder_ != null) { + return functionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(functions_); + } + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.Function functions = 1; + */ + public com.google.cloud.functions.v2beta.Function.Builder addFunctionsBuilder() { + return getFunctionsFieldBuilder() + .addBuilder(com.google.cloud.functions.v2beta.Function.getDefaultInstance()); + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.Function functions = 1; + */ + public com.google.cloud.functions.v2beta.Function.Builder addFunctionsBuilder(int index) { + return getFunctionsFieldBuilder() + .addBuilder(index, com.google.cloud.functions.v2beta.Function.getDefaultInstance()); + } + /** + * + * + *
+     * The functions that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.Function functions = 1; + */ + public java.util.List + getFunctionsBuilderList() { + return getFunctionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2beta.Function, + com.google.cloud.functions.v2beta.Function.Builder, + com.google.cloud.functions.v2beta.FunctionOrBuilder> + getFunctionsFieldBuilder() { + if (functionsBuilder_ == null) { + functionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2beta.Function, + com.google.cloud.functions.v2beta.Function.Builder, + com.google.cloud.functions.v2beta.FunctionOrBuilder>( + functions_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + functions_ = null; + } + return functionsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList unreachable_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureUnreachableIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * Locations that could not be reached. The response does not include any
+     * functions from these locations.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_.getUnmodifiableView(); + } + /** + * + * + *
+     * Locations that could not be reached. The response does not include any
+     * functions from these locations.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * Locations that could not be reached. The response does not include any
+     * functions from these locations.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+     * Locations that could not be reached. The response does not include any
+     * functions from these locations.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + /** + * + * + *
+     * Locations that could not be reached. The response does not include any
+     * functions from these locations.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached. The response does not include any
+     * functions from these locations.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached. The response does not include any
+     * functions from these locations.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached. The response does not include any
+     * functions from these locations.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Locations that could not be reached. The response does not include any
+     * functions from these locations.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2beta.ListFunctionsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2beta.ListFunctionsResponse) + private static final com.google.cloud.functions.v2beta.ListFunctionsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2beta.ListFunctionsResponse(); + } + + public static com.google.cloud.functions.v2beta.ListFunctionsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListFunctionsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListFunctionsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.ListFunctionsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/ListFunctionsResponseOrBuilder.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/ListFunctionsResponseOrBuilder.java new file mode 100644 index 00000000..5f7cc8fb --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/ListFunctionsResponseOrBuilder.java @@ -0,0 +1,159 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +public interface ListFunctionsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2beta.ListFunctionsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The functions that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.Function functions = 1; + */ + java.util.List getFunctionsList(); + /** + * + * + *
+   * The functions that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.Function functions = 1; + */ + com.google.cloud.functions.v2beta.Function getFunctions(int index); + /** + * + * + *
+   * The functions that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.Function functions = 1; + */ + int getFunctionsCount(); + /** + * + * + *
+   * The functions that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.Function functions = 1; + */ + java.util.List + getFunctionsOrBuilderList(); + /** + * + * + *
+   * The functions that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.Function functions = 1; + */ + com.google.cloud.functions.v2beta.FunctionOrBuilder getFunctionsOrBuilder(int index); + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Locations that could not be reached. The response does not include any
+   * functions from these locations.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * Locations that could not be reached. The response does not include any
+   * functions from these locations.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * Locations that could not be reached. The response does not include any
+   * functions from these locations.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + /** + * + * + *
+   * Locations that could not be reached. The response does not include any
+   * functions from these locations.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/ListRuntimesRequest.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/ListRuntimesRequest.java new file mode 100644 index 00000000..1b6c934f --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/ListRuntimesRequest.java @@ -0,0 +1,846 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +/** + * + * + *
+ * Request for the `ListRuntimes` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.ListRuntimesRequest} + */ +public final class ListRuntimesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2beta.ListRuntimesRequest) + ListRuntimesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListRuntimesRequest.newBuilder() to construct. + private ListRuntimesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListRuntimesRequest() { + parent_ = ""; + filter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListRuntimesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListRuntimesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_ListRuntimesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_ListRuntimesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.ListRuntimesRequest.class, + com.google.cloud.functions.v2beta.ListRuntimesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The project and location from which the runtimes should be listed,
+   * specified in the format `projects/*/locations/*`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The project and location from which the runtimes should be listed,
+   * specified in the format `projects/*/locations/*`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 2; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * The filter for Runtimes that match the filter expression,
+   * following the syntax outlined in https://google.aip.dev/160.
+   * 
+ * + * string filter = 2; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * The filter for Runtimes that match the filter expression,
+   * following the syntax outlined in https://google.aip.dev/160.
+   * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2beta.ListRuntimesRequest)) { + return super.equals(obj); + } + com.google.cloud.functions.v2beta.ListRuntimesRequest other = + (com.google.cloud.functions.v2beta.ListRuntimesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2beta.ListRuntimesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.ListRuntimesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.ListRuntimesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.ListRuntimesRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.ListRuntimesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.ListRuntimesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.ListRuntimesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.ListRuntimesRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.ListRuntimesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.ListRuntimesRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.ListRuntimesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.ListRuntimesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.functions.v2beta.ListRuntimesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the `ListRuntimes` method.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.ListRuntimesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2beta.ListRuntimesRequest) + com.google.cloud.functions.v2beta.ListRuntimesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_ListRuntimesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_ListRuntimesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.ListRuntimesRequest.class, + com.google.cloud.functions.v2beta.ListRuntimesRequest.Builder.class); + } + + // Construct using com.google.cloud.functions.v2beta.ListRuntimesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + filter_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_ListRuntimesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.ListRuntimesRequest getDefaultInstanceForType() { + return com.google.cloud.functions.v2beta.ListRuntimesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.ListRuntimesRequest build() { + com.google.cloud.functions.v2beta.ListRuntimesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.ListRuntimesRequest buildPartial() { + com.google.cloud.functions.v2beta.ListRuntimesRequest result = + new com.google.cloud.functions.v2beta.ListRuntimesRequest(this); + result.parent_ = parent_; + result.filter_ = filter_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2beta.ListRuntimesRequest) { + return mergeFrom((com.google.cloud.functions.v2beta.ListRuntimesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2beta.ListRuntimesRequest other) { + if (other == com.google.cloud.functions.v2beta.ListRuntimesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2beta.ListRuntimesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2beta.ListRuntimesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The project and location from which the runtimes should be listed,
+     * specified in the format `projects/*/locations/*`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The project and location from which the runtimes should be listed,
+     * specified in the format `projects/*/locations/*`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The project and location from which the runtimes should be listed,
+     * specified in the format `projects/*/locations/*`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The project and location from which the runtimes should be listed,
+     * specified in the format `projects/*/locations/*`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The project and location from which the runtimes should be listed,
+     * specified in the format `projects/*/locations/*`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * The filter for Runtimes that match the filter expression,
+     * following the syntax outlined in https://google.aip.dev/160.
+     * 
+ * + * string filter = 2; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The filter for Runtimes that match the filter expression,
+     * following the syntax outlined in https://google.aip.dev/160.
+     * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The filter for Runtimes that match the filter expression,
+     * following the syntax outlined in https://google.aip.dev/160.
+     * 
+ * + * string filter = 2; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The filter for Runtimes that match the filter expression,
+     * following the syntax outlined in https://google.aip.dev/160.
+     * 
+ * + * string filter = 2; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * The filter for Runtimes that match the filter expression,
+     * following the syntax outlined in https://google.aip.dev/160.
+     * 
+ * + * string filter = 2; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2beta.ListRuntimesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2beta.ListRuntimesRequest) + private static final com.google.cloud.functions.v2beta.ListRuntimesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2beta.ListRuntimesRequest(); + } + + public static com.google.cloud.functions.v2beta.ListRuntimesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListRuntimesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListRuntimesRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.ListRuntimesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/ListRuntimesRequestOrBuilder.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/ListRuntimesRequestOrBuilder.java new file mode 100644 index 00000000..94d1f429 --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/ListRuntimesRequestOrBuilder.java @@ -0,0 +1,83 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +public interface ListRuntimesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2beta.ListRuntimesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The project and location from which the runtimes should be listed,
+   * specified in the format `projects/*/locations/*`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The project and location from which the runtimes should be listed,
+   * specified in the format `projects/*/locations/*`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The filter for Runtimes that match the filter expression,
+   * following the syntax outlined in https://google.aip.dev/160.
+   * 
+ * + * string filter = 2; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * The filter for Runtimes that match the filter expression,
+   * following the syntax outlined in https://google.aip.dev/160.
+   * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/ListRuntimesResponse.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/ListRuntimesResponse.java new file mode 100644 index 00000000..eb333862 --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/ListRuntimesResponse.java @@ -0,0 +1,2803 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +/** + * + * + *
+ * Response for the `ListRuntimes` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.ListRuntimesResponse} + */ +public final class ListRuntimesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2beta.ListRuntimesResponse) + ListRuntimesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListRuntimesResponse.newBuilder() to construct. + private ListRuntimesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListRuntimesResponse() { + runtimes_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListRuntimesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListRuntimesResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + runtimes_ = + new java.util.ArrayList< + com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime>(); + mutable_bitField0_ |= 0x00000001; + } + runtimes_.add( + input.readMessage( + com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime.parser(), + extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + runtimes_ = java.util.Collections.unmodifiableList(runtimes_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_ListRuntimesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_ListRuntimesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.ListRuntimesResponse.class, + com.google.cloud.functions.v2beta.ListRuntimesResponse.Builder.class); + } + + /** + * + * + *
+   * The various stages that a runtime can be in.
+   * 
+ * + * Protobuf enum {@code google.cloud.functions.v2beta.ListRuntimesResponse.RuntimeStage} + */ + public enum RuntimeStage implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not specified.
+     * 
+ * + * RUNTIME_STAGE_UNSPECIFIED = 0; + */ + RUNTIME_STAGE_UNSPECIFIED(0), + /** + * + * + *
+     * The runtime is in development.
+     * 
+ * + * DEVELOPMENT = 1; + */ + DEVELOPMENT(1), + /** + * + * + *
+     * The runtime is in the Alpha stage.
+     * 
+ * + * ALPHA = 2; + */ + ALPHA(2), + /** + * + * + *
+     * The runtime is in the Beta stage.
+     * 
+ * + * BETA = 3; + */ + BETA(3), + /** + * + * + *
+     * The runtime is generally available.
+     * 
+ * + * GA = 4; + */ + GA(4), + /** + * + * + *
+     * The runtime is deprecated.
+     * 
+ * + * DEPRECATED = 5; + */ + DEPRECATED(5), + /** + * + * + *
+     * The runtime is no longer supported.
+     * 
+ * + * DECOMMISSIONED = 6; + */ + DECOMMISSIONED(6), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not specified.
+     * 
+ * + * RUNTIME_STAGE_UNSPECIFIED = 0; + */ + public static final int RUNTIME_STAGE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The runtime is in development.
+     * 
+ * + * DEVELOPMENT = 1; + */ + public static final int DEVELOPMENT_VALUE = 1; + /** + * + * + *
+     * The runtime is in the Alpha stage.
+     * 
+ * + * ALPHA = 2; + */ + public static final int ALPHA_VALUE = 2; + /** + * + * + *
+     * The runtime is in the Beta stage.
+     * 
+ * + * BETA = 3; + */ + public static final int BETA_VALUE = 3; + /** + * + * + *
+     * The runtime is generally available.
+     * 
+ * + * GA = 4; + */ + public static final int GA_VALUE = 4; + /** + * + * + *
+     * The runtime is deprecated.
+     * 
+ * + * DEPRECATED = 5; + */ + public static final int DEPRECATED_VALUE = 5; + /** + * + * + *
+     * The runtime is no longer supported.
+     * 
+ * + * DECOMMISSIONED = 6; + */ + public static final int DECOMMISSIONED_VALUE = 6; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static RuntimeStage valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static RuntimeStage forNumber(int value) { + switch (value) { + case 0: + return RUNTIME_STAGE_UNSPECIFIED; + case 1: + return DEVELOPMENT; + case 2: + return ALPHA; + case 3: + return BETA; + case 4: + return GA; + case 5: + return DEPRECATED; + case 6: + return DECOMMISSIONED; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public RuntimeStage findValueByNumber(int number) { + return RuntimeStage.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.functions.v2beta.ListRuntimesResponse.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final RuntimeStage[] VALUES = values(); + + public static RuntimeStage valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private RuntimeStage(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.functions.v2beta.ListRuntimesResponse.RuntimeStage) + } + + public interface RuntimeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2beta.ListRuntimesResponse.Runtime) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The name of the runtime, e.g., 'go113', 'nodejs12', etc.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+     * The name of the runtime, e.g., 'go113', 'nodejs12', etc.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+     * The user facing name, eg 'Go 1.13', 'Node.js 12', etc.
+     * 
+ * + * string display_name = 5; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+     * The user facing name, eg 'Go 1.13', 'Node.js 12', etc.
+     * 
+ * + * string display_name = 5; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+     * The stage of life this runtime is in, e.g., BETA, GA, etc.
+     * 
+ * + * .google.cloud.functions.v2beta.ListRuntimesResponse.RuntimeStage stage = 2; + * + * @return The enum numeric value on the wire for stage. + */ + int getStageValue(); + /** + * + * + *
+     * The stage of life this runtime is in, e.g., BETA, GA, etc.
+     * 
+ * + * .google.cloud.functions.v2beta.ListRuntimesResponse.RuntimeStage stage = 2; + * + * @return The stage. + */ + com.google.cloud.functions.v2beta.ListRuntimesResponse.RuntimeStage getStage(); + + /** + * + * + *
+     * Warning messages, e.g., a deprecation warning.
+     * 
+ * + * repeated string warnings = 3; + * + * @return A list containing the warnings. + */ + java.util.List getWarningsList(); + /** + * + * + *
+     * Warning messages, e.g., a deprecation warning.
+     * 
+ * + * repeated string warnings = 3; + * + * @return The count of warnings. + */ + int getWarningsCount(); + /** + * + * + *
+     * Warning messages, e.g., a deprecation warning.
+     * 
+ * + * repeated string warnings = 3; + * + * @param index The index of the element to return. + * @return The warnings at the given index. + */ + java.lang.String getWarnings(int index); + /** + * + * + *
+     * Warning messages, e.g., a deprecation warning.
+     * 
+ * + * repeated string warnings = 3; + * + * @param index The index of the value to return. + * @return The bytes of the warnings at the given index. + */ + com.google.protobuf.ByteString getWarningsBytes(int index); + + /** + * + * + *
+     * The environment for the runtime.
+     * 
+ * + * .google.cloud.functions.v2beta.Environment environment = 4; + * + * @return The enum numeric value on the wire for environment. + */ + int getEnvironmentValue(); + /** + * + * + *
+     * The environment for the runtime.
+     * 
+ * + * .google.cloud.functions.v2beta.Environment environment = 4; + * + * @return The environment. + */ + com.google.cloud.functions.v2beta.Environment getEnvironment(); + } + /** + * + * + *
+   * Describes a runtime and any special information (e.g., deprecation status)
+   * related to it.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.ListRuntimesResponse.Runtime} + */ + public static final class Runtime extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2beta.ListRuntimesResponse.Runtime) + RuntimeOrBuilder { + private static final long serialVersionUID = 0L; + // Use Runtime.newBuilder() to construct. + private Runtime(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Runtime() { + name_ = ""; + displayName_ = ""; + stage_ = 0; + warnings_ = com.google.protobuf.LazyStringArrayList.EMPTY; + environment_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Runtime(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Runtime( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 16: + { + int rawValue = input.readEnum(); + + stage_ = rawValue; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + warnings_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + warnings_.add(s); + break; + } + case 32: + { + int rawValue = input.readEnum(); + + environment_ = rawValue; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + warnings_ = warnings_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_ListRuntimesResponse_Runtime_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_ListRuntimesResponse_Runtime_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime.class, + com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+     * The name of the runtime, e.g., 'go113', 'nodejs12', etc.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+     * The name of the runtime, e.g., 'go113', 'nodejs12', etc.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 5; + private volatile java.lang.Object displayName_; + /** + * + * + *
+     * The user facing name, eg 'Go 1.13', 'Node.js 12', etc.
+     * 
+ * + * string display_name = 5; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+     * The user facing name, eg 'Go 1.13', 'Node.js 12', etc.
+     * 
+ * + * string display_name = 5; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STAGE_FIELD_NUMBER = 2; + private int stage_; + /** + * + * + *
+     * The stage of life this runtime is in, e.g., BETA, GA, etc.
+     * 
+ * + * .google.cloud.functions.v2beta.ListRuntimesResponse.RuntimeStage stage = 2; + * + * @return The enum numeric value on the wire for stage. + */ + @java.lang.Override + public int getStageValue() { + return stage_; + } + /** + * + * + *
+     * The stage of life this runtime is in, e.g., BETA, GA, etc.
+     * 
+ * + * .google.cloud.functions.v2beta.ListRuntimesResponse.RuntimeStage stage = 2; + * + * @return The stage. + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.ListRuntimesResponse.RuntimeStage getStage() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2beta.ListRuntimesResponse.RuntimeStage result = + com.google.cloud.functions.v2beta.ListRuntimesResponse.RuntimeStage.valueOf(stage_); + return result == null + ? com.google.cloud.functions.v2beta.ListRuntimesResponse.RuntimeStage.UNRECOGNIZED + : result; + } + + public static final int WARNINGS_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList warnings_; + /** + * + * + *
+     * Warning messages, e.g., a deprecation warning.
+     * 
+ * + * repeated string warnings = 3; + * + * @return A list containing the warnings. + */ + public com.google.protobuf.ProtocolStringList getWarningsList() { + return warnings_; + } + /** + * + * + *
+     * Warning messages, e.g., a deprecation warning.
+     * 
+ * + * repeated string warnings = 3; + * + * @return The count of warnings. + */ + public int getWarningsCount() { + return warnings_.size(); + } + /** + * + * + *
+     * Warning messages, e.g., a deprecation warning.
+     * 
+ * + * repeated string warnings = 3; + * + * @param index The index of the element to return. + * @return The warnings at the given index. + */ + public java.lang.String getWarnings(int index) { + return warnings_.get(index); + } + /** + * + * + *
+     * Warning messages, e.g., a deprecation warning.
+     * 
+ * + * repeated string warnings = 3; + * + * @param index The index of the value to return. + * @return The bytes of the warnings at the given index. + */ + public com.google.protobuf.ByteString getWarningsBytes(int index) { + return warnings_.getByteString(index); + } + + public static final int ENVIRONMENT_FIELD_NUMBER = 4; + private int environment_; + /** + * + * + *
+     * The environment for the runtime.
+     * 
+ * + * .google.cloud.functions.v2beta.Environment environment = 4; + * + * @return The enum numeric value on the wire for environment. + */ + @java.lang.Override + public int getEnvironmentValue() { + return environment_; + } + /** + * + * + *
+     * The environment for the runtime.
+     * 
+ * + * .google.cloud.functions.v2beta.Environment environment = 4; + * + * @return The environment. + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.Environment getEnvironment() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2beta.Environment result = + com.google.cloud.functions.v2beta.Environment.valueOf(environment_); + return result == null ? com.google.cloud.functions.v2beta.Environment.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (stage_ + != com.google.cloud.functions.v2beta.ListRuntimesResponse.RuntimeStage + .RUNTIME_STAGE_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, stage_); + } + for (int i = 0; i < warnings_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, warnings_.getRaw(i)); + } + if (environment_ + != com.google.cloud.functions.v2beta.Environment.ENVIRONMENT_UNSPECIFIED.getNumber()) { + output.writeEnum(4, environment_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, displayName_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (stage_ + != com.google.cloud.functions.v2beta.ListRuntimesResponse.RuntimeStage + .RUNTIME_STAGE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, stage_); + } + { + int dataSize = 0; + for (int i = 0; i < warnings_.size(); i++) { + dataSize += computeStringSizeNoTag(warnings_.getRaw(i)); + } + size += dataSize; + size += 1 * getWarningsList().size(); + } + if (environment_ + != com.google.cloud.functions.v2beta.Environment.ENVIRONMENT_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, environment_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, displayName_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime)) { + return super.equals(obj); + } + com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime other = + (com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (stage_ != other.stage_) return false; + if (!getWarningsList().equals(other.getWarningsList())) return false; + if (environment_ != other.environment_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + STAGE_FIELD_NUMBER; + hash = (53 * hash) + stage_; + if (getWarningsCount() > 0) { + hash = (37 * hash) + WARNINGS_FIELD_NUMBER; + hash = (53 * hash) + getWarningsList().hashCode(); + } + hash = (37 * hash) + ENVIRONMENT_FIELD_NUMBER; + hash = (53 * hash) + environment_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Describes a runtime and any special information (e.g., deprecation status)
+     * related to it.
+     * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.ListRuntimesResponse.Runtime} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2beta.ListRuntimesResponse.Runtime) + com.google.cloud.functions.v2beta.ListRuntimesResponse.RuntimeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_ListRuntimesResponse_Runtime_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_ListRuntimesResponse_Runtime_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime.class, + com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime.Builder.class); + } + + // Construct using com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + displayName_ = ""; + + stage_ = 0; + + warnings_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + environment_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_ListRuntimesResponse_Runtime_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime + getDefaultInstanceForType() { + return com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime build() { + com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime buildPartial() { + com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime result = + new com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.displayName_ = displayName_; + result.stage_ = stage_; + if (((bitField0_ & 0x00000001) != 0)) { + warnings_ = warnings_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.warnings_ = warnings_; + result.environment_ = environment_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime) { + return mergeFrom((com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime other) { + if (other + == com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (other.stage_ != 0) { + setStageValue(other.getStageValue()); + } + if (!other.warnings_.isEmpty()) { + if (warnings_.isEmpty()) { + warnings_ = other.warnings_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureWarningsIsMutable(); + warnings_.addAll(other.warnings_); + } + onChanged(); + } + if (other.environment_ != 0) { + setEnvironmentValue(other.getEnvironmentValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+       * The name of the runtime, e.g., 'go113', 'nodejs12', etc.
+       * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The name of the runtime, e.g., 'go113', 'nodejs12', etc.
+       * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The name of the runtime, e.g., 'go113', 'nodejs12', etc.
+       * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The name of the runtime, e.g., 'go113', 'nodejs12', etc.
+       * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+       * The name of the runtime, e.g., 'go113', 'nodejs12', etc.
+       * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+       * The user facing name, eg 'Go 1.13', 'Node.js 12', etc.
+       * 
+ * + * string display_name = 5; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The user facing name, eg 'Go 1.13', 'Node.js 12', etc.
+       * 
+ * + * string display_name = 5; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The user facing name, eg 'Go 1.13', 'Node.js 12', etc.
+       * 
+ * + * string display_name = 5; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The user facing name, eg 'Go 1.13', 'Node.js 12', etc.
+       * 
+ * + * string display_name = 5; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+       * The user facing name, eg 'Go 1.13', 'Node.js 12', etc.
+       * 
+ * + * string display_name = 5; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private int stage_ = 0; + /** + * + * + *
+       * The stage of life this runtime is in, e.g., BETA, GA, etc.
+       * 
+ * + * .google.cloud.functions.v2beta.ListRuntimesResponse.RuntimeStage stage = 2; + * + * @return The enum numeric value on the wire for stage. + */ + @java.lang.Override + public int getStageValue() { + return stage_; + } + /** + * + * + *
+       * The stage of life this runtime is in, e.g., BETA, GA, etc.
+       * 
+ * + * .google.cloud.functions.v2beta.ListRuntimesResponse.RuntimeStage stage = 2; + * + * @param value The enum numeric value on the wire for stage to set. + * @return This builder for chaining. + */ + public Builder setStageValue(int value) { + + stage_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The stage of life this runtime is in, e.g., BETA, GA, etc.
+       * 
+ * + * .google.cloud.functions.v2beta.ListRuntimesResponse.RuntimeStage stage = 2; + * + * @return The stage. + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.ListRuntimesResponse.RuntimeStage getStage() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2beta.ListRuntimesResponse.RuntimeStage result = + com.google.cloud.functions.v2beta.ListRuntimesResponse.RuntimeStage.valueOf(stage_); + return result == null + ? com.google.cloud.functions.v2beta.ListRuntimesResponse.RuntimeStage.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * The stage of life this runtime is in, e.g., BETA, GA, etc.
+       * 
+ * + * .google.cloud.functions.v2beta.ListRuntimesResponse.RuntimeStage stage = 2; + * + * @param value The stage to set. + * @return This builder for chaining. + */ + public Builder setStage( + com.google.cloud.functions.v2beta.ListRuntimesResponse.RuntimeStage value) { + if (value == null) { + throw new NullPointerException(); + } + + stage_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * The stage of life this runtime is in, e.g., BETA, GA, etc.
+       * 
+ * + * .google.cloud.functions.v2beta.ListRuntimesResponse.RuntimeStage stage = 2; + * + * @return This builder for chaining. + */ + public Builder clearStage() { + + stage_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList warnings_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureWarningsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + warnings_ = new com.google.protobuf.LazyStringArrayList(warnings_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * Warning messages, e.g., a deprecation warning.
+       * 
+ * + * repeated string warnings = 3; + * + * @return A list containing the warnings. + */ + public com.google.protobuf.ProtocolStringList getWarningsList() { + return warnings_.getUnmodifiableView(); + } + /** + * + * + *
+       * Warning messages, e.g., a deprecation warning.
+       * 
+ * + * repeated string warnings = 3; + * + * @return The count of warnings. + */ + public int getWarningsCount() { + return warnings_.size(); + } + /** + * + * + *
+       * Warning messages, e.g., a deprecation warning.
+       * 
+ * + * repeated string warnings = 3; + * + * @param index The index of the element to return. + * @return The warnings at the given index. + */ + public java.lang.String getWarnings(int index) { + return warnings_.get(index); + } + /** + * + * + *
+       * Warning messages, e.g., a deprecation warning.
+       * 
+ * + * repeated string warnings = 3; + * + * @param index The index of the value to return. + * @return The bytes of the warnings at the given index. + */ + public com.google.protobuf.ByteString getWarningsBytes(int index) { + return warnings_.getByteString(index); + } + /** + * + * + *
+       * Warning messages, e.g., a deprecation warning.
+       * 
+ * + * repeated string warnings = 3; + * + * @param index The index to set the value at. + * @param value The warnings to set. + * @return This builder for chaining. + */ + public Builder setWarnings(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureWarningsIsMutable(); + warnings_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Warning messages, e.g., a deprecation warning.
+       * 
+ * + * repeated string warnings = 3; + * + * @param value The warnings to add. + * @return This builder for chaining. + */ + public Builder addWarnings(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureWarningsIsMutable(); + warnings_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Warning messages, e.g., a deprecation warning.
+       * 
+ * + * repeated string warnings = 3; + * + * @param values The warnings to add. + * @return This builder for chaining. + */ + public Builder addAllWarnings(java.lang.Iterable values) { + ensureWarningsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, warnings_); + onChanged(); + return this; + } + /** + * + * + *
+       * Warning messages, e.g., a deprecation warning.
+       * 
+ * + * repeated string warnings = 3; + * + * @return This builder for chaining. + */ + public Builder clearWarnings() { + warnings_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * Warning messages, e.g., a deprecation warning.
+       * 
+ * + * repeated string warnings = 3; + * + * @param value The bytes of the warnings to add. + * @return This builder for chaining. + */ + public Builder addWarningsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureWarningsIsMutable(); + warnings_.add(value); + onChanged(); + return this; + } + + private int environment_ = 0; + /** + * + * + *
+       * The environment for the runtime.
+       * 
+ * + * .google.cloud.functions.v2beta.Environment environment = 4; + * + * @return The enum numeric value on the wire for environment. + */ + @java.lang.Override + public int getEnvironmentValue() { + return environment_; + } + /** + * + * + *
+       * The environment for the runtime.
+       * 
+ * + * .google.cloud.functions.v2beta.Environment environment = 4; + * + * @param value The enum numeric value on the wire for environment to set. + * @return This builder for chaining. + */ + public Builder setEnvironmentValue(int value) { + + environment_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The environment for the runtime.
+       * 
+ * + * .google.cloud.functions.v2beta.Environment environment = 4; + * + * @return The environment. + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.Environment getEnvironment() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2beta.Environment result = + com.google.cloud.functions.v2beta.Environment.valueOf(environment_); + return result == null ? com.google.cloud.functions.v2beta.Environment.UNRECOGNIZED : result; + } + /** + * + * + *
+       * The environment for the runtime.
+       * 
+ * + * .google.cloud.functions.v2beta.Environment environment = 4; + * + * @param value The environment to set. + * @return This builder for chaining. + */ + public Builder setEnvironment(com.google.cloud.functions.v2beta.Environment value) { + if (value == null) { + throw new NullPointerException(); + } + + environment_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * The environment for the runtime.
+       * 
+ * + * .google.cloud.functions.v2beta.Environment environment = 4; + * + * @return This builder for chaining. + */ + public Builder clearEnvironment() { + + environment_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2beta.ListRuntimesResponse.Runtime) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2beta.ListRuntimesResponse.Runtime) + private static final com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime(); + } + + public static com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Runtime parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Runtime(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int RUNTIMES_FIELD_NUMBER = 1; + private java.util.List runtimes_; + /** + * + * + *
+   * The runtimes that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.ListRuntimesResponse.Runtime runtimes = 1; + */ + @java.lang.Override + public java.util.List + getRuntimesList() { + return runtimes_; + } + /** + * + * + *
+   * The runtimes that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.ListRuntimesResponse.Runtime runtimes = 1; + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.functions.v2beta.ListRuntimesResponse.RuntimeOrBuilder> + getRuntimesOrBuilderList() { + return runtimes_; + } + /** + * + * + *
+   * The runtimes that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.ListRuntimesResponse.Runtime runtimes = 1; + */ + @java.lang.Override + public int getRuntimesCount() { + return runtimes_.size(); + } + /** + * + * + *
+   * The runtimes that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.ListRuntimesResponse.Runtime runtimes = 1; + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime getRuntimes(int index) { + return runtimes_.get(index); + } + /** + * + * + *
+   * The runtimes that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.ListRuntimesResponse.Runtime runtimes = 1; + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.ListRuntimesResponse.RuntimeOrBuilder + getRuntimesOrBuilder(int index) { + return runtimes_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < runtimes_.size(); i++) { + output.writeMessage(1, runtimes_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < runtimes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, runtimes_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2beta.ListRuntimesResponse)) { + return super.equals(obj); + } + com.google.cloud.functions.v2beta.ListRuntimesResponse other = + (com.google.cloud.functions.v2beta.ListRuntimesResponse) obj; + + if (!getRuntimesList().equals(other.getRuntimesList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getRuntimesCount() > 0) { + hash = (37 * hash) + RUNTIMES_FIELD_NUMBER; + hash = (53 * hash) + getRuntimesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2beta.ListRuntimesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.ListRuntimesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.ListRuntimesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.ListRuntimesResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.ListRuntimesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.ListRuntimesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.ListRuntimesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.ListRuntimesResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.ListRuntimesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.ListRuntimesResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.ListRuntimesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.ListRuntimesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.functions.v2beta.ListRuntimesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response for the `ListRuntimes` method.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.ListRuntimesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2beta.ListRuntimesResponse) + com.google.cloud.functions.v2beta.ListRuntimesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_ListRuntimesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_ListRuntimesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.ListRuntimesResponse.class, + com.google.cloud.functions.v2beta.ListRuntimesResponse.Builder.class); + } + + // Construct using com.google.cloud.functions.v2beta.ListRuntimesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getRuntimesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (runtimesBuilder_ == null) { + runtimes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + runtimesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_ListRuntimesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.ListRuntimesResponse getDefaultInstanceForType() { + return com.google.cloud.functions.v2beta.ListRuntimesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.ListRuntimesResponse build() { + com.google.cloud.functions.v2beta.ListRuntimesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.ListRuntimesResponse buildPartial() { + com.google.cloud.functions.v2beta.ListRuntimesResponse result = + new com.google.cloud.functions.v2beta.ListRuntimesResponse(this); + int from_bitField0_ = bitField0_; + if (runtimesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + runtimes_ = java.util.Collections.unmodifiableList(runtimes_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.runtimes_ = runtimes_; + } else { + result.runtimes_ = runtimesBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2beta.ListRuntimesResponse) { + return mergeFrom((com.google.cloud.functions.v2beta.ListRuntimesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2beta.ListRuntimesResponse other) { + if (other == com.google.cloud.functions.v2beta.ListRuntimesResponse.getDefaultInstance()) + return this; + if (runtimesBuilder_ == null) { + if (!other.runtimes_.isEmpty()) { + if (runtimes_.isEmpty()) { + runtimes_ = other.runtimes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRuntimesIsMutable(); + runtimes_.addAll(other.runtimes_); + } + onChanged(); + } + } else { + if (!other.runtimes_.isEmpty()) { + if (runtimesBuilder_.isEmpty()) { + runtimesBuilder_.dispose(); + runtimesBuilder_ = null; + runtimes_ = other.runtimes_; + bitField0_ = (bitField0_ & ~0x00000001); + runtimesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getRuntimesFieldBuilder() + : null; + } else { + runtimesBuilder_.addAllMessages(other.runtimes_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2beta.ListRuntimesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2beta.ListRuntimesResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List + runtimes_ = java.util.Collections.emptyList(); + + private void ensureRuntimesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + runtimes_ = + new java.util.ArrayList( + runtimes_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime, + com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime.Builder, + com.google.cloud.functions.v2beta.ListRuntimesResponse.RuntimeOrBuilder> + runtimesBuilder_; + + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + public java.util.List + getRuntimesList() { + if (runtimesBuilder_ == null) { + return java.util.Collections.unmodifiableList(runtimes_); + } else { + return runtimesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + public int getRuntimesCount() { + if (runtimesBuilder_ == null) { + return runtimes_.size(); + } else { + return runtimesBuilder_.getCount(); + } + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + public com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime getRuntimes(int index) { + if (runtimesBuilder_ == null) { + return runtimes_.get(index); + } else { + return runtimesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + public Builder setRuntimes( + int index, com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime value) { + if (runtimesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRuntimesIsMutable(); + runtimes_.set(index, value); + onChanged(); + } else { + runtimesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + public Builder setRuntimes( + int index, + com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime.Builder builderForValue) { + if (runtimesBuilder_ == null) { + ensureRuntimesIsMutable(); + runtimes_.set(index, builderForValue.build()); + onChanged(); + } else { + runtimesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + public Builder addRuntimes( + com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime value) { + if (runtimesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRuntimesIsMutable(); + runtimes_.add(value); + onChanged(); + } else { + runtimesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + public Builder addRuntimes( + int index, com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime value) { + if (runtimesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRuntimesIsMutable(); + runtimes_.add(index, value); + onChanged(); + } else { + runtimesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + public Builder addRuntimes( + com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime.Builder builderForValue) { + if (runtimesBuilder_ == null) { + ensureRuntimesIsMutable(); + runtimes_.add(builderForValue.build()); + onChanged(); + } else { + runtimesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + public Builder addRuntimes( + int index, + com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime.Builder builderForValue) { + if (runtimesBuilder_ == null) { + ensureRuntimesIsMutable(); + runtimes_.add(index, builderForValue.build()); + onChanged(); + } else { + runtimesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + public Builder addAllRuntimes( + java.lang.Iterable + values) { + if (runtimesBuilder_ == null) { + ensureRuntimesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, runtimes_); + onChanged(); + } else { + runtimesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + public Builder clearRuntimes() { + if (runtimesBuilder_ == null) { + runtimes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + runtimesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + public Builder removeRuntimes(int index) { + if (runtimesBuilder_ == null) { + ensureRuntimesIsMutable(); + runtimes_.remove(index); + onChanged(); + } else { + runtimesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + public com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime.Builder + getRuntimesBuilder(int index) { + return getRuntimesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + public com.google.cloud.functions.v2beta.ListRuntimesResponse.RuntimeOrBuilder + getRuntimesOrBuilder(int index) { + if (runtimesBuilder_ == null) { + return runtimes_.get(index); + } else { + return runtimesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + public java.util.List< + ? extends com.google.cloud.functions.v2beta.ListRuntimesResponse.RuntimeOrBuilder> + getRuntimesOrBuilderList() { + if (runtimesBuilder_ != null) { + return runtimesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(runtimes_); + } + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + public com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime.Builder + addRuntimesBuilder() { + return getRuntimesFieldBuilder() + .addBuilder( + com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime.getDefaultInstance()); + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + public com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime.Builder + addRuntimesBuilder(int index) { + return getRuntimesFieldBuilder() + .addBuilder( + index, + com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime.getDefaultInstance()); + } + /** + * + * + *
+     * The runtimes that match the request.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.ListRuntimesResponse.Runtime runtimes = 1; + * + */ + public java.util.List + getRuntimesBuilderList() { + return getRuntimesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime, + com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime.Builder, + com.google.cloud.functions.v2beta.ListRuntimesResponse.RuntimeOrBuilder> + getRuntimesFieldBuilder() { + if (runtimesBuilder_ == null) { + runtimesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime, + com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime.Builder, + com.google.cloud.functions.v2beta.ListRuntimesResponse.RuntimeOrBuilder>( + runtimes_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + runtimes_ = null; + } + return runtimesBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2beta.ListRuntimesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2beta.ListRuntimesResponse) + private static final com.google.cloud.functions.v2beta.ListRuntimesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2beta.ListRuntimesResponse(); + } + + public static com.google.cloud.functions.v2beta.ListRuntimesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListRuntimesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListRuntimesResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.ListRuntimesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/ListRuntimesResponseOrBuilder.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/ListRuntimesResponseOrBuilder.java new file mode 100644 index 00000000..5eca7ed5 --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/ListRuntimesResponseOrBuilder.java @@ -0,0 +1,78 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +public interface ListRuntimesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2beta.ListRuntimesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The runtimes that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.ListRuntimesResponse.Runtime runtimes = 1; + */ + java.util.List getRuntimesList(); + /** + * + * + *
+   * The runtimes that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.ListRuntimesResponse.Runtime runtimes = 1; + */ + com.google.cloud.functions.v2beta.ListRuntimesResponse.Runtime getRuntimes(int index); + /** + * + * + *
+   * The runtimes that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.ListRuntimesResponse.Runtime runtimes = 1; + */ + int getRuntimesCount(); + /** + * + * + *
+   * The runtimes that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.ListRuntimesResponse.Runtime runtimes = 1; + */ + java.util.List + getRuntimesOrBuilderList(); + /** + * + * + *
+   * The runtimes that match the request.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.ListRuntimesResponse.Runtime runtimes = 1; + */ + com.google.cloud.functions.v2beta.ListRuntimesResponse.RuntimeOrBuilder getRuntimesOrBuilder( + int index); +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/LocationName.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/LocationName.java new file mode 100644 index 00000000..637eae92 --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/LocationName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v2beta; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class LocationName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + + @Deprecated + protected LocationName() { + project = null; + location = null; + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LocationName of(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build(); + } + + public static String format(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build().toString(); + } + + public static LocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION.validatedMatch( + formattedString, "LocationName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (LocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION.instantiate("project", project, "location", location); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + LocationName that = ((LocationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for projects/{project}/locations/{location}. */ + public static class Builder { + private String project; + private String location; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder(LocationName locationName) { + this.project = locationName.project; + this.location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/OperationMetadata.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/OperationMetadata.java new file mode 100644 index 00000000..bd115352 --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/OperationMetadata.java @@ -0,0 +1,2582 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +/** + * + * + *
+ * Represents the metadata of the long-running operation.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.OperationMetadata} + */ +public final class OperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2beta.OperationMetadata) + OperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use OperationMetadata.newBuilder() to construct. + private OperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OperationMetadata() { + target_ = ""; + verb_ = ""; + statusDetail_ = ""; + apiVersion_ = ""; + stages_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OperationMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private OperationMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (endTime_ != null) { + subBuilder = endTime_.toBuilder(); + } + endTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endTime_); + endTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + target_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + verb_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + statusDetail_ = s; + break; + } + case 48: + { + cancelRequested_ = input.readBool(); + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + + apiVersion_ = s; + break; + } + case 66: + { + com.google.protobuf.Any.Builder subBuilder = null; + if (requestResource_ != null) { + subBuilder = requestResource_.toBuilder(); + } + requestResource_ = + input.readMessage(com.google.protobuf.Any.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(requestResource_); + requestResource_ = subBuilder.buildPartial(); + } + + break; + } + case 74: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + stages_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + stages_.add( + input.readMessage( + com.google.cloud.functions.v2beta.Stage.parser(), extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + stages_ = java.util.Collections.unmodifiableList(stages_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.OperationMetadata.class, + com.google.cloud.functions.v2beta.OperationMetadata.Builder.class); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int END_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp endTime_; + /** + * + * + *
+   * The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endTime_ != null; + } + /** + * + * + *
+   * The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+   * The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return getEndTime(); + } + + public static final int TARGET_FIELD_NUMBER = 3; + private volatile java.lang.Object target_; + /** + * + * + *
+   * Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3; + * + * @return The target. + */ + @java.lang.Override + public java.lang.String getTarget() { + java.lang.Object ref = target_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + target_ = s; + return s; + } + } + /** + * + * + *
+   * Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3; + * + * @return The bytes for target. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERB_FIELD_NUMBER = 4; + private volatile java.lang.Object verb_; + /** + * + * + *
+   * Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4; + * + * @return The verb. + */ + @java.lang.Override + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + verb_ = s; + return s; + } + } + /** + * + * + *
+   * Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4; + * + * @return The bytes for verb. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATUS_DETAIL_FIELD_NUMBER = 5; + private volatile java.lang.Object statusDetail_; + /** + * + * + *
+   * Human-readable status of the operation, if any.
+   * 
+ * + * string status_detail = 5; + * + * @return The statusDetail. + */ + @java.lang.Override + public java.lang.String getStatusDetail() { + java.lang.Object ref = statusDetail_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + statusDetail_ = s; + return s; + } + } + /** + * + * + *
+   * Human-readable status of the operation, if any.
+   * 
+ * + * string status_detail = 5; + * + * @return The bytes for statusDetail. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStatusDetailBytes() { + java.lang.Object ref = statusDetail_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusDetail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CANCEL_REQUESTED_FIELD_NUMBER = 6; + private boolean cancelRequested_; + /** + * + * + *
+   * Identifies whether the user has requested cancellation
+   * of the operation. Operations that have successfully been cancelled
+   * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+   * corresponding to `Code.CANCELLED`.
+   * 
+ * + * bool cancel_requested = 6; + * + * @return The cancelRequested. + */ + @java.lang.Override + public boolean getCancelRequested() { + return cancelRequested_; + } + + public static final int API_VERSION_FIELD_NUMBER = 7; + private volatile java.lang.Object apiVersion_; + /** + * + * + *
+   * API version used to start the operation.
+   * 
+ * + * string api_version = 7; + * + * @return The apiVersion. + */ + @java.lang.Override + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + apiVersion_ = s; + return s; + } + } + /** + * + * + *
+   * API version used to start the operation.
+   * 
+ * + * string api_version = 7; + * + * @return The bytes for apiVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUEST_RESOURCE_FIELD_NUMBER = 8; + private com.google.protobuf.Any requestResource_; + /** + * + * + *
+   * The original request that started the operation.
+   * 
+ * + * .google.protobuf.Any request_resource = 8; + * + * @return Whether the requestResource field is set. + */ + @java.lang.Override + public boolean hasRequestResource() { + return requestResource_ != null; + } + /** + * + * + *
+   * The original request that started the operation.
+   * 
+ * + * .google.protobuf.Any request_resource = 8; + * + * @return The requestResource. + */ + @java.lang.Override + public com.google.protobuf.Any getRequestResource() { + return requestResource_ == null + ? com.google.protobuf.Any.getDefaultInstance() + : requestResource_; + } + /** + * + * + *
+   * The original request that started the operation.
+   * 
+ * + * .google.protobuf.Any request_resource = 8; + */ + @java.lang.Override + public com.google.protobuf.AnyOrBuilder getRequestResourceOrBuilder() { + return getRequestResource(); + } + + public static final int STAGES_FIELD_NUMBER = 9; + private java.util.List stages_; + /** + * + * + *
+   * Mechanism for reporting in-progress stages
+   * 
+ * + * repeated .google.cloud.functions.v2beta.Stage stages = 9; + */ + @java.lang.Override + public java.util.List getStagesList() { + return stages_; + } + /** + * + * + *
+   * Mechanism for reporting in-progress stages
+   * 
+ * + * repeated .google.cloud.functions.v2beta.Stage stages = 9; + */ + @java.lang.Override + public java.util.List + getStagesOrBuilderList() { + return stages_; + } + /** + * + * + *
+   * Mechanism for reporting in-progress stages
+   * 
+ * + * repeated .google.cloud.functions.v2beta.Stage stages = 9; + */ + @java.lang.Override + public int getStagesCount() { + return stages_.size(); + } + /** + * + * + *
+   * Mechanism for reporting in-progress stages
+   * 
+ * + * repeated .google.cloud.functions.v2beta.Stage stages = 9; + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.Stage getStages(int index) { + return stages_.get(index); + } + /** + * + * + *
+   * Mechanism for reporting in-progress stages
+   * 
+ * + * repeated .google.cloud.functions.v2beta.Stage stages = 9; + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.StageOrBuilder getStagesOrBuilder(int index) { + return stages_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (createTime_ != null) { + output.writeMessage(1, getCreateTime()); + } + if (endTime_ != null) { + output.writeMessage(2, getEndTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(target_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, target_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(verb_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, verb_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(statusDetail_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, statusDetail_); + } + if (cancelRequested_ != false) { + output.writeBool(6, cancelRequested_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiVersion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, apiVersion_); + } + if (requestResource_ != null) { + output.writeMessage(8, getRequestResource()); + } + for (int i = 0; i < stages_.size(); i++) { + output.writeMessage(9, stages_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCreateTime()); + } + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEndTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(target_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, target_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(verb_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, verb_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(statusDetail_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, statusDetail_); + } + if (cancelRequested_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, cancelRequested_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiVersion_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, apiVersion_); + } + if (requestResource_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getRequestResource()); + } + for (int i = 0; i < stages_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, stages_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2beta.OperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.functions.v2beta.OperationMetadata other = + (com.google.cloud.functions.v2beta.OperationMetadata) obj; + + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!getTarget().equals(other.getTarget())) return false; + if (!getVerb().equals(other.getVerb())) return false; + if (!getStatusDetail().equals(other.getStatusDetail())) return false; + if (getCancelRequested() != other.getCancelRequested()) return false; + if (!getApiVersion().equals(other.getApiVersion())) return false; + if (hasRequestResource() != other.hasRequestResource()) return false; + if (hasRequestResource()) { + if (!getRequestResource().equals(other.getRequestResource())) return false; + } + if (!getStagesList().equals(other.getStagesList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (37 * hash) + TARGET_FIELD_NUMBER; + hash = (53 * hash) + getTarget().hashCode(); + hash = (37 * hash) + VERB_FIELD_NUMBER; + hash = (53 * hash) + getVerb().hashCode(); + hash = (37 * hash) + STATUS_DETAIL_FIELD_NUMBER; + hash = (53 * hash) + getStatusDetail().hashCode(); + hash = (37 * hash) + CANCEL_REQUESTED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getCancelRequested()); + hash = (37 * hash) + API_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getApiVersion().hashCode(); + if (hasRequestResource()) { + hash = (37 * hash) + REQUEST_RESOURCE_FIELD_NUMBER; + hash = (53 * hash) + getRequestResource().hashCode(); + } + if (getStagesCount() > 0) { + hash = (37 * hash) + STAGES_FIELD_NUMBER; + hash = (53 * hash) + getStagesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2beta.OperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.OperationMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.OperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.OperationMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.OperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.OperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.OperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.OperationMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.OperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.OperationMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.OperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.OperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v2beta.OperationMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents the metadata of the long-running operation.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.OperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2beta.OperationMetadata) + com.google.cloud.functions.v2beta.OperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.OperationMetadata.class, + com.google.cloud.functions.v2beta.OperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.functions.v2beta.OperationMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getStagesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (endTimeBuilder_ == null) { + endTime_ = null; + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + target_ = ""; + + verb_ = ""; + + statusDetail_ = ""; + + cancelRequested_ = false; + + apiVersion_ = ""; + + if (requestResourceBuilder_ == null) { + requestResource_ = null; + } else { + requestResource_ = null; + requestResourceBuilder_ = null; + } + if (stagesBuilder_ == null) { + stages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + stagesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_OperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.OperationMetadata getDefaultInstanceForType() { + return com.google.cloud.functions.v2beta.OperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.OperationMetadata build() { + com.google.cloud.functions.v2beta.OperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.OperationMetadata buildPartial() { + com.google.cloud.functions.v2beta.OperationMetadata result = + new com.google.cloud.functions.v2beta.OperationMetadata(this); + int from_bitField0_ = bitField0_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (endTimeBuilder_ == null) { + result.endTime_ = endTime_; + } else { + result.endTime_ = endTimeBuilder_.build(); + } + result.target_ = target_; + result.verb_ = verb_; + result.statusDetail_ = statusDetail_; + result.cancelRequested_ = cancelRequested_; + result.apiVersion_ = apiVersion_; + if (requestResourceBuilder_ == null) { + result.requestResource_ = requestResource_; + } else { + result.requestResource_ = requestResourceBuilder_.build(); + } + if (stagesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + stages_ = java.util.Collections.unmodifiableList(stages_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.stages_ = stages_; + } else { + result.stages_ = stagesBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2beta.OperationMetadata) { + return mergeFrom((com.google.cloud.functions.v2beta.OperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2beta.OperationMetadata other) { + if (other == com.google.cloud.functions.v2beta.OperationMetadata.getDefaultInstance()) + return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (!other.getTarget().isEmpty()) { + target_ = other.target_; + onChanged(); + } + if (!other.getVerb().isEmpty()) { + verb_ = other.verb_; + onChanged(); + } + if (!other.getStatusDetail().isEmpty()) { + statusDetail_ = other.statusDetail_; + onChanged(); + } + if (other.getCancelRequested() != false) { + setCancelRequested(other.getCancelRequested()); + } + if (!other.getApiVersion().isEmpty()) { + apiVersion_ = other.apiVersion_; + onChanged(); + } + if (other.hasRequestResource()) { + mergeRequestResource(other.getRequestResource()); + } + if (stagesBuilder_ == null) { + if (!other.stages_.isEmpty()) { + if (stages_.isEmpty()) { + stages_ = other.stages_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureStagesIsMutable(); + stages_.addAll(other.stages_); + } + onChanged(); + } + } else { + if (!other.stages_.isEmpty()) { + if (stagesBuilder_.isEmpty()) { + stagesBuilder_.dispose(); + stagesBuilder_ = null; + stages_ = other.stages_; + bitField0_ = (bitField0_ & ~0x00000001); + stagesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getStagesFieldBuilder() + : null; + } else { + stagesBuilder_.addAllMessages(other.stages_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2beta.OperationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2beta.OperationMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * The time the operation was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return endTimeBuilder_ != null || endTime_ != null; + } + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + onChanged(); + } else { + endTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + onChanged(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (endTime_ != null) { + endTime_ = + com.google.protobuf.Timestamp.newBuilder(endTime_).mergeFrom(value).buildPartial(); + } else { + endTime_ = value; + } + onChanged(); + } else { + endTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder clearEndTime() { + if (endTimeBuilder_ == null) { + endTime_ = null; + onChanged(); + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + * + * + *
+     * The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private java.lang.Object target_ = ""; + /** + * + * + *
+     * Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3; + * + * @return The target. + */ + public java.lang.String getTarget() { + java.lang.Object ref = target_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + target_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3; + * + * @return The bytes for target. + */ + public com.google.protobuf.ByteString getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3; + * + * @param value The target to set. + * @return This builder for chaining. + */ + public Builder setTarget(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + target_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3; + * + * @return This builder for chaining. + */ + public Builder clearTarget() { + + target_ = getDefaultInstance().getTarget(); + onChanged(); + return this; + } + /** + * + * + *
+     * Server-defined resource path for the target of the operation.
+     * 
+ * + * string target = 3; + * + * @param value The bytes for target to set. + * @return This builder for chaining. + */ + public Builder setTargetBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + target_ = value; + onChanged(); + return this; + } + + private java.lang.Object verb_ = ""; + /** + * + * + *
+     * Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4; + * + * @return The verb. + */ + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + verb_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4; + * + * @return The bytes for verb. + */ + public com.google.protobuf.ByteString getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4; + * + * @param value The verb to set. + * @return This builder for chaining. + */ + public Builder setVerb(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + verb_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4; + * + * @return This builder for chaining. + */ + public Builder clearVerb() { + + verb_ = getDefaultInstance().getVerb(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the verb executed by the operation.
+     * 
+ * + * string verb = 4; + * + * @param value The bytes for verb to set. + * @return This builder for chaining. + */ + public Builder setVerbBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + verb_ = value; + onChanged(); + return this; + } + + private java.lang.Object statusDetail_ = ""; + /** + * + * + *
+     * Human-readable status of the operation, if any.
+     * 
+ * + * string status_detail = 5; + * + * @return The statusDetail. + */ + public java.lang.String getStatusDetail() { + java.lang.Object ref = statusDetail_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + statusDetail_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Human-readable status of the operation, if any.
+     * 
+ * + * string status_detail = 5; + * + * @return The bytes for statusDetail. + */ + public com.google.protobuf.ByteString getStatusDetailBytes() { + java.lang.Object ref = statusDetail_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + statusDetail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Human-readable status of the operation, if any.
+     * 
+ * + * string status_detail = 5; + * + * @param value The statusDetail to set. + * @return This builder for chaining. + */ + public Builder setStatusDetail(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + statusDetail_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Human-readable status of the operation, if any.
+     * 
+ * + * string status_detail = 5; + * + * @return This builder for chaining. + */ + public Builder clearStatusDetail() { + + statusDetail_ = getDefaultInstance().getStatusDetail(); + onChanged(); + return this; + } + /** + * + * + *
+     * Human-readable status of the operation, if any.
+     * 
+ * + * string status_detail = 5; + * + * @param value The bytes for statusDetail to set. + * @return This builder for chaining. + */ + public Builder setStatusDetailBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + statusDetail_ = value; + onChanged(); + return this; + } + + private boolean cancelRequested_; + /** + * + * + *
+     * Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+     * corresponding to `Code.CANCELLED`.
+     * 
+ * + * bool cancel_requested = 6; + * + * @return The cancelRequested. + */ + @java.lang.Override + public boolean getCancelRequested() { + return cancelRequested_; + } + /** + * + * + *
+     * Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+     * corresponding to `Code.CANCELLED`.
+     * 
+ * + * bool cancel_requested = 6; + * + * @param value The cancelRequested to set. + * @return This builder for chaining. + */ + public Builder setCancelRequested(boolean value) { + + cancelRequested_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Identifies whether the user has requested cancellation
+     * of the operation. Operations that have successfully been cancelled
+     * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+     * corresponding to `Code.CANCELLED`.
+     * 
+ * + * bool cancel_requested = 6; + * + * @return This builder for chaining. + */ + public Builder clearCancelRequested() { + + cancelRequested_ = false; + onChanged(); + return this; + } + + private java.lang.Object apiVersion_ = ""; + /** + * + * + *
+     * API version used to start the operation.
+     * 
+ * + * string api_version = 7; + * + * @return The apiVersion. + */ + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + apiVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * API version used to start the operation.
+     * 
+ * + * string api_version = 7; + * + * @return The bytes for apiVersion. + */ + public com.google.protobuf.ByteString getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + apiVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * API version used to start the operation.
+     * 
+ * + * string api_version = 7; + * + * @param value The apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + apiVersion_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * API version used to start the operation.
+     * 
+ * + * string api_version = 7; + * + * @return This builder for chaining. + */ + public Builder clearApiVersion() { + + apiVersion_ = getDefaultInstance().getApiVersion(); + onChanged(); + return this; + } + /** + * + * + *
+     * API version used to start the operation.
+     * 
+ * + * string api_version = 7; + * + * @param value The bytes for apiVersion to set. + * @return This builder for chaining. + */ + public Builder setApiVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + apiVersion_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Any requestResource_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + requestResourceBuilder_; + /** + * + * + *
+     * The original request that started the operation.
+     * 
+ * + * .google.protobuf.Any request_resource = 8; + * + * @return Whether the requestResource field is set. + */ + public boolean hasRequestResource() { + return requestResourceBuilder_ != null || requestResource_ != null; + } + /** + * + * + *
+     * The original request that started the operation.
+     * 
+ * + * .google.protobuf.Any request_resource = 8; + * + * @return The requestResource. + */ + public com.google.protobuf.Any getRequestResource() { + if (requestResourceBuilder_ == null) { + return requestResource_ == null + ? com.google.protobuf.Any.getDefaultInstance() + : requestResource_; + } else { + return requestResourceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The original request that started the operation.
+     * 
+ * + * .google.protobuf.Any request_resource = 8; + */ + public Builder setRequestResource(com.google.protobuf.Any value) { + if (requestResourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + requestResource_ = value; + onChanged(); + } else { + requestResourceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The original request that started the operation.
+     * 
+ * + * .google.protobuf.Any request_resource = 8; + */ + public Builder setRequestResource(com.google.protobuf.Any.Builder builderForValue) { + if (requestResourceBuilder_ == null) { + requestResource_ = builderForValue.build(); + onChanged(); + } else { + requestResourceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The original request that started the operation.
+     * 
+ * + * .google.protobuf.Any request_resource = 8; + */ + public Builder mergeRequestResource(com.google.protobuf.Any value) { + if (requestResourceBuilder_ == null) { + if (requestResource_ != null) { + requestResource_ = + com.google.protobuf.Any.newBuilder(requestResource_).mergeFrom(value).buildPartial(); + } else { + requestResource_ = value; + } + onChanged(); + } else { + requestResourceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The original request that started the operation.
+     * 
+ * + * .google.protobuf.Any request_resource = 8; + */ + public Builder clearRequestResource() { + if (requestResourceBuilder_ == null) { + requestResource_ = null; + onChanged(); + } else { + requestResource_ = null; + requestResourceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The original request that started the operation.
+     * 
+ * + * .google.protobuf.Any request_resource = 8; + */ + public com.google.protobuf.Any.Builder getRequestResourceBuilder() { + + onChanged(); + return getRequestResourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The original request that started the operation.
+     * 
+ * + * .google.protobuf.Any request_resource = 8; + */ + public com.google.protobuf.AnyOrBuilder getRequestResourceOrBuilder() { + if (requestResourceBuilder_ != null) { + return requestResourceBuilder_.getMessageOrBuilder(); + } else { + return requestResource_ == null + ? com.google.protobuf.Any.getDefaultInstance() + : requestResource_; + } + } + /** + * + * + *
+     * The original request that started the operation.
+     * 
+ * + * .google.protobuf.Any request_resource = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + getRequestResourceFieldBuilder() { + if (requestResourceBuilder_ == null) { + requestResourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder>( + getRequestResource(), getParentForChildren(), isClean()); + requestResource_ = null; + } + return requestResourceBuilder_; + } + + private java.util.List stages_ = + java.util.Collections.emptyList(); + + private void ensureStagesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + stages_ = new java.util.ArrayList(stages_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2beta.Stage, + com.google.cloud.functions.v2beta.Stage.Builder, + com.google.cloud.functions.v2beta.StageOrBuilder> + stagesBuilder_; + + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2beta.Stage stages = 9; + */ + public java.util.List getStagesList() { + if (stagesBuilder_ == null) { + return java.util.Collections.unmodifiableList(stages_); + } else { + return stagesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2beta.Stage stages = 9; + */ + public int getStagesCount() { + if (stagesBuilder_ == null) { + return stages_.size(); + } else { + return stagesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2beta.Stage stages = 9; + */ + public com.google.cloud.functions.v2beta.Stage getStages(int index) { + if (stagesBuilder_ == null) { + return stages_.get(index); + } else { + return stagesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2beta.Stage stages = 9; + */ + public Builder setStages(int index, com.google.cloud.functions.v2beta.Stage value) { + if (stagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStagesIsMutable(); + stages_.set(index, value); + onChanged(); + } else { + stagesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2beta.Stage stages = 9; + */ + public Builder setStages( + int index, com.google.cloud.functions.v2beta.Stage.Builder builderForValue) { + if (stagesBuilder_ == null) { + ensureStagesIsMutable(); + stages_.set(index, builderForValue.build()); + onChanged(); + } else { + stagesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2beta.Stage stages = 9; + */ + public Builder addStages(com.google.cloud.functions.v2beta.Stage value) { + if (stagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStagesIsMutable(); + stages_.add(value); + onChanged(); + } else { + stagesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2beta.Stage stages = 9; + */ + public Builder addStages(int index, com.google.cloud.functions.v2beta.Stage value) { + if (stagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStagesIsMutable(); + stages_.add(index, value); + onChanged(); + } else { + stagesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2beta.Stage stages = 9; + */ + public Builder addStages(com.google.cloud.functions.v2beta.Stage.Builder builderForValue) { + if (stagesBuilder_ == null) { + ensureStagesIsMutable(); + stages_.add(builderForValue.build()); + onChanged(); + } else { + stagesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2beta.Stage stages = 9; + */ + public Builder addStages( + int index, com.google.cloud.functions.v2beta.Stage.Builder builderForValue) { + if (stagesBuilder_ == null) { + ensureStagesIsMutable(); + stages_.add(index, builderForValue.build()); + onChanged(); + } else { + stagesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2beta.Stage stages = 9; + */ + public Builder addAllStages( + java.lang.Iterable values) { + if (stagesBuilder_ == null) { + ensureStagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, stages_); + onChanged(); + } else { + stagesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2beta.Stage stages = 9; + */ + public Builder clearStages() { + if (stagesBuilder_ == null) { + stages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + stagesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2beta.Stage stages = 9; + */ + public Builder removeStages(int index) { + if (stagesBuilder_ == null) { + ensureStagesIsMutable(); + stages_.remove(index); + onChanged(); + } else { + stagesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2beta.Stage stages = 9; + */ + public com.google.cloud.functions.v2beta.Stage.Builder getStagesBuilder(int index) { + return getStagesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2beta.Stage stages = 9; + */ + public com.google.cloud.functions.v2beta.StageOrBuilder getStagesOrBuilder(int index) { + if (stagesBuilder_ == null) { + return stages_.get(index); + } else { + return stagesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2beta.Stage stages = 9; + */ + public java.util.List + getStagesOrBuilderList() { + if (stagesBuilder_ != null) { + return stagesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(stages_); + } + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2beta.Stage stages = 9; + */ + public com.google.cloud.functions.v2beta.Stage.Builder addStagesBuilder() { + return getStagesFieldBuilder() + .addBuilder(com.google.cloud.functions.v2beta.Stage.getDefaultInstance()); + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2beta.Stage stages = 9; + */ + public com.google.cloud.functions.v2beta.Stage.Builder addStagesBuilder(int index) { + return getStagesFieldBuilder() + .addBuilder(index, com.google.cloud.functions.v2beta.Stage.getDefaultInstance()); + } + /** + * + * + *
+     * Mechanism for reporting in-progress stages
+     * 
+ * + * repeated .google.cloud.functions.v2beta.Stage stages = 9; + */ + public java.util.List getStagesBuilderList() { + return getStagesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2beta.Stage, + com.google.cloud.functions.v2beta.Stage.Builder, + com.google.cloud.functions.v2beta.StageOrBuilder> + getStagesFieldBuilder() { + if (stagesBuilder_ == null) { + stagesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2beta.Stage, + com.google.cloud.functions.v2beta.Stage.Builder, + com.google.cloud.functions.v2beta.StageOrBuilder>( + stages_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + stages_ = null; + } + return stagesBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2beta.OperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2beta.OperationMetadata) + private static final com.google.cloud.functions.v2beta.OperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2beta.OperationMetadata(); + } + + public static com.google.cloud.functions.v2beta.OperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new OperationMetadata(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.OperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/OperationMetadataOrBuilder.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/OperationMetadataOrBuilder.java new file mode 100644 index 00000000..4325905e --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/OperationMetadataOrBuilder.java @@ -0,0 +1,298 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +public interface OperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2beta.OperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + * + * + *
+   * The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+   * The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3; + * + * @return The target. + */ + java.lang.String getTarget(); + /** + * + * + *
+   * Server-defined resource path for the target of the operation.
+   * 
+ * + * string target = 3; + * + * @return The bytes for target. + */ + com.google.protobuf.ByteString getTargetBytes(); + + /** + * + * + *
+   * Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4; + * + * @return The verb. + */ + java.lang.String getVerb(); + /** + * + * + *
+   * Name of the verb executed by the operation.
+   * 
+ * + * string verb = 4; + * + * @return The bytes for verb. + */ + com.google.protobuf.ByteString getVerbBytes(); + + /** + * + * + *
+   * Human-readable status of the operation, if any.
+   * 
+ * + * string status_detail = 5; + * + * @return The statusDetail. + */ + java.lang.String getStatusDetail(); + /** + * + * + *
+   * Human-readable status of the operation, if any.
+   * 
+ * + * string status_detail = 5; + * + * @return The bytes for statusDetail. + */ + com.google.protobuf.ByteString getStatusDetailBytes(); + + /** + * + * + *
+   * Identifies whether the user has requested cancellation
+   * of the operation. Operations that have successfully been cancelled
+   * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
+   * corresponding to `Code.CANCELLED`.
+   * 
+ * + * bool cancel_requested = 6; + * + * @return The cancelRequested. + */ + boolean getCancelRequested(); + + /** + * + * + *
+   * API version used to start the operation.
+   * 
+ * + * string api_version = 7; + * + * @return The apiVersion. + */ + java.lang.String getApiVersion(); + /** + * + * + *
+   * API version used to start the operation.
+   * 
+ * + * string api_version = 7; + * + * @return The bytes for apiVersion. + */ + com.google.protobuf.ByteString getApiVersionBytes(); + + /** + * + * + *
+   * The original request that started the operation.
+   * 
+ * + * .google.protobuf.Any request_resource = 8; + * + * @return Whether the requestResource field is set. + */ + boolean hasRequestResource(); + /** + * + * + *
+   * The original request that started the operation.
+   * 
+ * + * .google.protobuf.Any request_resource = 8; + * + * @return The requestResource. + */ + com.google.protobuf.Any getRequestResource(); + /** + * + * + *
+   * The original request that started the operation.
+   * 
+ * + * .google.protobuf.Any request_resource = 8; + */ + com.google.protobuf.AnyOrBuilder getRequestResourceOrBuilder(); + + /** + * + * + *
+   * Mechanism for reporting in-progress stages
+   * 
+ * + * repeated .google.cloud.functions.v2beta.Stage stages = 9; + */ + java.util.List getStagesList(); + /** + * + * + *
+   * Mechanism for reporting in-progress stages
+   * 
+ * + * repeated .google.cloud.functions.v2beta.Stage stages = 9; + */ + com.google.cloud.functions.v2beta.Stage getStages(int index); + /** + * + * + *
+   * Mechanism for reporting in-progress stages
+   * 
+ * + * repeated .google.cloud.functions.v2beta.Stage stages = 9; + */ + int getStagesCount(); + /** + * + * + *
+   * Mechanism for reporting in-progress stages
+   * 
+ * + * repeated .google.cloud.functions.v2beta.Stage stages = 9; + */ + java.util.List + getStagesOrBuilderList(); + /** + * + * + *
+   * Mechanism for reporting in-progress stages
+   * 
+ * + * repeated .google.cloud.functions.v2beta.Stage stages = 9; + */ + com.google.cloud.functions.v2beta.StageOrBuilder getStagesOrBuilder(int index); +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/RepoSource.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/RepoSource.java new file mode 100644 index 00000000..8071eeaa --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/RepoSource.java @@ -0,0 +1,1936 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +/** + * + * + *
+ * Location of the source in a Google Cloud Source Repository.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.RepoSource} + */ +public final class RepoSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2beta.RepoSource) + RepoSourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use RepoSource.newBuilder() to construct. + private RepoSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RepoSource() { + projectId_ = ""; + repoName_ = ""; + dir_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RepoSource(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RepoSource( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + projectId_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + repoName_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + revisionCase_ = 3; + revision_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + revisionCase_ = 4; + revision_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + revisionCase_ = 5; + revision_ = s; + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + dir_ = s; + break; + } + case 56: + { + invertRegex_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_RepoSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_RepoSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.RepoSource.class, + com.google.cloud.functions.v2beta.RepoSource.Builder.class); + } + + private int revisionCase_ = 0; + private java.lang.Object revision_; + + public enum RevisionCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + BRANCH_NAME(3), + TAG_NAME(4), + COMMIT_SHA(5), + REVISION_NOT_SET(0); + private final int value; + + private RevisionCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static RevisionCase valueOf(int value) { + return forNumber(value); + } + + public static RevisionCase forNumber(int value) { + switch (value) { + case 3: + return BRANCH_NAME; + case 4: + return TAG_NAME; + case 5: + return COMMIT_SHA; + case 0: + return REVISION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public RevisionCase getRevisionCase() { + return RevisionCase.forNumber(revisionCase_); + } + + public static final int BRANCH_NAME_FIELD_NUMBER = 3; + /** + * + * + *
+   * Regex matching branches to build.
+   * The syntax of the regular expressions accepted is the syntax accepted by
+   * RE2 and described at https://github.com/google/re2/wiki/Syntax
+   * 
+ * + * string branch_name = 3; + * + * @return Whether the branchName field is set. + */ + public boolean hasBranchName() { + return revisionCase_ == 3; + } + /** + * + * + *
+   * Regex matching branches to build.
+   * The syntax of the regular expressions accepted is the syntax accepted by
+   * RE2 and described at https://github.com/google/re2/wiki/Syntax
+   * 
+ * + * string branch_name = 3; + * + * @return The branchName. + */ + public java.lang.String getBranchName() { + java.lang.Object ref = ""; + if (revisionCase_ == 3) { + ref = revision_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (revisionCase_ == 3) { + revision_ = s; + } + return s; + } + } + /** + * + * + *
+   * Regex matching branches to build.
+   * The syntax of the regular expressions accepted is the syntax accepted by
+   * RE2 and described at https://github.com/google/re2/wiki/Syntax
+   * 
+ * + * string branch_name = 3; + * + * @return The bytes for branchName. + */ + public com.google.protobuf.ByteString getBranchNameBytes() { + java.lang.Object ref = ""; + if (revisionCase_ == 3) { + ref = revision_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (revisionCase_ == 3) { + revision_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TAG_NAME_FIELD_NUMBER = 4; + /** + * + * + *
+   * Regex matching tags to build.
+   * The syntax of the regular expressions accepted is the syntax accepted by
+   * RE2 and described at https://github.com/google/re2/wiki/Syntax
+   * 
+ * + * string tag_name = 4; + * + * @return Whether the tagName field is set. + */ + public boolean hasTagName() { + return revisionCase_ == 4; + } + /** + * + * + *
+   * Regex matching tags to build.
+   * The syntax of the regular expressions accepted is the syntax accepted by
+   * RE2 and described at https://github.com/google/re2/wiki/Syntax
+   * 
+ * + * string tag_name = 4; + * + * @return The tagName. + */ + public java.lang.String getTagName() { + java.lang.Object ref = ""; + if (revisionCase_ == 4) { + ref = revision_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (revisionCase_ == 4) { + revision_ = s; + } + return s; + } + } + /** + * + * + *
+   * Regex matching tags to build.
+   * The syntax of the regular expressions accepted is the syntax accepted by
+   * RE2 and described at https://github.com/google/re2/wiki/Syntax
+   * 
+ * + * string tag_name = 4; + * + * @return The bytes for tagName. + */ + public com.google.protobuf.ByteString getTagNameBytes() { + java.lang.Object ref = ""; + if (revisionCase_ == 4) { + ref = revision_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (revisionCase_ == 4) { + revision_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int COMMIT_SHA_FIELD_NUMBER = 5; + /** + * + * + *
+   * Explicit commit SHA to build.
+   * 
+ * + * string commit_sha = 5; + * + * @return Whether the commitSha field is set. + */ + public boolean hasCommitSha() { + return revisionCase_ == 5; + } + /** + * + * + *
+   * Explicit commit SHA to build.
+   * 
+ * + * string commit_sha = 5; + * + * @return The commitSha. + */ + public java.lang.String getCommitSha() { + java.lang.Object ref = ""; + if (revisionCase_ == 5) { + ref = revision_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (revisionCase_ == 5) { + revision_ = s; + } + return s; + } + } + /** + * + * + *
+   * Explicit commit SHA to build.
+   * 
+ * + * string commit_sha = 5; + * + * @return The bytes for commitSha. + */ + public com.google.protobuf.ByteString getCommitShaBytes() { + java.lang.Object ref = ""; + if (revisionCase_ == 5) { + ref = revision_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (revisionCase_ == 5) { + revision_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object projectId_; + /** + * + * + *
+   * ID of the project that owns the Cloud Source Repository. If omitted, the
+   * project ID requesting the build is assumed.
+   * 
+ * + * string project_id = 1; + * + * @return The projectId. + */ + @java.lang.Override + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + projectId_ = s; + return s; + } + } + /** + * + * + *
+   * ID of the project that owns the Cloud Source Repository. If omitted, the
+   * project ID requesting the build is assumed.
+   * 
+ * + * string project_id = 1; + * + * @return The bytes for projectId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REPO_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object repoName_; + /** + * + * + *
+   * Name of the Cloud Source Repository.
+   * 
+ * + * string repo_name = 2; + * + * @return The repoName. + */ + @java.lang.Override + public java.lang.String getRepoName() { + java.lang.Object ref = repoName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + repoName_ = s; + return s; + } + } + /** + * + * + *
+   * Name of the Cloud Source Repository.
+   * 
+ * + * string repo_name = 2; + * + * @return The bytes for repoName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRepoNameBytes() { + java.lang.Object ref = repoName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + repoName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DIR_FIELD_NUMBER = 6; + private volatile java.lang.Object dir_; + /** + * + * + *
+   * Directory, relative to the source root, in which to run the build.
+   * This must be a relative path. If a step's `dir` is specified and is an
+   * absolute path, this value is ignored for that step's execution.
+   * eg. helloworld (no leading slash allowed)
+   * 
+ * + * string dir = 6; + * + * @return The dir. + */ + @java.lang.Override + public java.lang.String getDir() { + java.lang.Object ref = dir_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dir_ = s; + return s; + } + } + /** + * + * + *
+   * Directory, relative to the source root, in which to run the build.
+   * This must be a relative path. If a step's `dir` is specified and is an
+   * absolute path, this value is ignored for that step's execution.
+   * eg. helloworld (no leading slash allowed)
+   * 
+ * + * string dir = 6; + * + * @return The bytes for dir. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDirBytes() { + java.lang.Object ref = dir_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dir_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INVERT_REGEX_FIELD_NUMBER = 7; + private boolean invertRegex_; + /** + * + * + *
+   * Only trigger a build if the revision regex does NOT match the revision
+   * regex.
+   * 
+ * + * bool invert_regex = 7; + * + * @return The invertRegex. + */ + @java.lang.Override + public boolean getInvertRegex() { + return invertRegex_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, projectId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(repoName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, repoName_); + } + if (revisionCase_ == 3) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, revision_); + } + if (revisionCase_ == 4) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, revision_); + } + if (revisionCase_ == 5) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, revision_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dir_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, dir_); + } + if (invertRegex_ != false) { + output.writeBool(7, invertRegex_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, projectId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(repoName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, repoName_); + } + if (revisionCase_ == 3) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, revision_); + } + if (revisionCase_ == 4) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, revision_); + } + if (revisionCase_ == 5) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, revision_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dir_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, dir_); + } + if (invertRegex_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(7, invertRegex_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2beta.RepoSource)) { + return super.equals(obj); + } + com.google.cloud.functions.v2beta.RepoSource other = + (com.google.cloud.functions.v2beta.RepoSource) obj; + + if (!getProjectId().equals(other.getProjectId())) return false; + if (!getRepoName().equals(other.getRepoName())) return false; + if (!getDir().equals(other.getDir())) return false; + if (getInvertRegex() != other.getInvertRegex()) return false; + if (!getRevisionCase().equals(other.getRevisionCase())) return false; + switch (revisionCase_) { + case 3: + if (!getBranchName().equals(other.getBranchName())) return false; + break; + case 4: + if (!getTagName().equals(other.getTagName())) return false; + break; + case 5: + if (!getCommitSha().equals(other.getCommitSha())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PROJECT_ID_FIELD_NUMBER; + hash = (53 * hash) + getProjectId().hashCode(); + hash = (37 * hash) + REPO_NAME_FIELD_NUMBER; + hash = (53 * hash) + getRepoName().hashCode(); + hash = (37 * hash) + DIR_FIELD_NUMBER; + hash = (53 * hash) + getDir().hashCode(); + hash = (37 * hash) + INVERT_REGEX_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getInvertRegex()); + switch (revisionCase_) { + case 3: + hash = (37 * hash) + BRANCH_NAME_FIELD_NUMBER; + hash = (53 * hash) + getBranchName().hashCode(); + break; + case 4: + hash = (37 * hash) + TAG_NAME_FIELD_NUMBER; + hash = (53 * hash) + getTagName().hashCode(); + break; + case 5: + hash = (37 * hash) + COMMIT_SHA_FIELD_NUMBER; + hash = (53 * hash) + getCommitSha().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2beta.RepoSource parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.RepoSource parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.RepoSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.RepoSource parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.RepoSource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.RepoSource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.RepoSource parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.RepoSource parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.RepoSource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.RepoSource parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.RepoSource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.RepoSource parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v2beta.RepoSource prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Location of the source in a Google Cloud Source Repository.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.RepoSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2beta.RepoSource) + com.google.cloud.functions.v2beta.RepoSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_RepoSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_RepoSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.RepoSource.class, + com.google.cloud.functions.v2beta.RepoSource.Builder.class); + } + + // Construct using com.google.cloud.functions.v2beta.RepoSource.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + projectId_ = ""; + + repoName_ = ""; + + dir_ = ""; + + invertRegex_ = false; + + revisionCase_ = 0; + revision_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_RepoSource_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.RepoSource getDefaultInstanceForType() { + return com.google.cloud.functions.v2beta.RepoSource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.RepoSource build() { + com.google.cloud.functions.v2beta.RepoSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.RepoSource buildPartial() { + com.google.cloud.functions.v2beta.RepoSource result = + new com.google.cloud.functions.v2beta.RepoSource(this); + if (revisionCase_ == 3) { + result.revision_ = revision_; + } + if (revisionCase_ == 4) { + result.revision_ = revision_; + } + if (revisionCase_ == 5) { + result.revision_ = revision_; + } + result.projectId_ = projectId_; + result.repoName_ = repoName_; + result.dir_ = dir_; + result.invertRegex_ = invertRegex_; + result.revisionCase_ = revisionCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2beta.RepoSource) { + return mergeFrom((com.google.cloud.functions.v2beta.RepoSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2beta.RepoSource other) { + if (other == com.google.cloud.functions.v2beta.RepoSource.getDefaultInstance()) return this; + if (!other.getProjectId().isEmpty()) { + projectId_ = other.projectId_; + onChanged(); + } + if (!other.getRepoName().isEmpty()) { + repoName_ = other.repoName_; + onChanged(); + } + if (!other.getDir().isEmpty()) { + dir_ = other.dir_; + onChanged(); + } + if (other.getInvertRegex() != false) { + setInvertRegex(other.getInvertRegex()); + } + switch (other.getRevisionCase()) { + case BRANCH_NAME: + { + revisionCase_ = 3; + revision_ = other.revision_; + onChanged(); + break; + } + case TAG_NAME: + { + revisionCase_ = 4; + revision_ = other.revision_; + onChanged(); + break; + } + case COMMIT_SHA: + { + revisionCase_ = 5; + revision_ = other.revision_; + onChanged(); + break; + } + case REVISION_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2beta.RepoSource parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v2beta.RepoSource) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int revisionCase_ = 0; + private java.lang.Object revision_; + + public RevisionCase getRevisionCase() { + return RevisionCase.forNumber(revisionCase_); + } + + public Builder clearRevision() { + revisionCase_ = 0; + revision_ = null; + onChanged(); + return this; + } + + /** + * + * + *
+     * Regex matching branches to build.
+     * The syntax of the regular expressions accepted is the syntax accepted by
+     * RE2 and described at https://github.com/google/re2/wiki/Syntax
+     * 
+ * + * string branch_name = 3; + * + * @return Whether the branchName field is set. + */ + @java.lang.Override + public boolean hasBranchName() { + return revisionCase_ == 3; + } + /** + * + * + *
+     * Regex matching branches to build.
+     * The syntax of the regular expressions accepted is the syntax accepted by
+     * RE2 and described at https://github.com/google/re2/wiki/Syntax
+     * 
+ * + * string branch_name = 3; + * + * @return The branchName. + */ + @java.lang.Override + public java.lang.String getBranchName() { + java.lang.Object ref = ""; + if (revisionCase_ == 3) { + ref = revision_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (revisionCase_ == 3) { + revision_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Regex matching branches to build.
+     * The syntax of the regular expressions accepted is the syntax accepted by
+     * RE2 and described at https://github.com/google/re2/wiki/Syntax
+     * 
+ * + * string branch_name = 3; + * + * @return The bytes for branchName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBranchNameBytes() { + java.lang.Object ref = ""; + if (revisionCase_ == 3) { + ref = revision_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (revisionCase_ == 3) { + revision_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Regex matching branches to build.
+     * The syntax of the regular expressions accepted is the syntax accepted by
+     * RE2 and described at https://github.com/google/re2/wiki/Syntax
+     * 
+ * + * string branch_name = 3; + * + * @param value The branchName to set. + * @return This builder for chaining. + */ + public Builder setBranchName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + revisionCase_ = 3; + revision_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Regex matching branches to build.
+     * The syntax of the regular expressions accepted is the syntax accepted by
+     * RE2 and described at https://github.com/google/re2/wiki/Syntax
+     * 
+ * + * string branch_name = 3; + * + * @return This builder for chaining. + */ + public Builder clearBranchName() { + if (revisionCase_ == 3) { + revisionCase_ = 0; + revision_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Regex matching branches to build.
+     * The syntax of the regular expressions accepted is the syntax accepted by
+     * RE2 and described at https://github.com/google/re2/wiki/Syntax
+     * 
+ * + * string branch_name = 3; + * + * @param value The bytes for branchName to set. + * @return This builder for chaining. + */ + public Builder setBranchNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + revisionCase_ = 3; + revision_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Regex matching tags to build.
+     * The syntax of the regular expressions accepted is the syntax accepted by
+     * RE2 and described at https://github.com/google/re2/wiki/Syntax
+     * 
+ * + * string tag_name = 4; + * + * @return Whether the tagName field is set. + */ + @java.lang.Override + public boolean hasTagName() { + return revisionCase_ == 4; + } + /** + * + * + *
+     * Regex matching tags to build.
+     * The syntax of the regular expressions accepted is the syntax accepted by
+     * RE2 and described at https://github.com/google/re2/wiki/Syntax
+     * 
+ * + * string tag_name = 4; + * + * @return The tagName. + */ + @java.lang.Override + public java.lang.String getTagName() { + java.lang.Object ref = ""; + if (revisionCase_ == 4) { + ref = revision_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (revisionCase_ == 4) { + revision_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Regex matching tags to build.
+     * The syntax of the regular expressions accepted is the syntax accepted by
+     * RE2 and described at https://github.com/google/re2/wiki/Syntax
+     * 
+ * + * string tag_name = 4; + * + * @return The bytes for tagName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTagNameBytes() { + java.lang.Object ref = ""; + if (revisionCase_ == 4) { + ref = revision_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (revisionCase_ == 4) { + revision_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Regex matching tags to build.
+     * The syntax of the regular expressions accepted is the syntax accepted by
+     * RE2 and described at https://github.com/google/re2/wiki/Syntax
+     * 
+ * + * string tag_name = 4; + * + * @param value The tagName to set. + * @return This builder for chaining. + */ + public Builder setTagName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + revisionCase_ = 4; + revision_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Regex matching tags to build.
+     * The syntax of the regular expressions accepted is the syntax accepted by
+     * RE2 and described at https://github.com/google/re2/wiki/Syntax
+     * 
+ * + * string tag_name = 4; + * + * @return This builder for chaining. + */ + public Builder clearTagName() { + if (revisionCase_ == 4) { + revisionCase_ = 0; + revision_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Regex matching tags to build.
+     * The syntax of the regular expressions accepted is the syntax accepted by
+     * RE2 and described at https://github.com/google/re2/wiki/Syntax
+     * 
+ * + * string tag_name = 4; + * + * @param value The bytes for tagName to set. + * @return This builder for chaining. + */ + public Builder setTagNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + revisionCase_ = 4; + revision_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Explicit commit SHA to build.
+     * 
+ * + * string commit_sha = 5; + * + * @return Whether the commitSha field is set. + */ + @java.lang.Override + public boolean hasCommitSha() { + return revisionCase_ == 5; + } + /** + * + * + *
+     * Explicit commit SHA to build.
+     * 
+ * + * string commit_sha = 5; + * + * @return The commitSha. + */ + @java.lang.Override + public java.lang.String getCommitSha() { + java.lang.Object ref = ""; + if (revisionCase_ == 5) { + ref = revision_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (revisionCase_ == 5) { + revision_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Explicit commit SHA to build.
+     * 
+ * + * string commit_sha = 5; + * + * @return The bytes for commitSha. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCommitShaBytes() { + java.lang.Object ref = ""; + if (revisionCase_ == 5) { + ref = revision_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (revisionCase_ == 5) { + revision_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Explicit commit SHA to build.
+     * 
+ * + * string commit_sha = 5; + * + * @param value The commitSha to set. + * @return This builder for chaining. + */ + public Builder setCommitSha(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + revisionCase_ = 5; + revision_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Explicit commit SHA to build.
+     * 
+ * + * string commit_sha = 5; + * + * @return This builder for chaining. + */ + public Builder clearCommitSha() { + if (revisionCase_ == 5) { + revisionCase_ = 0; + revision_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Explicit commit SHA to build.
+     * 
+ * + * string commit_sha = 5; + * + * @param value The bytes for commitSha to set. + * @return This builder for chaining. + */ + public Builder setCommitShaBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + revisionCase_ = 5; + revision_ = value; + onChanged(); + return this; + } + + private java.lang.Object projectId_ = ""; + /** + * + * + *
+     * ID of the project that owns the Cloud Source Repository. If omitted, the
+     * project ID requesting the build is assumed.
+     * 
+ * + * string project_id = 1; + * + * @return The projectId. + */ + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + projectId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * ID of the project that owns the Cloud Source Repository. If omitted, the
+     * project ID requesting the build is assumed.
+     * 
+ * + * string project_id = 1; + * + * @return The bytes for projectId. + */ + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * ID of the project that owns the Cloud Source Repository. If omitted, the
+     * project ID requesting the build is assumed.
+     * 
+ * + * string project_id = 1; + * + * @param value The projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + projectId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * ID of the project that owns the Cloud Source Repository. If omitted, the
+     * project ID requesting the build is assumed.
+     * 
+ * + * string project_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearProjectId() { + + projectId_ = getDefaultInstance().getProjectId(); + onChanged(); + return this; + } + /** + * + * + *
+     * ID of the project that owns the Cloud Source Repository. If omitted, the
+     * project ID requesting the build is assumed.
+     * 
+ * + * string project_id = 1; + * + * @param value The bytes for projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + projectId_ = value; + onChanged(); + return this; + } + + private java.lang.Object repoName_ = ""; + /** + * + * + *
+     * Name of the Cloud Source Repository.
+     * 
+ * + * string repo_name = 2; + * + * @return The repoName. + */ + public java.lang.String getRepoName() { + java.lang.Object ref = repoName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + repoName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the Cloud Source Repository.
+     * 
+ * + * string repo_name = 2; + * + * @return The bytes for repoName. + */ + public com.google.protobuf.ByteString getRepoNameBytes() { + java.lang.Object ref = repoName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + repoName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the Cloud Source Repository.
+     * 
+ * + * string repo_name = 2; + * + * @param value The repoName to set. + * @return This builder for chaining. + */ + public Builder setRepoName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + repoName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the Cloud Source Repository.
+     * 
+ * + * string repo_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearRepoName() { + + repoName_ = getDefaultInstance().getRepoName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the Cloud Source Repository.
+     * 
+ * + * string repo_name = 2; + * + * @param value The bytes for repoName to set. + * @return This builder for chaining. + */ + public Builder setRepoNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + repoName_ = value; + onChanged(); + return this; + } + + private java.lang.Object dir_ = ""; + /** + * + * + *
+     * Directory, relative to the source root, in which to run the build.
+     * This must be a relative path. If a step's `dir` is specified and is an
+     * absolute path, this value is ignored for that step's execution.
+     * eg. helloworld (no leading slash allowed)
+     * 
+ * + * string dir = 6; + * + * @return The dir. + */ + public java.lang.String getDir() { + java.lang.Object ref = dir_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dir_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Directory, relative to the source root, in which to run the build.
+     * This must be a relative path. If a step's `dir` is specified and is an
+     * absolute path, this value is ignored for that step's execution.
+     * eg. helloworld (no leading slash allowed)
+     * 
+ * + * string dir = 6; + * + * @return The bytes for dir. + */ + public com.google.protobuf.ByteString getDirBytes() { + java.lang.Object ref = dir_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dir_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Directory, relative to the source root, in which to run the build.
+     * This must be a relative path. If a step's `dir` is specified and is an
+     * absolute path, this value is ignored for that step's execution.
+     * eg. helloworld (no leading slash allowed)
+     * 
+ * + * string dir = 6; + * + * @param value The dir to set. + * @return This builder for chaining. + */ + public Builder setDir(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + dir_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Directory, relative to the source root, in which to run the build.
+     * This must be a relative path. If a step's `dir` is specified and is an
+     * absolute path, this value is ignored for that step's execution.
+     * eg. helloworld (no leading slash allowed)
+     * 
+ * + * string dir = 6; + * + * @return This builder for chaining. + */ + public Builder clearDir() { + + dir_ = getDefaultInstance().getDir(); + onChanged(); + return this; + } + /** + * + * + *
+     * Directory, relative to the source root, in which to run the build.
+     * This must be a relative path. If a step's `dir` is specified and is an
+     * absolute path, this value is ignored for that step's execution.
+     * eg. helloworld (no leading slash allowed)
+     * 
+ * + * string dir = 6; + * + * @param value The bytes for dir to set. + * @return This builder for chaining. + */ + public Builder setDirBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + dir_ = value; + onChanged(); + return this; + } + + private boolean invertRegex_; + /** + * + * + *
+     * Only trigger a build if the revision regex does NOT match the revision
+     * regex.
+     * 
+ * + * bool invert_regex = 7; + * + * @return The invertRegex. + */ + @java.lang.Override + public boolean getInvertRegex() { + return invertRegex_; + } + /** + * + * + *
+     * Only trigger a build if the revision regex does NOT match the revision
+     * regex.
+     * 
+ * + * bool invert_regex = 7; + * + * @param value The invertRegex to set. + * @return This builder for chaining. + */ + public Builder setInvertRegex(boolean value) { + + invertRegex_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Only trigger a build if the revision regex does NOT match the revision
+     * regex.
+     * 
+ * + * bool invert_regex = 7; + * + * @return This builder for chaining. + */ + public Builder clearInvertRegex() { + + invertRegex_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2beta.RepoSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2beta.RepoSource) + private static final com.google.cloud.functions.v2beta.RepoSource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2beta.RepoSource(); + } + + public static com.google.cloud.functions.v2beta.RepoSource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RepoSource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RepoSource(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.RepoSource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/RepoSourceOrBuilder.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/RepoSourceOrBuilder.java new file mode 100644 index 00000000..1b000682 --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/RepoSourceOrBuilder.java @@ -0,0 +1,247 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +public interface RepoSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2beta.RepoSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Regex matching branches to build.
+   * The syntax of the regular expressions accepted is the syntax accepted by
+   * RE2 and described at https://github.com/google/re2/wiki/Syntax
+   * 
+ * + * string branch_name = 3; + * + * @return Whether the branchName field is set. + */ + boolean hasBranchName(); + /** + * + * + *
+   * Regex matching branches to build.
+   * The syntax of the regular expressions accepted is the syntax accepted by
+   * RE2 and described at https://github.com/google/re2/wiki/Syntax
+   * 
+ * + * string branch_name = 3; + * + * @return The branchName. + */ + java.lang.String getBranchName(); + /** + * + * + *
+   * Regex matching branches to build.
+   * The syntax of the regular expressions accepted is the syntax accepted by
+   * RE2 and described at https://github.com/google/re2/wiki/Syntax
+   * 
+ * + * string branch_name = 3; + * + * @return The bytes for branchName. + */ + com.google.protobuf.ByteString getBranchNameBytes(); + + /** + * + * + *
+   * Regex matching tags to build.
+   * The syntax of the regular expressions accepted is the syntax accepted by
+   * RE2 and described at https://github.com/google/re2/wiki/Syntax
+   * 
+ * + * string tag_name = 4; + * + * @return Whether the tagName field is set. + */ + boolean hasTagName(); + /** + * + * + *
+   * Regex matching tags to build.
+   * The syntax of the regular expressions accepted is the syntax accepted by
+   * RE2 and described at https://github.com/google/re2/wiki/Syntax
+   * 
+ * + * string tag_name = 4; + * + * @return The tagName. + */ + java.lang.String getTagName(); + /** + * + * + *
+   * Regex matching tags to build.
+   * The syntax of the regular expressions accepted is the syntax accepted by
+   * RE2 and described at https://github.com/google/re2/wiki/Syntax
+   * 
+ * + * string tag_name = 4; + * + * @return The bytes for tagName. + */ + com.google.protobuf.ByteString getTagNameBytes(); + + /** + * + * + *
+   * Explicit commit SHA to build.
+   * 
+ * + * string commit_sha = 5; + * + * @return Whether the commitSha field is set. + */ + boolean hasCommitSha(); + /** + * + * + *
+   * Explicit commit SHA to build.
+   * 
+ * + * string commit_sha = 5; + * + * @return The commitSha. + */ + java.lang.String getCommitSha(); + /** + * + * + *
+   * Explicit commit SHA to build.
+   * 
+ * + * string commit_sha = 5; + * + * @return The bytes for commitSha. + */ + com.google.protobuf.ByteString getCommitShaBytes(); + + /** + * + * + *
+   * ID of the project that owns the Cloud Source Repository. If omitted, the
+   * project ID requesting the build is assumed.
+   * 
+ * + * string project_id = 1; + * + * @return The projectId. + */ + java.lang.String getProjectId(); + /** + * + * + *
+   * ID of the project that owns the Cloud Source Repository. If omitted, the
+   * project ID requesting the build is assumed.
+   * 
+ * + * string project_id = 1; + * + * @return The bytes for projectId. + */ + com.google.protobuf.ByteString getProjectIdBytes(); + + /** + * + * + *
+   * Name of the Cloud Source Repository.
+   * 
+ * + * string repo_name = 2; + * + * @return The repoName. + */ + java.lang.String getRepoName(); + /** + * + * + *
+   * Name of the Cloud Source Repository.
+   * 
+ * + * string repo_name = 2; + * + * @return The bytes for repoName. + */ + com.google.protobuf.ByteString getRepoNameBytes(); + + /** + * + * + *
+   * Directory, relative to the source root, in which to run the build.
+   * This must be a relative path. If a step's `dir` is specified and is an
+   * absolute path, this value is ignored for that step's execution.
+   * eg. helloworld (no leading slash allowed)
+   * 
+ * + * string dir = 6; + * + * @return The dir. + */ + java.lang.String getDir(); + /** + * + * + *
+   * Directory, relative to the source root, in which to run the build.
+   * This must be a relative path. If a step's `dir` is specified and is an
+   * absolute path, this value is ignored for that step's execution.
+   * eg. helloworld (no leading slash allowed)
+   * 
+ * + * string dir = 6; + * + * @return The bytes for dir. + */ + com.google.protobuf.ByteString getDirBytes(); + + /** + * + * + *
+   * Only trigger a build if the revision regex does NOT match the revision
+   * regex.
+   * 
+ * + * bool invert_regex = 7; + * + * @return The invertRegex. + */ + boolean getInvertRegex(); + + public com.google.cloud.functions.v2beta.RepoSource.RevisionCase getRevisionCase(); +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/SecretEnvVar.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/SecretEnvVar.java new file mode 100644 index 00000000..162e600c --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/SecretEnvVar.java @@ -0,0 +1,1212 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +/** + * + * + *
+ * Configuration for a secret environment variable. It has the information
+ * necessary to fetch the secret value from secret manager and expose it as an
+ * environment variable.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.SecretEnvVar} + */ +public final class SecretEnvVar extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2beta.SecretEnvVar) + SecretEnvVarOrBuilder { + private static final long serialVersionUID = 0L; + // Use SecretEnvVar.newBuilder() to construct. + private SecretEnvVar(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SecretEnvVar() { + key_ = ""; + projectId_ = ""; + secret_ = ""; + version_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SecretEnvVar(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SecretEnvVar( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + key_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + projectId_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + secret_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + version_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_SecretEnvVar_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_SecretEnvVar_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.SecretEnvVar.class, + com.google.cloud.functions.v2beta.SecretEnvVar.Builder.class); + } + + public static final int KEY_FIELD_NUMBER = 1; + private volatile java.lang.Object key_; + /** + * + * + *
+   * Name of the environment variable.
+   * 
+ * + * string key = 1; + * + * @return The key. + */ + @java.lang.Override + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } + } + /** + * + * + *
+   * Name of the environment variable.
+   * 
+ * + * string key = 1; + * + * @return The bytes for key. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object projectId_; + /** + * + * + *
+   * Project identifier (preferably project number but can also be the
+   * project ID) of the project that contains the secret. If not set, it is
+   * assumed that the secret is in the same project as the function.
+   * 
+ * + * string project_id = 2; + * + * @return The projectId. + */ + @java.lang.Override + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + projectId_ = s; + return s; + } + } + /** + * + * + *
+   * Project identifier (preferably project number but can also be the
+   * project ID) of the project that contains the secret. If not set, it is
+   * assumed that the secret is in the same project as the function.
+   * 
+ * + * string project_id = 2; + * + * @return The bytes for projectId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SECRET_FIELD_NUMBER = 3; + private volatile java.lang.Object secret_; + /** + * + * + *
+   * Name of the secret in secret manager (not the full resource name).
+   * 
+ * + * string secret = 3; + * + * @return The secret. + */ + @java.lang.Override + public java.lang.String getSecret() { + java.lang.Object ref = secret_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + secret_ = s; + return s; + } + } + /** + * + * + *
+   * Name of the secret in secret manager (not the full resource name).
+   * 
+ * + * string secret = 3; + * + * @return The bytes for secret. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSecretBytes() { + java.lang.Object ref = secret_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + secret_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERSION_FIELD_NUMBER = 4; + private volatile java.lang.Object version_; + /** + * + * + *
+   * Version of the secret (version number or the string 'latest'). It is
+   * recommended to use a numeric version for secret environment variables as
+   * any updates to the secret value is not reflected until new instances
+   * start.
+   * 
+ * + * string version = 4; + * + * @return The version. + */ + @java.lang.Override + public java.lang.String getVersion() { + java.lang.Object ref = version_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + version_ = s; + return s; + } + } + /** + * + * + *
+   * Version of the secret (version number or the string 'latest'). It is
+   * recommended to use a numeric version for secret environment variables as
+   * any updates to the secret value is not reflected until new instances
+   * start.
+   * 
+ * + * string version = 4; + * + * @return The bytes for version. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(key_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, projectId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(secret_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, secret_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(version_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, version_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(key_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, projectId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(secret_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, secret_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(version_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, version_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2beta.SecretEnvVar)) { + return super.equals(obj); + } + com.google.cloud.functions.v2beta.SecretEnvVar other = + (com.google.cloud.functions.v2beta.SecretEnvVar) obj; + + if (!getKey().equals(other.getKey())) return false; + if (!getProjectId().equals(other.getProjectId())) return false; + if (!getSecret().equals(other.getSecret())) return false; + if (!getVersion().equals(other.getVersion())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + hash = (37 * hash) + PROJECT_ID_FIELD_NUMBER; + hash = (53 * hash) + getProjectId().hashCode(); + hash = (37 * hash) + SECRET_FIELD_NUMBER; + hash = (53 * hash) + getSecret().hashCode(); + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2beta.SecretEnvVar parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.SecretEnvVar parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.SecretEnvVar parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.SecretEnvVar parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.SecretEnvVar parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.SecretEnvVar parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.SecretEnvVar parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.SecretEnvVar parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.SecretEnvVar parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.SecretEnvVar parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.SecretEnvVar parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.SecretEnvVar parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v2beta.SecretEnvVar prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Configuration for a secret environment variable. It has the information
+   * necessary to fetch the secret value from secret manager and expose it as an
+   * environment variable.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.SecretEnvVar} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2beta.SecretEnvVar) + com.google.cloud.functions.v2beta.SecretEnvVarOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_SecretEnvVar_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_SecretEnvVar_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.SecretEnvVar.class, + com.google.cloud.functions.v2beta.SecretEnvVar.Builder.class); + } + + // Construct using com.google.cloud.functions.v2beta.SecretEnvVar.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + key_ = ""; + + projectId_ = ""; + + secret_ = ""; + + version_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_SecretEnvVar_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.SecretEnvVar getDefaultInstanceForType() { + return com.google.cloud.functions.v2beta.SecretEnvVar.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.SecretEnvVar build() { + com.google.cloud.functions.v2beta.SecretEnvVar result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.SecretEnvVar buildPartial() { + com.google.cloud.functions.v2beta.SecretEnvVar result = + new com.google.cloud.functions.v2beta.SecretEnvVar(this); + result.key_ = key_; + result.projectId_ = projectId_; + result.secret_ = secret_; + result.version_ = version_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2beta.SecretEnvVar) { + return mergeFrom((com.google.cloud.functions.v2beta.SecretEnvVar) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2beta.SecretEnvVar other) { + if (other == com.google.cloud.functions.v2beta.SecretEnvVar.getDefaultInstance()) return this; + if (!other.getKey().isEmpty()) { + key_ = other.key_; + onChanged(); + } + if (!other.getProjectId().isEmpty()) { + projectId_ = other.projectId_; + onChanged(); + } + if (!other.getSecret().isEmpty()) { + secret_ = other.secret_; + onChanged(); + } + if (!other.getVersion().isEmpty()) { + version_ = other.version_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2beta.SecretEnvVar parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v2beta.SecretEnvVar) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object key_ = ""; + /** + * + * + *
+     * Name of the environment variable.
+     * 
+ * + * string key = 1; + * + * @return The key. + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the environment variable.
+     * 
+ * + * string key = 1; + * + * @return The bytes for key. + */ + public com.google.protobuf.ByteString getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the environment variable.
+     * 
+ * + * string key = 1; + * + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + key_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the environment variable.
+     * 
+ * + * string key = 1; + * + * @return This builder for chaining. + */ + public Builder clearKey() { + + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the environment variable.
+     * 
+ * + * string key = 1; + * + * @param value The bytes for key to set. + * @return This builder for chaining. + */ + public Builder setKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + key_ = value; + onChanged(); + return this; + } + + private java.lang.Object projectId_ = ""; + /** + * + * + *
+     * Project identifier (preferably project number but can also be the
+     * project ID) of the project that contains the secret. If not set, it is
+     * assumed that the secret is in the same project as the function.
+     * 
+ * + * string project_id = 2; + * + * @return The projectId. + */ + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + projectId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Project identifier (preferably project number but can also be the
+     * project ID) of the project that contains the secret. If not set, it is
+     * assumed that the secret is in the same project as the function.
+     * 
+ * + * string project_id = 2; + * + * @return The bytes for projectId. + */ + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Project identifier (preferably project number but can also be the
+     * project ID) of the project that contains the secret. If not set, it is
+     * assumed that the secret is in the same project as the function.
+     * 
+ * + * string project_id = 2; + * + * @param value The projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + projectId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Project identifier (preferably project number but can also be the
+     * project ID) of the project that contains the secret. If not set, it is
+     * assumed that the secret is in the same project as the function.
+     * 
+ * + * string project_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearProjectId() { + + projectId_ = getDefaultInstance().getProjectId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Project identifier (preferably project number but can also be the
+     * project ID) of the project that contains the secret. If not set, it is
+     * assumed that the secret is in the same project as the function.
+     * 
+ * + * string project_id = 2; + * + * @param value The bytes for projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + projectId_ = value; + onChanged(); + return this; + } + + private java.lang.Object secret_ = ""; + /** + * + * + *
+     * Name of the secret in secret manager (not the full resource name).
+     * 
+ * + * string secret = 3; + * + * @return The secret. + */ + public java.lang.String getSecret() { + java.lang.Object ref = secret_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + secret_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the secret in secret manager (not the full resource name).
+     * 
+ * + * string secret = 3; + * + * @return The bytes for secret. + */ + public com.google.protobuf.ByteString getSecretBytes() { + java.lang.Object ref = secret_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + secret_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the secret in secret manager (not the full resource name).
+     * 
+ * + * string secret = 3; + * + * @param value The secret to set. + * @return This builder for chaining. + */ + public Builder setSecret(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + secret_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the secret in secret manager (not the full resource name).
+     * 
+ * + * string secret = 3; + * + * @return This builder for chaining. + */ + public Builder clearSecret() { + + secret_ = getDefaultInstance().getSecret(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the secret in secret manager (not the full resource name).
+     * 
+ * + * string secret = 3; + * + * @param value The bytes for secret to set. + * @return This builder for chaining. + */ + public Builder setSecretBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + secret_ = value; + onChanged(); + return this; + } + + private java.lang.Object version_ = ""; + /** + * + * + *
+     * Version of the secret (version number or the string 'latest'). It is
+     * recommended to use a numeric version for secret environment variables as
+     * any updates to the secret value is not reflected until new instances
+     * start.
+     * 
+ * + * string version = 4; + * + * @return The version. + */ + public java.lang.String getVersion() { + java.lang.Object ref = version_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + version_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Version of the secret (version number or the string 'latest'). It is
+     * recommended to use a numeric version for secret environment variables as
+     * any updates to the secret value is not reflected until new instances
+     * start.
+     * 
+ * + * string version = 4; + * + * @return The bytes for version. + */ + public com.google.protobuf.ByteString getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Version of the secret (version number or the string 'latest'). It is
+     * recommended to use a numeric version for secret environment variables as
+     * any updates to the secret value is not reflected until new instances
+     * start.
+     * 
+ * + * string version = 4; + * + * @param value The version to set. + * @return This builder for chaining. + */ + public Builder setVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + version_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Version of the secret (version number or the string 'latest'). It is
+     * recommended to use a numeric version for secret environment variables as
+     * any updates to the secret value is not reflected until new instances
+     * start.
+     * 
+ * + * string version = 4; + * + * @return This builder for chaining. + */ + public Builder clearVersion() { + + version_ = getDefaultInstance().getVersion(); + onChanged(); + return this; + } + /** + * + * + *
+     * Version of the secret (version number or the string 'latest'). It is
+     * recommended to use a numeric version for secret environment variables as
+     * any updates to the secret value is not reflected until new instances
+     * start.
+     * 
+ * + * string version = 4; + * + * @param value The bytes for version to set. + * @return This builder for chaining. + */ + public Builder setVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + version_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2beta.SecretEnvVar) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2beta.SecretEnvVar) + private static final com.google.cloud.functions.v2beta.SecretEnvVar DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2beta.SecretEnvVar(); + } + + public static com.google.cloud.functions.v2beta.SecretEnvVar getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SecretEnvVar parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SecretEnvVar(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.SecretEnvVar getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/SecretEnvVarOrBuilder.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/SecretEnvVarOrBuilder.java new file mode 100644 index 00000000..1bd7bf7b --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/SecretEnvVarOrBuilder.java @@ -0,0 +1,135 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +public interface SecretEnvVarOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2beta.SecretEnvVar) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of the environment variable.
+   * 
+ * + * string key = 1; + * + * @return The key. + */ + java.lang.String getKey(); + /** + * + * + *
+   * Name of the environment variable.
+   * 
+ * + * string key = 1; + * + * @return The bytes for key. + */ + com.google.protobuf.ByteString getKeyBytes(); + + /** + * + * + *
+   * Project identifier (preferably project number but can also be the
+   * project ID) of the project that contains the secret. If not set, it is
+   * assumed that the secret is in the same project as the function.
+   * 
+ * + * string project_id = 2; + * + * @return The projectId. + */ + java.lang.String getProjectId(); + /** + * + * + *
+   * Project identifier (preferably project number but can also be the
+   * project ID) of the project that contains the secret. If not set, it is
+   * assumed that the secret is in the same project as the function.
+   * 
+ * + * string project_id = 2; + * + * @return The bytes for projectId. + */ + com.google.protobuf.ByteString getProjectIdBytes(); + + /** + * + * + *
+   * Name of the secret in secret manager (not the full resource name).
+   * 
+ * + * string secret = 3; + * + * @return The secret. + */ + java.lang.String getSecret(); + /** + * + * + *
+   * Name of the secret in secret manager (not the full resource name).
+   * 
+ * + * string secret = 3; + * + * @return The bytes for secret. + */ + com.google.protobuf.ByteString getSecretBytes(); + + /** + * + * + *
+   * Version of the secret (version number or the string 'latest'). It is
+   * recommended to use a numeric version for secret environment variables as
+   * any updates to the secret value is not reflected until new instances
+   * start.
+   * 
+ * + * string version = 4; + * + * @return The version. + */ + java.lang.String getVersion(); + /** + * + * + *
+   * Version of the secret (version number or the string 'latest'). It is
+   * recommended to use a numeric version for secret environment variables as
+   * any updates to the secret value is not reflected until new instances
+   * start.
+   * 
+ * + * string version = 4; + * + * @return The bytes for version. + */ + com.google.protobuf.ByteString getVersionBytes(); +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/SecretVolume.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/SecretVolume.java new file mode 100644 index 00000000..56eef89d --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/SecretVolume.java @@ -0,0 +1,2511 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +/** + * + * + *
+ * Configuration for a secret volume. It has the information necessary to fetch
+ * the secret value from secret manager and make it available as files mounted
+ * at the requested paths within the application container.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.SecretVolume} + */ +public final class SecretVolume extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2beta.SecretVolume) + SecretVolumeOrBuilder { + private static final long serialVersionUID = 0L; + // Use SecretVolume.newBuilder() to construct. + private SecretVolume(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SecretVolume() { + mountPath_ = ""; + projectId_ = ""; + secret_ = ""; + versions_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SecretVolume(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SecretVolume( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + mountPath_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + projectId_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + secret_ = s; + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + versions_ = + new java.util.ArrayList< + com.google.cloud.functions.v2beta.SecretVolume.SecretVersion>(); + mutable_bitField0_ |= 0x00000001; + } + versions_.add( + input.readMessage( + com.google.cloud.functions.v2beta.SecretVolume.SecretVersion.parser(), + extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + versions_ = java.util.Collections.unmodifiableList(versions_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_SecretVolume_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_SecretVolume_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.SecretVolume.class, + com.google.cloud.functions.v2beta.SecretVolume.Builder.class); + } + + public interface SecretVersionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2beta.SecretVolume.SecretVersion) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Version of the secret (version number or the string 'latest'). It is
+     * preferable to use `latest` version with secret volumes as secret value
+     * changes are reflected immediately.
+     * 
+ * + * string version = 1; + * + * @return The version. + */ + java.lang.String getVersion(); + /** + * + * + *
+     * Version of the secret (version number or the string 'latest'). It is
+     * preferable to use `latest` version with secret volumes as secret value
+     * changes are reflected immediately.
+     * 
+ * + * string version = 1; + * + * @return The bytes for version. + */ + com.google.protobuf.ByteString getVersionBytes(); + + /** + * + * + *
+     * Relative path of the file under the mount path where the secret value for
+     * this version will be fetched and made available. For example, setting the
+     * mount_path as '/etc/secrets' and path as `secret_foo` would mount the
+     * secret value file at `/etc/secrets/secret_foo`.
+     * 
+ * + * string path = 2; + * + * @return The path. + */ + java.lang.String getPath(); + /** + * + * + *
+     * Relative path of the file under the mount path where the secret value for
+     * this version will be fetched and made available. For example, setting the
+     * mount_path as '/etc/secrets' and path as `secret_foo` would mount the
+     * secret value file at `/etc/secrets/secret_foo`.
+     * 
+ * + * string path = 2; + * + * @return The bytes for path. + */ + com.google.protobuf.ByteString getPathBytes(); + } + /** + * + * + *
+   * Configuration for a single version.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.SecretVolume.SecretVersion} + */ + public static final class SecretVersion extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2beta.SecretVolume.SecretVersion) + SecretVersionOrBuilder { + private static final long serialVersionUID = 0L; + // Use SecretVersion.newBuilder() to construct. + private SecretVersion(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SecretVersion() { + version_ = ""; + path_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SecretVersion(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SecretVersion( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + version_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + path_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_SecretVolume_SecretVersion_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_SecretVolume_SecretVersion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.SecretVolume.SecretVersion.class, + com.google.cloud.functions.v2beta.SecretVolume.SecretVersion.Builder.class); + } + + public static final int VERSION_FIELD_NUMBER = 1; + private volatile java.lang.Object version_; + /** + * + * + *
+     * Version of the secret (version number or the string 'latest'). It is
+     * preferable to use `latest` version with secret volumes as secret value
+     * changes are reflected immediately.
+     * 
+ * + * string version = 1; + * + * @return The version. + */ + @java.lang.Override + public java.lang.String getVersion() { + java.lang.Object ref = version_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + version_ = s; + return s; + } + } + /** + * + * + *
+     * Version of the secret (version number or the string 'latest'). It is
+     * preferable to use `latest` version with secret volumes as secret value
+     * changes are reflected immediately.
+     * 
+ * + * string version = 1; + * + * @return The bytes for version. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PATH_FIELD_NUMBER = 2; + private volatile java.lang.Object path_; + /** + * + * + *
+     * Relative path of the file under the mount path where the secret value for
+     * this version will be fetched and made available. For example, setting the
+     * mount_path as '/etc/secrets' and path as `secret_foo` would mount the
+     * secret value file at `/etc/secrets/secret_foo`.
+     * 
+ * + * string path = 2; + * + * @return The path. + */ + @java.lang.Override + public java.lang.String getPath() { + java.lang.Object ref = path_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + path_ = s; + return s; + } + } + /** + * + * + *
+     * Relative path of the file under the mount path where the secret value for
+     * this version will be fetched and made available. For example, setting the
+     * mount_path as '/etc/secrets' and path as `secret_foo` would mount the
+     * secret value file at `/etc/secrets/secret_foo`.
+     * 
+ * + * string path = 2; + * + * @return The bytes for path. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPathBytes() { + java.lang.Object ref = path_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + path_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(version_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, version_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(path_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, path_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(version_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, version_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(path_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, path_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2beta.SecretVolume.SecretVersion)) { + return super.equals(obj); + } + com.google.cloud.functions.v2beta.SecretVolume.SecretVersion other = + (com.google.cloud.functions.v2beta.SecretVolume.SecretVersion) obj; + + if (!getVersion().equals(other.getVersion())) return false; + if (!getPath().equals(other.getPath())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion().hashCode(); + hash = (37 * hash) + PATH_FIELD_NUMBER; + hash = (53 * hash) + getPath().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2beta.SecretVolume.SecretVersion parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.SecretVolume.SecretVersion parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.SecretVolume.SecretVersion parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.SecretVolume.SecretVersion parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.SecretVolume.SecretVersion parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.SecretVolume.SecretVersion parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.SecretVolume.SecretVersion parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.SecretVolume.SecretVersion parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.SecretVolume.SecretVersion parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.SecretVolume.SecretVersion parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.SecretVolume.SecretVersion parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.SecretVolume.SecretVersion parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.functions.v2beta.SecretVolume.SecretVersion prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Configuration for a single version.
+     * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.SecretVolume.SecretVersion} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2beta.SecretVolume.SecretVersion) + com.google.cloud.functions.v2beta.SecretVolume.SecretVersionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_SecretVolume_SecretVersion_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_SecretVolume_SecretVersion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.SecretVolume.SecretVersion.class, + com.google.cloud.functions.v2beta.SecretVolume.SecretVersion.Builder.class); + } + + // Construct using com.google.cloud.functions.v2beta.SecretVolume.SecretVersion.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + version_ = ""; + + path_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_SecretVolume_SecretVersion_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.SecretVolume.SecretVersion + getDefaultInstanceForType() { + return com.google.cloud.functions.v2beta.SecretVolume.SecretVersion.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.SecretVolume.SecretVersion build() { + com.google.cloud.functions.v2beta.SecretVolume.SecretVersion result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.SecretVolume.SecretVersion buildPartial() { + com.google.cloud.functions.v2beta.SecretVolume.SecretVersion result = + new com.google.cloud.functions.v2beta.SecretVolume.SecretVersion(this); + result.version_ = version_; + result.path_ = path_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2beta.SecretVolume.SecretVersion) { + return mergeFrom((com.google.cloud.functions.v2beta.SecretVolume.SecretVersion) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2beta.SecretVolume.SecretVersion other) { + if (other + == com.google.cloud.functions.v2beta.SecretVolume.SecretVersion.getDefaultInstance()) + return this; + if (!other.getVersion().isEmpty()) { + version_ = other.version_; + onChanged(); + } + if (!other.getPath().isEmpty()) { + path_ = other.path_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2beta.SecretVolume.SecretVersion parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2beta.SecretVolume.SecretVersion) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object version_ = ""; + /** + * + * + *
+       * Version of the secret (version number or the string 'latest'). It is
+       * preferable to use `latest` version with secret volumes as secret value
+       * changes are reflected immediately.
+       * 
+ * + * string version = 1; + * + * @return The version. + */ + public java.lang.String getVersion() { + java.lang.Object ref = version_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + version_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Version of the secret (version number or the string 'latest'). It is
+       * preferable to use `latest` version with secret volumes as secret value
+       * changes are reflected immediately.
+       * 
+ * + * string version = 1; + * + * @return The bytes for version. + */ + public com.google.protobuf.ByteString getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Version of the secret (version number or the string 'latest'). It is
+       * preferable to use `latest` version with secret volumes as secret value
+       * changes are reflected immediately.
+       * 
+ * + * string version = 1; + * + * @param value The version to set. + * @return This builder for chaining. + */ + public Builder setVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + version_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Version of the secret (version number or the string 'latest'). It is
+       * preferable to use `latest` version with secret volumes as secret value
+       * changes are reflected immediately.
+       * 
+ * + * string version = 1; + * + * @return This builder for chaining. + */ + public Builder clearVersion() { + + version_ = getDefaultInstance().getVersion(); + onChanged(); + return this; + } + /** + * + * + *
+       * Version of the secret (version number or the string 'latest'). It is
+       * preferable to use `latest` version with secret volumes as secret value
+       * changes are reflected immediately.
+       * 
+ * + * string version = 1; + * + * @param value The bytes for version to set. + * @return This builder for chaining. + */ + public Builder setVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + version_ = value; + onChanged(); + return this; + } + + private java.lang.Object path_ = ""; + /** + * + * + *
+       * Relative path of the file under the mount path where the secret value for
+       * this version will be fetched and made available. For example, setting the
+       * mount_path as '/etc/secrets' and path as `secret_foo` would mount the
+       * secret value file at `/etc/secrets/secret_foo`.
+       * 
+ * + * string path = 2; + * + * @return The path. + */ + public java.lang.String getPath() { + java.lang.Object ref = path_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + path_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Relative path of the file under the mount path where the secret value for
+       * this version will be fetched and made available. For example, setting the
+       * mount_path as '/etc/secrets' and path as `secret_foo` would mount the
+       * secret value file at `/etc/secrets/secret_foo`.
+       * 
+ * + * string path = 2; + * + * @return The bytes for path. + */ + public com.google.protobuf.ByteString getPathBytes() { + java.lang.Object ref = path_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + path_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Relative path of the file under the mount path where the secret value for
+       * this version will be fetched and made available. For example, setting the
+       * mount_path as '/etc/secrets' and path as `secret_foo` would mount the
+       * secret value file at `/etc/secrets/secret_foo`.
+       * 
+ * + * string path = 2; + * + * @param value The path to set. + * @return This builder for chaining. + */ + public Builder setPath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + path_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Relative path of the file under the mount path where the secret value for
+       * this version will be fetched and made available. For example, setting the
+       * mount_path as '/etc/secrets' and path as `secret_foo` would mount the
+       * secret value file at `/etc/secrets/secret_foo`.
+       * 
+ * + * string path = 2; + * + * @return This builder for chaining. + */ + public Builder clearPath() { + + path_ = getDefaultInstance().getPath(); + onChanged(); + return this; + } + /** + * + * + *
+       * Relative path of the file under the mount path where the secret value for
+       * this version will be fetched and made available. For example, setting the
+       * mount_path as '/etc/secrets' and path as `secret_foo` would mount the
+       * secret value file at `/etc/secrets/secret_foo`.
+       * 
+ * + * string path = 2; + * + * @param value The bytes for path to set. + * @return This builder for chaining. + */ + public Builder setPathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + path_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2beta.SecretVolume.SecretVersion) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2beta.SecretVolume.SecretVersion) + private static final com.google.cloud.functions.v2beta.SecretVolume.SecretVersion + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2beta.SecretVolume.SecretVersion(); + } + + public static com.google.cloud.functions.v2beta.SecretVolume.SecretVersion + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SecretVersion parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SecretVersion(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.SecretVolume.SecretVersion + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int MOUNT_PATH_FIELD_NUMBER = 1; + private volatile java.lang.Object mountPath_; + /** + * + * + *
+   * The path within the container to mount the secret volume. For example,
+   * setting the mount_path as `/etc/secrets` would mount the secret value files
+   * under the `/etc/secrets` directory. This directory will also be completely
+   * shadowed and unavailable to mount any other secrets.
+   * Recommended mount path: /etc/secrets
+   * 
+ * + * string mount_path = 1; + * + * @return The mountPath. + */ + @java.lang.Override + public java.lang.String getMountPath() { + java.lang.Object ref = mountPath_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mountPath_ = s; + return s; + } + } + /** + * + * + *
+   * The path within the container to mount the secret volume. For example,
+   * setting the mount_path as `/etc/secrets` would mount the secret value files
+   * under the `/etc/secrets` directory. This directory will also be completely
+   * shadowed and unavailable to mount any other secrets.
+   * Recommended mount path: /etc/secrets
+   * 
+ * + * string mount_path = 1; + * + * @return The bytes for mountPath. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMountPathBytes() { + java.lang.Object ref = mountPath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + mountPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object projectId_; + /** + * + * + *
+   * Project identifier (preferably project number but can also be the project
+   * ID) of the project that contains the secret. If not set, it is
+   * assumed that the secret is in the same project as the function.
+   * 
+ * + * string project_id = 2; + * + * @return The projectId. + */ + @java.lang.Override + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + projectId_ = s; + return s; + } + } + /** + * + * + *
+   * Project identifier (preferably project number but can also be the project
+   * ID) of the project that contains the secret. If not set, it is
+   * assumed that the secret is in the same project as the function.
+   * 
+ * + * string project_id = 2; + * + * @return The bytes for projectId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SECRET_FIELD_NUMBER = 3; + private volatile java.lang.Object secret_; + /** + * + * + *
+   * Name of the secret in secret manager (not the full resource name).
+   * 
+ * + * string secret = 3; + * + * @return The secret. + */ + @java.lang.Override + public java.lang.String getSecret() { + java.lang.Object ref = secret_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + secret_ = s; + return s; + } + } + /** + * + * + *
+   * Name of the secret in secret manager (not the full resource name).
+   * 
+ * + * string secret = 3; + * + * @return The bytes for secret. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSecretBytes() { + java.lang.Object ref = secret_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + secret_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERSIONS_FIELD_NUMBER = 4; + private java.util.List versions_; + /** + * + * + *
+   * List of secret versions to mount for this secret. If empty, the `latest`
+   * version of the secret will be made available in a file named after the
+   * secret under the mount point.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume.SecretVersion versions = 4; + */ + @java.lang.Override + public java.util.List + getVersionsList() { + return versions_; + } + /** + * + * + *
+   * List of secret versions to mount for this secret. If empty, the `latest`
+   * version of the secret will be made available in a file named after the
+   * secret under the mount point.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume.SecretVersion versions = 4; + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.functions.v2beta.SecretVolume.SecretVersionOrBuilder> + getVersionsOrBuilderList() { + return versions_; + } + /** + * + * + *
+   * List of secret versions to mount for this secret. If empty, the `latest`
+   * version of the secret will be made available in a file named after the
+   * secret under the mount point.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume.SecretVersion versions = 4; + */ + @java.lang.Override + public int getVersionsCount() { + return versions_.size(); + } + /** + * + * + *
+   * List of secret versions to mount for this secret. If empty, the `latest`
+   * version of the secret will be made available in a file named after the
+   * secret under the mount point.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume.SecretVersion versions = 4; + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.SecretVolume.SecretVersion getVersions(int index) { + return versions_.get(index); + } + /** + * + * + *
+   * List of secret versions to mount for this secret. If empty, the `latest`
+   * version of the secret will be made available in a file named after the
+   * secret under the mount point.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume.SecretVersion versions = 4; + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.SecretVolume.SecretVersionOrBuilder getVersionsOrBuilder( + int index) { + return versions_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(mountPath_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, mountPath_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, projectId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(secret_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, secret_); + } + for (int i = 0; i < versions_.size(); i++) { + output.writeMessage(4, versions_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(mountPath_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, mountPath_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, projectId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(secret_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, secret_); + } + for (int i = 0; i < versions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, versions_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2beta.SecretVolume)) { + return super.equals(obj); + } + com.google.cloud.functions.v2beta.SecretVolume other = + (com.google.cloud.functions.v2beta.SecretVolume) obj; + + if (!getMountPath().equals(other.getMountPath())) return false; + if (!getProjectId().equals(other.getProjectId())) return false; + if (!getSecret().equals(other.getSecret())) return false; + if (!getVersionsList().equals(other.getVersionsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MOUNT_PATH_FIELD_NUMBER; + hash = (53 * hash) + getMountPath().hashCode(); + hash = (37 * hash) + PROJECT_ID_FIELD_NUMBER; + hash = (53 * hash) + getProjectId().hashCode(); + hash = (37 * hash) + SECRET_FIELD_NUMBER; + hash = (53 * hash) + getSecret().hashCode(); + if (getVersionsCount() > 0) { + hash = (37 * hash) + VERSIONS_FIELD_NUMBER; + hash = (53 * hash) + getVersionsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2beta.SecretVolume parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.SecretVolume parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.SecretVolume parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.SecretVolume parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.SecretVolume parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.SecretVolume parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.SecretVolume parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.SecretVolume parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.SecretVolume parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.SecretVolume parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.SecretVolume parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.SecretVolume parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v2beta.SecretVolume prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Configuration for a secret volume. It has the information necessary to fetch
+   * the secret value from secret manager and make it available as files mounted
+   * at the requested paths within the application container.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.SecretVolume} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2beta.SecretVolume) + com.google.cloud.functions.v2beta.SecretVolumeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_SecretVolume_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_SecretVolume_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.SecretVolume.class, + com.google.cloud.functions.v2beta.SecretVolume.Builder.class); + } + + // Construct using com.google.cloud.functions.v2beta.SecretVolume.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getVersionsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + mountPath_ = ""; + + projectId_ = ""; + + secret_ = ""; + + if (versionsBuilder_ == null) { + versions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + versionsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_SecretVolume_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.SecretVolume getDefaultInstanceForType() { + return com.google.cloud.functions.v2beta.SecretVolume.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.SecretVolume build() { + com.google.cloud.functions.v2beta.SecretVolume result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.SecretVolume buildPartial() { + com.google.cloud.functions.v2beta.SecretVolume result = + new com.google.cloud.functions.v2beta.SecretVolume(this); + int from_bitField0_ = bitField0_; + result.mountPath_ = mountPath_; + result.projectId_ = projectId_; + result.secret_ = secret_; + if (versionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + versions_ = java.util.Collections.unmodifiableList(versions_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.versions_ = versions_; + } else { + result.versions_ = versionsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2beta.SecretVolume) { + return mergeFrom((com.google.cloud.functions.v2beta.SecretVolume) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2beta.SecretVolume other) { + if (other == com.google.cloud.functions.v2beta.SecretVolume.getDefaultInstance()) return this; + if (!other.getMountPath().isEmpty()) { + mountPath_ = other.mountPath_; + onChanged(); + } + if (!other.getProjectId().isEmpty()) { + projectId_ = other.projectId_; + onChanged(); + } + if (!other.getSecret().isEmpty()) { + secret_ = other.secret_; + onChanged(); + } + if (versionsBuilder_ == null) { + if (!other.versions_.isEmpty()) { + if (versions_.isEmpty()) { + versions_ = other.versions_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureVersionsIsMutable(); + versions_.addAll(other.versions_); + } + onChanged(); + } + } else { + if (!other.versions_.isEmpty()) { + if (versionsBuilder_.isEmpty()) { + versionsBuilder_.dispose(); + versionsBuilder_ = null; + versions_ = other.versions_; + bitField0_ = (bitField0_ & ~0x00000001); + versionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getVersionsFieldBuilder() + : null; + } else { + versionsBuilder_.addAllMessages(other.versions_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2beta.SecretVolume parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v2beta.SecretVolume) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object mountPath_ = ""; + /** + * + * + *
+     * The path within the container to mount the secret volume. For example,
+     * setting the mount_path as `/etc/secrets` would mount the secret value files
+     * under the `/etc/secrets` directory. This directory will also be completely
+     * shadowed and unavailable to mount any other secrets.
+     * Recommended mount path: /etc/secrets
+     * 
+ * + * string mount_path = 1; + * + * @return The mountPath. + */ + public java.lang.String getMountPath() { + java.lang.Object ref = mountPath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mountPath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The path within the container to mount the secret volume. For example,
+     * setting the mount_path as `/etc/secrets` would mount the secret value files
+     * under the `/etc/secrets` directory. This directory will also be completely
+     * shadowed and unavailable to mount any other secrets.
+     * Recommended mount path: /etc/secrets
+     * 
+ * + * string mount_path = 1; + * + * @return The bytes for mountPath. + */ + public com.google.protobuf.ByteString getMountPathBytes() { + java.lang.Object ref = mountPath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + mountPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The path within the container to mount the secret volume. For example,
+     * setting the mount_path as `/etc/secrets` would mount the secret value files
+     * under the `/etc/secrets` directory. This directory will also be completely
+     * shadowed and unavailable to mount any other secrets.
+     * Recommended mount path: /etc/secrets
+     * 
+ * + * string mount_path = 1; + * + * @param value The mountPath to set. + * @return This builder for chaining. + */ + public Builder setMountPath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + mountPath_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The path within the container to mount the secret volume. For example,
+     * setting the mount_path as `/etc/secrets` would mount the secret value files
+     * under the `/etc/secrets` directory. This directory will also be completely
+     * shadowed and unavailable to mount any other secrets.
+     * Recommended mount path: /etc/secrets
+     * 
+ * + * string mount_path = 1; + * + * @return This builder for chaining. + */ + public Builder clearMountPath() { + + mountPath_ = getDefaultInstance().getMountPath(); + onChanged(); + return this; + } + /** + * + * + *
+     * The path within the container to mount the secret volume. For example,
+     * setting the mount_path as `/etc/secrets` would mount the secret value files
+     * under the `/etc/secrets` directory. This directory will also be completely
+     * shadowed and unavailable to mount any other secrets.
+     * Recommended mount path: /etc/secrets
+     * 
+ * + * string mount_path = 1; + * + * @param value The bytes for mountPath to set. + * @return This builder for chaining. + */ + public Builder setMountPathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + mountPath_ = value; + onChanged(); + return this; + } + + private java.lang.Object projectId_ = ""; + /** + * + * + *
+     * Project identifier (preferably project number but can also be the project
+     * ID) of the project that contains the secret. If not set, it is
+     * assumed that the secret is in the same project as the function.
+     * 
+ * + * string project_id = 2; + * + * @return The projectId. + */ + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + projectId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Project identifier (preferably project number but can also be the project
+     * ID) of the project that contains the secret. If not set, it is
+     * assumed that the secret is in the same project as the function.
+     * 
+ * + * string project_id = 2; + * + * @return The bytes for projectId. + */ + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Project identifier (preferably project number but can also be the project
+     * ID) of the project that contains the secret. If not set, it is
+     * assumed that the secret is in the same project as the function.
+     * 
+ * + * string project_id = 2; + * + * @param value The projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + projectId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Project identifier (preferably project number but can also be the project
+     * ID) of the project that contains the secret. If not set, it is
+     * assumed that the secret is in the same project as the function.
+     * 
+ * + * string project_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearProjectId() { + + projectId_ = getDefaultInstance().getProjectId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Project identifier (preferably project number but can also be the project
+     * ID) of the project that contains the secret. If not set, it is
+     * assumed that the secret is in the same project as the function.
+     * 
+ * + * string project_id = 2; + * + * @param value The bytes for projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + projectId_ = value; + onChanged(); + return this; + } + + private java.lang.Object secret_ = ""; + /** + * + * + *
+     * Name of the secret in secret manager (not the full resource name).
+     * 
+ * + * string secret = 3; + * + * @return The secret. + */ + public java.lang.String getSecret() { + java.lang.Object ref = secret_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + secret_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Name of the secret in secret manager (not the full resource name).
+     * 
+ * + * string secret = 3; + * + * @return The bytes for secret. + */ + public com.google.protobuf.ByteString getSecretBytes() { + java.lang.Object ref = secret_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + secret_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Name of the secret in secret manager (not the full resource name).
+     * 
+ * + * string secret = 3; + * + * @param value The secret to set. + * @return This builder for chaining. + */ + public Builder setSecret(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + secret_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the secret in secret manager (not the full resource name).
+     * 
+ * + * string secret = 3; + * + * @return This builder for chaining. + */ + public Builder clearSecret() { + + secret_ = getDefaultInstance().getSecret(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the secret in secret manager (not the full resource name).
+     * 
+ * + * string secret = 3; + * + * @param value The bytes for secret to set. + * @return This builder for chaining. + */ + public Builder setSecretBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + secret_ = value; + onChanged(); + return this; + } + + private java.util.List versions_ = + java.util.Collections.emptyList(); + + private void ensureVersionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + versions_ = + new java.util.ArrayList( + versions_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2beta.SecretVolume.SecretVersion, + com.google.cloud.functions.v2beta.SecretVolume.SecretVersion.Builder, + com.google.cloud.functions.v2beta.SecretVolume.SecretVersionOrBuilder> + versionsBuilder_; + + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume.SecretVersion versions = 4; + */ + public java.util.List + getVersionsList() { + if (versionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(versions_); + } else { + return versionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume.SecretVersion versions = 4; + */ + public int getVersionsCount() { + if (versionsBuilder_ == null) { + return versions_.size(); + } else { + return versionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume.SecretVersion versions = 4; + */ + public com.google.cloud.functions.v2beta.SecretVolume.SecretVersion getVersions(int index) { + if (versionsBuilder_ == null) { + return versions_.get(index); + } else { + return versionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume.SecretVersion versions = 4; + */ + public Builder setVersions( + int index, com.google.cloud.functions.v2beta.SecretVolume.SecretVersion value) { + if (versionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVersionsIsMutable(); + versions_.set(index, value); + onChanged(); + } else { + versionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume.SecretVersion versions = 4; + */ + public Builder setVersions( + int index, + com.google.cloud.functions.v2beta.SecretVolume.SecretVersion.Builder builderForValue) { + if (versionsBuilder_ == null) { + ensureVersionsIsMutable(); + versions_.set(index, builderForValue.build()); + onChanged(); + } else { + versionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume.SecretVersion versions = 4; + */ + public Builder addVersions(com.google.cloud.functions.v2beta.SecretVolume.SecretVersion value) { + if (versionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVersionsIsMutable(); + versions_.add(value); + onChanged(); + } else { + versionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume.SecretVersion versions = 4; + */ + public Builder addVersions( + int index, com.google.cloud.functions.v2beta.SecretVolume.SecretVersion value) { + if (versionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVersionsIsMutable(); + versions_.add(index, value); + onChanged(); + } else { + versionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume.SecretVersion versions = 4; + */ + public Builder addVersions( + com.google.cloud.functions.v2beta.SecretVolume.SecretVersion.Builder builderForValue) { + if (versionsBuilder_ == null) { + ensureVersionsIsMutable(); + versions_.add(builderForValue.build()); + onChanged(); + } else { + versionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume.SecretVersion versions = 4; + */ + public Builder addVersions( + int index, + com.google.cloud.functions.v2beta.SecretVolume.SecretVersion.Builder builderForValue) { + if (versionsBuilder_ == null) { + ensureVersionsIsMutable(); + versions_.add(index, builderForValue.build()); + onChanged(); + } else { + versionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume.SecretVersion versions = 4; + */ + public Builder addAllVersions( + java.lang.Iterable + values) { + if (versionsBuilder_ == null) { + ensureVersionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, versions_); + onChanged(); + } else { + versionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume.SecretVersion versions = 4; + */ + public Builder clearVersions() { + if (versionsBuilder_ == null) { + versions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + versionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume.SecretVersion versions = 4; + */ + public Builder removeVersions(int index) { + if (versionsBuilder_ == null) { + ensureVersionsIsMutable(); + versions_.remove(index); + onChanged(); + } else { + versionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume.SecretVersion versions = 4; + */ + public com.google.cloud.functions.v2beta.SecretVolume.SecretVersion.Builder getVersionsBuilder( + int index) { + return getVersionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume.SecretVersion versions = 4; + */ + public com.google.cloud.functions.v2beta.SecretVolume.SecretVersionOrBuilder + getVersionsOrBuilder(int index) { + if (versionsBuilder_ == null) { + return versions_.get(index); + } else { + return versionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume.SecretVersion versions = 4; + */ + public java.util.List< + ? extends com.google.cloud.functions.v2beta.SecretVolume.SecretVersionOrBuilder> + getVersionsOrBuilderList() { + if (versionsBuilder_ != null) { + return versionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(versions_); + } + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume.SecretVersion versions = 4; + */ + public com.google.cloud.functions.v2beta.SecretVolume.SecretVersion.Builder + addVersionsBuilder() { + return getVersionsFieldBuilder() + .addBuilder( + com.google.cloud.functions.v2beta.SecretVolume.SecretVersion.getDefaultInstance()); + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume.SecretVersion versions = 4; + */ + public com.google.cloud.functions.v2beta.SecretVolume.SecretVersion.Builder addVersionsBuilder( + int index) { + return getVersionsFieldBuilder() + .addBuilder( + index, + com.google.cloud.functions.v2beta.SecretVolume.SecretVersion.getDefaultInstance()); + } + /** + * + * + *
+     * List of secret versions to mount for this secret. If empty, the `latest`
+     * version of the secret will be made available in a file named after the
+     * secret under the mount point.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume.SecretVersion versions = 4; + */ + public java.util.List + getVersionsBuilderList() { + return getVersionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2beta.SecretVolume.SecretVersion, + com.google.cloud.functions.v2beta.SecretVolume.SecretVersion.Builder, + com.google.cloud.functions.v2beta.SecretVolume.SecretVersionOrBuilder> + getVersionsFieldBuilder() { + if (versionsBuilder_ == null) { + versionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2beta.SecretVolume.SecretVersion, + com.google.cloud.functions.v2beta.SecretVolume.SecretVersion.Builder, + com.google.cloud.functions.v2beta.SecretVolume.SecretVersionOrBuilder>( + versions_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + versions_ = null; + } + return versionsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2beta.SecretVolume) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2beta.SecretVolume) + private static final com.google.cloud.functions.v2beta.SecretVolume DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2beta.SecretVolume(); + } + + public static com.google.cloud.functions.v2beta.SecretVolume getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SecretVolume parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SecretVolume(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.SecretVolume getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/SecretVolumeOrBuilder.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/SecretVolumeOrBuilder.java new file mode 100644 index 00000000..6497730d --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/SecretVolumeOrBuilder.java @@ -0,0 +1,175 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +public interface SecretVolumeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2beta.SecretVolume) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The path within the container to mount the secret volume. For example,
+   * setting the mount_path as `/etc/secrets` would mount the secret value files
+   * under the `/etc/secrets` directory. This directory will also be completely
+   * shadowed and unavailable to mount any other secrets.
+   * Recommended mount path: /etc/secrets
+   * 
+ * + * string mount_path = 1; + * + * @return The mountPath. + */ + java.lang.String getMountPath(); + /** + * + * + *
+   * The path within the container to mount the secret volume. For example,
+   * setting the mount_path as `/etc/secrets` would mount the secret value files
+   * under the `/etc/secrets` directory. This directory will also be completely
+   * shadowed and unavailable to mount any other secrets.
+   * Recommended mount path: /etc/secrets
+   * 
+ * + * string mount_path = 1; + * + * @return The bytes for mountPath. + */ + com.google.protobuf.ByteString getMountPathBytes(); + + /** + * + * + *
+   * Project identifier (preferably project number but can also be the project
+   * ID) of the project that contains the secret. If not set, it is
+   * assumed that the secret is in the same project as the function.
+   * 
+ * + * string project_id = 2; + * + * @return The projectId. + */ + java.lang.String getProjectId(); + /** + * + * + *
+   * Project identifier (preferably project number but can also be the project
+   * ID) of the project that contains the secret. If not set, it is
+   * assumed that the secret is in the same project as the function.
+   * 
+ * + * string project_id = 2; + * + * @return The bytes for projectId. + */ + com.google.protobuf.ByteString getProjectIdBytes(); + + /** + * + * + *
+   * Name of the secret in secret manager (not the full resource name).
+   * 
+ * + * string secret = 3; + * + * @return The secret. + */ + java.lang.String getSecret(); + /** + * + * + *
+   * Name of the secret in secret manager (not the full resource name).
+   * 
+ * + * string secret = 3; + * + * @return The bytes for secret. + */ + com.google.protobuf.ByteString getSecretBytes(); + + /** + * + * + *
+   * List of secret versions to mount for this secret. If empty, the `latest`
+   * version of the secret will be made available in a file named after the
+   * secret under the mount point.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume.SecretVersion versions = 4; + */ + java.util.List getVersionsList(); + /** + * + * + *
+   * List of secret versions to mount for this secret. If empty, the `latest`
+   * version of the secret will be made available in a file named after the
+   * secret under the mount point.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume.SecretVersion versions = 4; + */ + com.google.cloud.functions.v2beta.SecretVolume.SecretVersion getVersions(int index); + /** + * + * + *
+   * List of secret versions to mount for this secret. If empty, the `latest`
+   * version of the secret will be made available in a file named after the
+   * secret under the mount point.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume.SecretVersion versions = 4; + */ + int getVersionsCount(); + /** + * + * + *
+   * List of secret versions to mount for this secret. If empty, the `latest`
+   * version of the secret will be made available in a file named after the
+   * secret under the mount point.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume.SecretVersion versions = 4; + */ + java.util.List + getVersionsOrBuilderList(); + /** + * + * + *
+   * List of secret versions to mount for this secret. If empty, the `latest`
+   * version of the secret will be made available in a file named after the
+   * secret under the mount point.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume.SecretVersion versions = 4; + */ + com.google.cloud.functions.v2beta.SecretVolume.SecretVersionOrBuilder getVersionsOrBuilder( + int index); +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/ServiceConfig.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/ServiceConfig.java new file mode 100644 index 00000000..e0d6a335 --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/ServiceConfig.java @@ -0,0 +1,4145 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +/** + * + * + *
+ * Describes the Service being deployed.
+ * Currently Supported : Cloud Run (fully managed).
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.ServiceConfig} + */ +public final class ServiceConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2beta.ServiceConfig) + ServiceConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use ServiceConfig.newBuilder() to construct. + private ServiceConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ServiceConfig() { + service_ = ""; + availableMemory_ = ""; + vpcConnector_ = ""; + vpcConnectorEgressSettings_ = 0; + ingressSettings_ = 0; + uri_ = ""; + serviceAccountEmail_ = ""; + secretEnvironmentVariables_ = java.util.Collections.emptyList(); + secretVolumes_ = java.util.Collections.emptyList(); + revision_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ServiceConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ServiceConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + service_ = s; + break; + } + case 16: + { + timeoutSeconds_ = input.readInt32(); + break; + } + case 34: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + environmentVariables_ = + com.google.protobuf.MapField.newMapField( + EnvironmentVariablesDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry + environmentVariables__ = + input.readMessage( + EnvironmentVariablesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + environmentVariables_ + .getMutableMap() + .put(environmentVariables__.getKey(), environmentVariables__.getValue()); + break; + } + case 40: + { + maxInstanceCount_ = input.readInt32(); + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + vpcConnector_ = s; + break; + } + case 56: + { + int rawValue = input.readEnum(); + + vpcConnectorEgressSettings_ = rawValue; + break; + } + case 64: + { + int rawValue = input.readEnum(); + + ingressSettings_ = rawValue; + break; + } + case 74: + { + java.lang.String s = input.readStringRequireUtf8(); + + uri_ = s; + break; + } + case 82: + { + java.lang.String s = input.readStringRequireUtf8(); + + serviceAccountEmail_ = s; + break; + } + case 96: + { + minInstanceCount_ = input.readInt32(); + break; + } + case 106: + { + java.lang.String s = input.readStringRequireUtf8(); + + availableMemory_ = s; + break; + } + case 128: + { + allTrafficOnLatestRevision_ = input.readBool(); + break; + } + case 138: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + secretEnvironmentVariables_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + secretEnvironmentVariables_.add( + input.readMessage( + com.google.cloud.functions.v2beta.SecretEnvVar.parser(), extensionRegistry)); + break; + } + case 146: + { + java.lang.String s = input.readStringRequireUtf8(); + + revision_ = s; + break; + } + case 154: + { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + secretVolumes_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + secretVolumes_.add( + input.readMessage( + com.google.cloud.functions.v2beta.SecretVolume.parser(), extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) != 0)) { + secretEnvironmentVariables_ = + java.util.Collections.unmodifiableList(secretEnvironmentVariables_); + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + secretVolumes_ = java.util.Collections.unmodifiableList(secretVolumes_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_ServiceConfig_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetEnvironmentVariables(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_ServiceConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.ServiceConfig.class, + com.google.cloud.functions.v2beta.ServiceConfig.Builder.class); + } + + /** + * + * + *
+   * Available egress settings.
+   * This controls what traffic is diverted through the VPC Access Connector
+   * resource. By default PRIVATE_RANGES_ONLY will be used.
+   * 
+ * + * Protobuf enum {@code google.cloud.functions.v2beta.ServiceConfig.VpcConnectorEgressSettings} + */ + public enum VpcConnectorEgressSettings implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified.
+     * 
+ * + * VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED = 0; + */ + VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED(0), + /** + * + * + *
+     * Use the VPC Access Connector only for private IP space from RFC1918.
+     * 
+ * + * PRIVATE_RANGES_ONLY = 1; + */ + PRIVATE_RANGES_ONLY(1), + /** + * + * + *
+     * Force the use of VPC Access Connector for all egress traffic from the
+     * function.
+     * 
+ * + * ALL_TRAFFIC = 2; + */ + ALL_TRAFFIC(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified.
+     * 
+ * + * VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED = 0; + */ + public static final int VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Use the VPC Access Connector only for private IP space from RFC1918.
+     * 
+ * + * PRIVATE_RANGES_ONLY = 1; + */ + public static final int PRIVATE_RANGES_ONLY_VALUE = 1; + /** + * + * + *
+     * Force the use of VPC Access Connector for all egress traffic from the
+     * function.
+     * 
+ * + * ALL_TRAFFIC = 2; + */ + public static final int ALL_TRAFFIC_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static VpcConnectorEgressSettings valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static VpcConnectorEgressSettings forNumber(int value) { + switch (value) { + case 0: + return VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED; + case 1: + return PRIVATE_RANGES_ONLY; + case 2: + return ALL_TRAFFIC; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public VpcConnectorEgressSettings findValueByNumber(int number) { + return VpcConnectorEgressSettings.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.functions.v2beta.ServiceConfig.getDescriptor().getEnumTypes().get(0); + } + + private static final VpcConnectorEgressSettings[] VALUES = values(); + + public static VpcConnectorEgressSettings valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private VpcConnectorEgressSettings(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.functions.v2beta.ServiceConfig.VpcConnectorEgressSettings) + } + + /** + * + * + *
+   * Available ingress settings.
+   * This controls what traffic can reach the function.
+   * If unspecified, ALLOW_ALL will be used.
+   * 
+ * + * Protobuf enum {@code google.cloud.functions.v2beta.ServiceConfig.IngressSettings} + */ + public enum IngressSettings implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified.
+     * 
+ * + * INGRESS_SETTINGS_UNSPECIFIED = 0; + */ + INGRESS_SETTINGS_UNSPECIFIED(0), + /** + * + * + *
+     * Allow HTTP traffic from public and private sources.
+     * 
+ * + * ALLOW_ALL = 1; + */ + ALLOW_ALL(1), + /** + * + * + *
+     * Allow HTTP traffic from only private VPC sources.
+     * 
+ * + * ALLOW_INTERNAL_ONLY = 2; + */ + ALLOW_INTERNAL_ONLY(2), + /** + * + * + *
+     * Allow HTTP traffic from private VPC sources and through GCLB.
+     * 
+ * + * ALLOW_INTERNAL_AND_GCLB = 3; + */ + ALLOW_INTERNAL_AND_GCLB(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified.
+     * 
+ * + * INGRESS_SETTINGS_UNSPECIFIED = 0; + */ + public static final int INGRESS_SETTINGS_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Allow HTTP traffic from public and private sources.
+     * 
+ * + * ALLOW_ALL = 1; + */ + public static final int ALLOW_ALL_VALUE = 1; + /** + * + * + *
+     * Allow HTTP traffic from only private VPC sources.
+     * 
+ * + * ALLOW_INTERNAL_ONLY = 2; + */ + public static final int ALLOW_INTERNAL_ONLY_VALUE = 2; + /** + * + * + *
+     * Allow HTTP traffic from private VPC sources and through GCLB.
+     * 
+ * + * ALLOW_INTERNAL_AND_GCLB = 3; + */ + public static final int ALLOW_INTERNAL_AND_GCLB_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static IngressSettings valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static IngressSettings forNumber(int value) { + switch (value) { + case 0: + return INGRESS_SETTINGS_UNSPECIFIED; + case 1: + return ALLOW_ALL; + case 2: + return ALLOW_INTERNAL_ONLY; + case 3: + return ALLOW_INTERNAL_AND_GCLB; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public IngressSettings findValueByNumber(int number) { + return IngressSettings.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.functions.v2beta.ServiceConfig.getDescriptor().getEnumTypes().get(1); + } + + private static final IngressSettings[] VALUES = values(); + + public static IngressSettings valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private IngressSettings(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.functions.v2beta.ServiceConfig.IngressSettings) + } + + public static final int SERVICE_FIELD_NUMBER = 1; + private volatile java.lang.Object service_; + /** + * + * + *
+   * Output only. Name of the service associated with a Function.
+   * The format of this field is
+   * `projects/{project}/locations/{region}/services/{service}`
+   * 
+ * + * + * string service = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The service. + */ + @java.lang.Override + public java.lang.String getService() { + java.lang.Object ref = service_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + service_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Name of the service associated with a Function.
+   * The format of this field is
+   * `projects/{project}/locations/{region}/services/{service}`
+   * 
+ * + * + * string service = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for service. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceBytes() { + java.lang.Object ref = service_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + service_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TIMEOUT_SECONDS_FIELD_NUMBER = 2; + private int timeoutSeconds_; + /** + * + * + *
+   * The function execution timeout. Execution is considered failed and
+   * can be terminated if the function is not completed at the end of the
+   * timeout period. Defaults to 60 seconds.
+   * 
+ * + * int32 timeout_seconds = 2; + * + * @return The timeoutSeconds. + */ + @java.lang.Override + public int getTimeoutSeconds() { + return timeoutSeconds_; + } + + public static final int AVAILABLE_MEMORY_FIELD_NUMBER = 13; + private volatile java.lang.Object availableMemory_; + /** + * + * + *
+   * The amount of memory available for a function.
+   * Defaults to 256M. Supported units are k, M, G, Mi, Gi. If no unit is
+   * supplied the value is interpreted as bytes.
+   * See
+   * https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go
+   * a full description.
+   * 
+ * + * string available_memory = 13; + * + * @return The availableMemory. + */ + @java.lang.Override + public java.lang.String getAvailableMemory() { + java.lang.Object ref = availableMemory_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + availableMemory_ = s; + return s; + } + } + /** + * + * + *
+   * The amount of memory available for a function.
+   * Defaults to 256M. Supported units are k, M, G, Mi, Gi. If no unit is
+   * supplied the value is interpreted as bytes.
+   * See
+   * https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go
+   * a full description.
+   * 
+ * + * string available_memory = 13; + * + * @return The bytes for availableMemory. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAvailableMemoryBytes() { + java.lang.Object ref = availableMemory_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + availableMemory_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENVIRONMENT_VARIABLES_FIELD_NUMBER = 4; + + private static final class EnvironmentVariablesDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_ServiceConfig_EnvironmentVariablesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField environmentVariables_; + + private com.google.protobuf.MapField + internalGetEnvironmentVariables() { + if (environmentVariables_ == null) { + return com.google.protobuf.MapField.emptyMapField( + EnvironmentVariablesDefaultEntryHolder.defaultEntry); + } + return environmentVariables_; + } + + public int getEnvironmentVariablesCount() { + return internalGetEnvironmentVariables().getMap().size(); + } + /** + * + * + *
+   * Environment variables that shall be available during function execution.
+   * 
+ * + * map<string, string> environment_variables = 4; + */ + @java.lang.Override + public boolean containsEnvironmentVariables(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetEnvironmentVariables().getMap().containsKey(key); + } + /** Use {@link #getEnvironmentVariablesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getEnvironmentVariables() { + return getEnvironmentVariablesMap(); + } + /** + * + * + *
+   * Environment variables that shall be available during function execution.
+   * 
+ * + * map<string, string> environment_variables = 4; + */ + @java.lang.Override + public java.util.Map getEnvironmentVariablesMap() { + return internalGetEnvironmentVariables().getMap(); + } + /** + * + * + *
+   * Environment variables that shall be available during function execution.
+   * 
+ * + * map<string, string> environment_variables = 4; + */ + @java.lang.Override + public java.lang.String getEnvironmentVariablesOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetEnvironmentVariables().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Environment variables that shall be available during function execution.
+   * 
+ * + * map<string, string> environment_variables = 4; + */ + @java.lang.Override + public java.lang.String getEnvironmentVariablesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetEnvironmentVariables().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int MAX_INSTANCE_COUNT_FIELD_NUMBER = 5; + private int maxInstanceCount_; + /** + * + * + *
+   * The limit on the maximum number of function instances that may coexist at a
+   * given time.
+   * In some cases, such as rapid traffic surges, Cloud Functions may, for a
+   * short period of time, create more instances than the specified max
+   * instances limit. If your function cannot tolerate this temporary behavior,
+   * you may want to factor in a safety margin and set a lower max instances
+   * value than your function can tolerate.
+   * See the [Max
+   * Instances](https://cloud.google.com/functions/docs/max-instances) Guide for
+   * more details.
+   * 
+ * + * int32 max_instance_count = 5; + * + * @return The maxInstanceCount. + */ + @java.lang.Override + public int getMaxInstanceCount() { + return maxInstanceCount_; + } + + public static final int MIN_INSTANCE_COUNT_FIELD_NUMBER = 12; + private int minInstanceCount_; + /** + * + * + *
+   * The limit on the minimum number of function instances that may coexist at a
+   * given time.
+   * Function instances are kept in idle state for a short period after they
+   * finished executing the request to reduce cold start time for subsequent
+   * requests. Setting a minimum instance count will ensure that the given
+   * number of instances are kept running in idle state always. This can help
+   * with cold start times when jump in incoming request count occurs after the
+   * idle instance would have been stopped in the default case.
+   * 
+ * + * int32 min_instance_count = 12; + * + * @return The minInstanceCount. + */ + @java.lang.Override + public int getMinInstanceCount() { + return minInstanceCount_; + } + + public static final int VPC_CONNECTOR_FIELD_NUMBER = 6; + private volatile java.lang.Object vpcConnector_; + /** + * + * + *
+   * The Serverless VPC Access connector that this cloud function can connect
+   * to. The format of this field is `projects/*/locations/*/connectors/*`.
+   * 
+ * + * string vpc_connector = 6 [(.google.api.resource_reference) = { ... } + * + * @return The vpcConnector. + */ + @java.lang.Override + public java.lang.String getVpcConnector() { + java.lang.Object ref = vpcConnector_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + vpcConnector_ = s; + return s; + } + } + /** + * + * + *
+   * The Serverless VPC Access connector that this cloud function can connect
+   * to. The format of this field is `projects/*/locations/*/connectors/*`.
+   * 
+ * + * string vpc_connector = 6 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for vpcConnector. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVpcConnectorBytes() { + java.lang.Object ref = vpcConnector_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + vpcConnector_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VPC_CONNECTOR_EGRESS_SETTINGS_FIELD_NUMBER = 7; + private int vpcConnectorEgressSettings_; + /** + * + * + *
+   * The egress settings for the connector, controlling what traffic is diverted
+   * through it.
+   * 
+ * + * + * .google.cloud.functions.v2beta.ServiceConfig.VpcConnectorEgressSettings vpc_connector_egress_settings = 7; + * + * + * @return The enum numeric value on the wire for vpcConnectorEgressSettings. + */ + @java.lang.Override + public int getVpcConnectorEgressSettingsValue() { + return vpcConnectorEgressSettings_; + } + /** + * + * + *
+   * The egress settings for the connector, controlling what traffic is diverted
+   * through it.
+   * 
+ * + * + * .google.cloud.functions.v2beta.ServiceConfig.VpcConnectorEgressSettings vpc_connector_egress_settings = 7; + * + * + * @return The vpcConnectorEgressSettings. + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.ServiceConfig.VpcConnectorEgressSettings + getVpcConnectorEgressSettings() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2beta.ServiceConfig.VpcConnectorEgressSettings result = + com.google.cloud.functions.v2beta.ServiceConfig.VpcConnectorEgressSettings.valueOf( + vpcConnectorEgressSettings_); + return result == null + ? com.google.cloud.functions.v2beta.ServiceConfig.VpcConnectorEgressSettings.UNRECOGNIZED + : result; + } + + public static final int INGRESS_SETTINGS_FIELD_NUMBER = 8; + private int ingressSettings_; + /** + * + * + *
+   * The ingress settings for the function, controlling what traffic can reach
+   * it.
+   * 
+ * + * .google.cloud.functions.v2beta.ServiceConfig.IngressSettings ingress_settings = 8; + * + * @return The enum numeric value on the wire for ingressSettings. + */ + @java.lang.Override + public int getIngressSettingsValue() { + return ingressSettings_; + } + /** + * + * + *
+   * The ingress settings for the function, controlling what traffic can reach
+   * it.
+   * 
+ * + * .google.cloud.functions.v2beta.ServiceConfig.IngressSettings ingress_settings = 8; + * + * @return The ingressSettings. + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.ServiceConfig.IngressSettings getIngressSettings() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2beta.ServiceConfig.IngressSettings result = + com.google.cloud.functions.v2beta.ServiceConfig.IngressSettings.valueOf(ingressSettings_); + return result == null + ? com.google.cloud.functions.v2beta.ServiceConfig.IngressSettings.UNRECOGNIZED + : result; + } + + public static final int URI_FIELD_NUMBER = 9; + private volatile java.lang.Object uri_; + /** + * + * + *
+   * Output only. URI of the Service deployed.
+   * 
+ * + * string uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uri. + */ + @java.lang.Override + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. URI of the Service deployed.
+   * 
+ * + * string uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVICE_ACCOUNT_EMAIL_FIELD_NUMBER = 10; + private volatile java.lang.Object serviceAccountEmail_; + /** + * + * + *
+   * The email of the service's service account. If empty, defaults to
+   * `{project_number}-compute@developer.gserviceaccount.com`.
+   * 
+ * + * string service_account_email = 10; + * + * @return The serviceAccountEmail. + */ + @java.lang.Override + public java.lang.String getServiceAccountEmail() { + java.lang.Object ref = serviceAccountEmail_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAccountEmail_ = s; + return s; + } + } + /** + * + * + *
+   * The email of the service's service account. If empty, defaults to
+   * `{project_number}-compute@developer.gserviceaccount.com`.
+   * 
+ * + * string service_account_email = 10; + * + * @return The bytes for serviceAccountEmail. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceAccountEmailBytes() { + java.lang.Object ref = serviceAccountEmail_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAccountEmail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ALL_TRAFFIC_ON_LATEST_REVISION_FIELD_NUMBER = 16; + private boolean allTrafficOnLatestRevision_; + /** + * + * + *
+   * Whether 100% of traffic is routed to the latest revision.
+   * On CreateFunction and UpdateFunction, when set to true, the revision being
+   * deployed will serve 100% of traffic, ignoring any traffic split settings,
+   * if any. On GetFunction, true will be returned if the latest revision is
+   * serving 100% of traffic.
+   * 
+ * + * bool all_traffic_on_latest_revision = 16; + * + * @return The allTrafficOnLatestRevision. + */ + @java.lang.Override + public boolean getAllTrafficOnLatestRevision() { + return allTrafficOnLatestRevision_; + } + + public static final int SECRET_ENVIRONMENT_VARIABLES_FIELD_NUMBER = 17; + private java.util.List + secretEnvironmentVariables_; + /** + * + * + *
+   * Secret environment variables configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.SecretEnvVar secret_environment_variables = 17; + * + */ + @java.lang.Override + public java.util.List + getSecretEnvironmentVariablesList() { + return secretEnvironmentVariables_; + } + /** + * + * + *
+   * Secret environment variables configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.SecretEnvVar secret_environment_variables = 17; + * + */ + @java.lang.Override + public java.util.List + getSecretEnvironmentVariablesOrBuilderList() { + return secretEnvironmentVariables_; + } + /** + * + * + *
+   * Secret environment variables configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.SecretEnvVar secret_environment_variables = 17; + * + */ + @java.lang.Override + public int getSecretEnvironmentVariablesCount() { + return secretEnvironmentVariables_.size(); + } + /** + * + * + *
+   * Secret environment variables configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.SecretEnvVar secret_environment_variables = 17; + * + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.SecretEnvVar getSecretEnvironmentVariables(int index) { + return secretEnvironmentVariables_.get(index); + } + /** + * + * + *
+   * Secret environment variables configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.SecretEnvVar secret_environment_variables = 17; + * + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.SecretEnvVarOrBuilder + getSecretEnvironmentVariablesOrBuilder(int index) { + return secretEnvironmentVariables_.get(index); + } + + public static final int SECRET_VOLUMES_FIELD_NUMBER = 19; + private java.util.List secretVolumes_; + /** + * + * + *
+   * Secret volumes configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume secret_volumes = 19; + */ + @java.lang.Override + public java.util.List getSecretVolumesList() { + return secretVolumes_; + } + /** + * + * + *
+   * Secret volumes configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume secret_volumes = 19; + */ + @java.lang.Override + public java.util.List + getSecretVolumesOrBuilderList() { + return secretVolumes_; + } + /** + * + * + *
+   * Secret volumes configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume secret_volumes = 19; + */ + @java.lang.Override + public int getSecretVolumesCount() { + return secretVolumes_.size(); + } + /** + * + * + *
+   * Secret volumes configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume secret_volumes = 19; + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.SecretVolume getSecretVolumes(int index) { + return secretVolumes_.get(index); + } + /** + * + * + *
+   * Secret volumes configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume secret_volumes = 19; + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.SecretVolumeOrBuilder getSecretVolumesOrBuilder( + int index) { + return secretVolumes_.get(index); + } + + public static final int REVISION_FIELD_NUMBER = 18; + private volatile java.lang.Object revision_; + /** + * + * + *
+   * Output only. The name of service revision.
+   * 
+ * + * string revision = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The revision. + */ + @java.lang.Override + public java.lang.String getRevision() { + java.lang.Object ref = revision_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + revision_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The name of service revision.
+   * 
+ * + * string revision = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for revision. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRevisionBytes() { + java.lang.Object ref = revision_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + revision_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(service_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, service_); + } + if (timeoutSeconds_ != 0) { + output.writeInt32(2, timeoutSeconds_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, + internalGetEnvironmentVariables(), + EnvironmentVariablesDefaultEntryHolder.defaultEntry, + 4); + if (maxInstanceCount_ != 0) { + output.writeInt32(5, maxInstanceCount_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(vpcConnector_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, vpcConnector_); + } + if (vpcConnectorEgressSettings_ + != com.google.cloud.functions.v2beta.ServiceConfig.VpcConnectorEgressSettings + .VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED + .getNumber()) { + output.writeEnum(7, vpcConnectorEgressSettings_); + } + if (ingressSettings_ + != com.google.cloud.functions.v2beta.ServiceConfig.IngressSettings + .INGRESS_SETTINGS_UNSPECIFIED + .getNumber()) { + output.writeEnum(8, ingressSettings_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, uri_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccountEmail_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, serviceAccountEmail_); + } + if (minInstanceCount_ != 0) { + output.writeInt32(12, minInstanceCount_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(availableMemory_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 13, availableMemory_); + } + if (allTrafficOnLatestRevision_ != false) { + output.writeBool(16, allTrafficOnLatestRevision_); + } + for (int i = 0; i < secretEnvironmentVariables_.size(); i++) { + output.writeMessage(17, secretEnvironmentVariables_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(revision_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 18, revision_); + } + for (int i = 0; i < secretVolumes_.size(); i++) { + output.writeMessage(19, secretVolumes_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(service_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, service_); + } + if (timeoutSeconds_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, timeoutSeconds_); + } + for (java.util.Map.Entry entry : + internalGetEnvironmentVariables().getMap().entrySet()) { + com.google.protobuf.MapEntry environmentVariables__ = + EnvironmentVariablesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, environmentVariables__); + } + if (maxInstanceCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(5, maxInstanceCount_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(vpcConnector_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, vpcConnector_); + } + if (vpcConnectorEgressSettings_ + != com.google.cloud.functions.v2beta.ServiceConfig.VpcConnectorEgressSettings + .VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, vpcConnectorEgressSettings_); + } + if (ingressSettings_ + != com.google.cloud.functions.v2beta.ServiceConfig.IngressSettings + .INGRESS_SETTINGS_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, ingressSettings_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, uri_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccountEmail_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, serviceAccountEmail_); + } + if (minInstanceCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(12, minInstanceCount_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(availableMemory_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, availableMemory_); + } + if (allTrafficOnLatestRevision_ != false) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize(16, allTrafficOnLatestRevision_); + } + for (int i = 0; i < secretEnvironmentVariables_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 17, secretEnvironmentVariables_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(revision_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(18, revision_); + } + for (int i = 0; i < secretVolumes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(19, secretVolumes_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2beta.ServiceConfig)) { + return super.equals(obj); + } + com.google.cloud.functions.v2beta.ServiceConfig other = + (com.google.cloud.functions.v2beta.ServiceConfig) obj; + + if (!getService().equals(other.getService())) return false; + if (getTimeoutSeconds() != other.getTimeoutSeconds()) return false; + if (!getAvailableMemory().equals(other.getAvailableMemory())) return false; + if (!internalGetEnvironmentVariables().equals(other.internalGetEnvironmentVariables())) + return false; + if (getMaxInstanceCount() != other.getMaxInstanceCount()) return false; + if (getMinInstanceCount() != other.getMinInstanceCount()) return false; + if (!getVpcConnector().equals(other.getVpcConnector())) return false; + if (vpcConnectorEgressSettings_ != other.vpcConnectorEgressSettings_) return false; + if (ingressSettings_ != other.ingressSettings_) return false; + if (!getUri().equals(other.getUri())) return false; + if (!getServiceAccountEmail().equals(other.getServiceAccountEmail())) return false; + if (getAllTrafficOnLatestRevision() != other.getAllTrafficOnLatestRevision()) return false; + if (!getSecretEnvironmentVariablesList().equals(other.getSecretEnvironmentVariablesList())) + return false; + if (!getSecretVolumesList().equals(other.getSecretVolumesList())) return false; + if (!getRevision().equals(other.getRevision())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SERVICE_FIELD_NUMBER; + hash = (53 * hash) + getService().hashCode(); + hash = (37 * hash) + TIMEOUT_SECONDS_FIELD_NUMBER; + hash = (53 * hash) + getTimeoutSeconds(); + hash = (37 * hash) + AVAILABLE_MEMORY_FIELD_NUMBER; + hash = (53 * hash) + getAvailableMemory().hashCode(); + if (!internalGetEnvironmentVariables().getMap().isEmpty()) { + hash = (37 * hash) + ENVIRONMENT_VARIABLES_FIELD_NUMBER; + hash = (53 * hash) + internalGetEnvironmentVariables().hashCode(); + } + hash = (37 * hash) + MAX_INSTANCE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getMaxInstanceCount(); + hash = (37 * hash) + MIN_INSTANCE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getMinInstanceCount(); + hash = (37 * hash) + VPC_CONNECTOR_FIELD_NUMBER; + hash = (53 * hash) + getVpcConnector().hashCode(); + hash = (37 * hash) + VPC_CONNECTOR_EGRESS_SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + vpcConnectorEgressSettings_; + hash = (37 * hash) + INGRESS_SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + ingressSettings_; + hash = (37 * hash) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + hash = (37 * hash) + SERVICE_ACCOUNT_EMAIL_FIELD_NUMBER; + hash = (53 * hash) + getServiceAccountEmail().hashCode(); + hash = (37 * hash) + ALL_TRAFFIC_ON_LATEST_REVISION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllTrafficOnLatestRevision()); + if (getSecretEnvironmentVariablesCount() > 0) { + hash = (37 * hash) + SECRET_ENVIRONMENT_VARIABLES_FIELD_NUMBER; + hash = (53 * hash) + getSecretEnvironmentVariablesList().hashCode(); + } + if (getSecretVolumesCount() > 0) { + hash = (37 * hash) + SECRET_VOLUMES_FIELD_NUMBER; + hash = (53 * hash) + getSecretVolumesList().hashCode(); + } + hash = (37 * hash) + REVISION_FIELD_NUMBER; + hash = (53 * hash) + getRevision().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2beta.ServiceConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.ServiceConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.ServiceConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.ServiceConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.ServiceConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.ServiceConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.ServiceConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.ServiceConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.ServiceConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.ServiceConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.ServiceConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.ServiceConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v2beta.ServiceConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Describes the Service being deployed.
+   * Currently Supported : Cloud Run (fully managed).
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.ServiceConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2beta.ServiceConfig) + com.google.cloud.functions.v2beta.ServiceConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_ServiceConfig_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 4: + return internalGetEnvironmentVariables(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 4: + return internalGetMutableEnvironmentVariables(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_ServiceConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.ServiceConfig.class, + com.google.cloud.functions.v2beta.ServiceConfig.Builder.class); + } + + // Construct using com.google.cloud.functions.v2beta.ServiceConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getSecretEnvironmentVariablesFieldBuilder(); + getSecretVolumesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + service_ = ""; + + timeoutSeconds_ = 0; + + availableMemory_ = ""; + + internalGetMutableEnvironmentVariables().clear(); + maxInstanceCount_ = 0; + + minInstanceCount_ = 0; + + vpcConnector_ = ""; + + vpcConnectorEgressSettings_ = 0; + + ingressSettings_ = 0; + + uri_ = ""; + + serviceAccountEmail_ = ""; + + allTrafficOnLatestRevision_ = false; + + if (secretEnvironmentVariablesBuilder_ == null) { + secretEnvironmentVariables_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + secretEnvironmentVariablesBuilder_.clear(); + } + if (secretVolumesBuilder_ == null) { + secretVolumes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + secretVolumesBuilder_.clear(); + } + revision_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_ServiceConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.ServiceConfig getDefaultInstanceForType() { + return com.google.cloud.functions.v2beta.ServiceConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.ServiceConfig build() { + com.google.cloud.functions.v2beta.ServiceConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.ServiceConfig buildPartial() { + com.google.cloud.functions.v2beta.ServiceConfig result = + new com.google.cloud.functions.v2beta.ServiceConfig(this); + int from_bitField0_ = bitField0_; + result.service_ = service_; + result.timeoutSeconds_ = timeoutSeconds_; + result.availableMemory_ = availableMemory_; + result.environmentVariables_ = internalGetEnvironmentVariables(); + result.environmentVariables_.makeImmutable(); + result.maxInstanceCount_ = maxInstanceCount_; + result.minInstanceCount_ = minInstanceCount_; + result.vpcConnector_ = vpcConnector_; + result.vpcConnectorEgressSettings_ = vpcConnectorEgressSettings_; + result.ingressSettings_ = ingressSettings_; + result.uri_ = uri_; + result.serviceAccountEmail_ = serviceAccountEmail_; + result.allTrafficOnLatestRevision_ = allTrafficOnLatestRevision_; + if (secretEnvironmentVariablesBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + secretEnvironmentVariables_ = + java.util.Collections.unmodifiableList(secretEnvironmentVariables_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.secretEnvironmentVariables_ = secretEnvironmentVariables_; + } else { + result.secretEnvironmentVariables_ = secretEnvironmentVariablesBuilder_.build(); + } + if (secretVolumesBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + secretVolumes_ = java.util.Collections.unmodifiableList(secretVolumes_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.secretVolumes_ = secretVolumes_; + } else { + result.secretVolumes_ = secretVolumesBuilder_.build(); + } + result.revision_ = revision_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2beta.ServiceConfig) { + return mergeFrom((com.google.cloud.functions.v2beta.ServiceConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2beta.ServiceConfig other) { + if (other == com.google.cloud.functions.v2beta.ServiceConfig.getDefaultInstance()) + return this; + if (!other.getService().isEmpty()) { + service_ = other.service_; + onChanged(); + } + if (other.getTimeoutSeconds() != 0) { + setTimeoutSeconds(other.getTimeoutSeconds()); + } + if (!other.getAvailableMemory().isEmpty()) { + availableMemory_ = other.availableMemory_; + onChanged(); + } + internalGetMutableEnvironmentVariables().mergeFrom(other.internalGetEnvironmentVariables()); + if (other.getMaxInstanceCount() != 0) { + setMaxInstanceCount(other.getMaxInstanceCount()); + } + if (other.getMinInstanceCount() != 0) { + setMinInstanceCount(other.getMinInstanceCount()); + } + if (!other.getVpcConnector().isEmpty()) { + vpcConnector_ = other.vpcConnector_; + onChanged(); + } + if (other.vpcConnectorEgressSettings_ != 0) { + setVpcConnectorEgressSettingsValue(other.getVpcConnectorEgressSettingsValue()); + } + if (other.ingressSettings_ != 0) { + setIngressSettingsValue(other.getIngressSettingsValue()); + } + if (!other.getUri().isEmpty()) { + uri_ = other.uri_; + onChanged(); + } + if (!other.getServiceAccountEmail().isEmpty()) { + serviceAccountEmail_ = other.serviceAccountEmail_; + onChanged(); + } + if (other.getAllTrafficOnLatestRevision() != false) { + setAllTrafficOnLatestRevision(other.getAllTrafficOnLatestRevision()); + } + if (secretEnvironmentVariablesBuilder_ == null) { + if (!other.secretEnvironmentVariables_.isEmpty()) { + if (secretEnvironmentVariables_.isEmpty()) { + secretEnvironmentVariables_ = other.secretEnvironmentVariables_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureSecretEnvironmentVariablesIsMutable(); + secretEnvironmentVariables_.addAll(other.secretEnvironmentVariables_); + } + onChanged(); + } + } else { + if (!other.secretEnvironmentVariables_.isEmpty()) { + if (secretEnvironmentVariablesBuilder_.isEmpty()) { + secretEnvironmentVariablesBuilder_.dispose(); + secretEnvironmentVariablesBuilder_ = null; + secretEnvironmentVariables_ = other.secretEnvironmentVariables_; + bitField0_ = (bitField0_ & ~0x00000002); + secretEnvironmentVariablesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSecretEnvironmentVariablesFieldBuilder() + : null; + } else { + secretEnvironmentVariablesBuilder_.addAllMessages(other.secretEnvironmentVariables_); + } + } + } + if (secretVolumesBuilder_ == null) { + if (!other.secretVolumes_.isEmpty()) { + if (secretVolumes_.isEmpty()) { + secretVolumes_ = other.secretVolumes_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureSecretVolumesIsMutable(); + secretVolumes_.addAll(other.secretVolumes_); + } + onChanged(); + } + } else { + if (!other.secretVolumes_.isEmpty()) { + if (secretVolumesBuilder_.isEmpty()) { + secretVolumesBuilder_.dispose(); + secretVolumesBuilder_ = null; + secretVolumes_ = other.secretVolumes_; + bitField0_ = (bitField0_ & ~0x00000004); + secretVolumesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSecretVolumesFieldBuilder() + : null; + } else { + secretVolumesBuilder_.addAllMessages(other.secretVolumes_); + } + } + } + if (!other.getRevision().isEmpty()) { + revision_ = other.revision_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2beta.ServiceConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v2beta.ServiceConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object service_ = ""; + /** + * + * + *
+     * Output only. Name of the service associated with a Function.
+     * The format of this field is
+     * `projects/{project}/locations/{region}/services/{service}`
+     * 
+ * + * + * string service = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The service. + */ + public java.lang.String getService() { + java.lang.Object ref = service_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + service_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Name of the service associated with a Function.
+     * The format of this field is
+     * `projects/{project}/locations/{region}/services/{service}`
+     * 
+ * + * + * string service = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for service. + */ + public com.google.protobuf.ByteString getServiceBytes() { + java.lang.Object ref = service_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + service_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Name of the service associated with a Function.
+     * The format of this field is
+     * `projects/{project}/locations/{region}/services/{service}`
+     * 
+ * + * + * string service = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The service to set. + * @return This builder for chaining. + */ + public Builder setService(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + service_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the service associated with a Function.
+     * The format of this field is
+     * `projects/{project}/locations/{region}/services/{service}`
+     * 
+ * + * + * string service = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearService() { + + service_ = getDefaultInstance().getService(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Name of the service associated with a Function.
+     * The format of this field is
+     * `projects/{project}/locations/{region}/services/{service}`
+     * 
+ * + * + * string service = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for service to set. + * @return This builder for chaining. + */ + public Builder setServiceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + service_ = value; + onChanged(); + return this; + } + + private int timeoutSeconds_; + /** + * + * + *
+     * The function execution timeout. Execution is considered failed and
+     * can be terminated if the function is not completed at the end of the
+     * timeout period. Defaults to 60 seconds.
+     * 
+ * + * int32 timeout_seconds = 2; + * + * @return The timeoutSeconds. + */ + @java.lang.Override + public int getTimeoutSeconds() { + return timeoutSeconds_; + } + /** + * + * + *
+     * The function execution timeout. Execution is considered failed and
+     * can be terminated if the function is not completed at the end of the
+     * timeout period. Defaults to 60 seconds.
+     * 
+ * + * int32 timeout_seconds = 2; + * + * @param value The timeoutSeconds to set. + * @return This builder for chaining. + */ + public Builder setTimeoutSeconds(int value) { + + timeoutSeconds_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The function execution timeout. Execution is considered failed and
+     * can be terminated if the function is not completed at the end of the
+     * timeout period. Defaults to 60 seconds.
+     * 
+ * + * int32 timeout_seconds = 2; + * + * @return This builder for chaining. + */ + public Builder clearTimeoutSeconds() { + + timeoutSeconds_ = 0; + onChanged(); + return this; + } + + private java.lang.Object availableMemory_ = ""; + /** + * + * + *
+     * The amount of memory available for a function.
+     * Defaults to 256M. Supported units are k, M, G, Mi, Gi. If no unit is
+     * supplied the value is interpreted as bytes.
+     * See
+     * https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go
+     * a full description.
+     * 
+ * + * string available_memory = 13; + * + * @return The availableMemory. + */ + public java.lang.String getAvailableMemory() { + java.lang.Object ref = availableMemory_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + availableMemory_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The amount of memory available for a function.
+     * Defaults to 256M. Supported units are k, M, G, Mi, Gi. If no unit is
+     * supplied the value is interpreted as bytes.
+     * See
+     * https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go
+     * a full description.
+     * 
+ * + * string available_memory = 13; + * + * @return The bytes for availableMemory. + */ + public com.google.protobuf.ByteString getAvailableMemoryBytes() { + java.lang.Object ref = availableMemory_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + availableMemory_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The amount of memory available for a function.
+     * Defaults to 256M. Supported units are k, M, G, Mi, Gi. If no unit is
+     * supplied the value is interpreted as bytes.
+     * See
+     * https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go
+     * a full description.
+     * 
+ * + * string available_memory = 13; + * + * @param value The availableMemory to set. + * @return This builder for chaining. + */ + public Builder setAvailableMemory(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + availableMemory_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The amount of memory available for a function.
+     * Defaults to 256M. Supported units are k, M, G, Mi, Gi. If no unit is
+     * supplied the value is interpreted as bytes.
+     * See
+     * https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go
+     * a full description.
+     * 
+ * + * string available_memory = 13; + * + * @return This builder for chaining. + */ + public Builder clearAvailableMemory() { + + availableMemory_ = getDefaultInstance().getAvailableMemory(); + onChanged(); + return this; + } + /** + * + * + *
+     * The amount of memory available for a function.
+     * Defaults to 256M. Supported units are k, M, G, Mi, Gi. If no unit is
+     * supplied the value is interpreted as bytes.
+     * See
+     * https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go
+     * a full description.
+     * 
+ * + * string available_memory = 13; + * + * @param value The bytes for availableMemory to set. + * @return This builder for chaining. + */ + public Builder setAvailableMemoryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + availableMemory_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField environmentVariables_; + + private com.google.protobuf.MapField + internalGetEnvironmentVariables() { + if (environmentVariables_ == null) { + return com.google.protobuf.MapField.emptyMapField( + EnvironmentVariablesDefaultEntryHolder.defaultEntry); + } + return environmentVariables_; + } + + private com.google.protobuf.MapField + internalGetMutableEnvironmentVariables() { + onChanged(); + ; + if (environmentVariables_ == null) { + environmentVariables_ = + com.google.protobuf.MapField.newMapField( + EnvironmentVariablesDefaultEntryHolder.defaultEntry); + } + if (!environmentVariables_.isMutable()) { + environmentVariables_ = environmentVariables_.copy(); + } + return environmentVariables_; + } + + public int getEnvironmentVariablesCount() { + return internalGetEnvironmentVariables().getMap().size(); + } + /** + * + * + *
+     * Environment variables that shall be available during function execution.
+     * 
+ * + * map<string, string> environment_variables = 4; + */ + @java.lang.Override + public boolean containsEnvironmentVariables(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetEnvironmentVariables().getMap().containsKey(key); + } + /** Use {@link #getEnvironmentVariablesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getEnvironmentVariables() { + return getEnvironmentVariablesMap(); + } + /** + * + * + *
+     * Environment variables that shall be available during function execution.
+     * 
+ * + * map<string, string> environment_variables = 4; + */ + @java.lang.Override + public java.util.Map getEnvironmentVariablesMap() { + return internalGetEnvironmentVariables().getMap(); + } + /** + * + * + *
+     * Environment variables that shall be available during function execution.
+     * 
+ * + * map<string, string> environment_variables = 4; + */ + @java.lang.Override + public java.lang.String getEnvironmentVariablesOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetEnvironmentVariables().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Environment variables that shall be available during function execution.
+     * 
+ * + * map<string, string> environment_variables = 4; + */ + @java.lang.Override + public java.lang.String getEnvironmentVariablesOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetEnvironmentVariables().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearEnvironmentVariables() { + internalGetMutableEnvironmentVariables().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Environment variables that shall be available during function execution.
+     * 
+ * + * map<string, string> environment_variables = 4; + */ + public Builder removeEnvironmentVariables(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableEnvironmentVariables().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableEnvironmentVariables() { + return internalGetMutableEnvironmentVariables().getMutableMap(); + } + /** + * + * + *
+     * Environment variables that shall be available during function execution.
+     * 
+ * + * map<string, string> environment_variables = 4; + */ + public Builder putEnvironmentVariables(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableEnvironmentVariables().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Environment variables that shall be available during function execution.
+     * 
+ * + * map<string, string> environment_variables = 4; + */ + public Builder putAllEnvironmentVariables( + java.util.Map values) { + internalGetMutableEnvironmentVariables().getMutableMap().putAll(values); + return this; + } + + private int maxInstanceCount_; + /** + * + * + *
+     * The limit on the maximum number of function instances that may coexist at a
+     * given time.
+     * In some cases, such as rapid traffic surges, Cloud Functions may, for a
+     * short period of time, create more instances than the specified max
+     * instances limit. If your function cannot tolerate this temporary behavior,
+     * you may want to factor in a safety margin and set a lower max instances
+     * value than your function can tolerate.
+     * See the [Max
+     * Instances](https://cloud.google.com/functions/docs/max-instances) Guide for
+     * more details.
+     * 
+ * + * int32 max_instance_count = 5; + * + * @return The maxInstanceCount. + */ + @java.lang.Override + public int getMaxInstanceCount() { + return maxInstanceCount_; + } + /** + * + * + *
+     * The limit on the maximum number of function instances that may coexist at a
+     * given time.
+     * In some cases, such as rapid traffic surges, Cloud Functions may, for a
+     * short period of time, create more instances than the specified max
+     * instances limit. If your function cannot tolerate this temporary behavior,
+     * you may want to factor in a safety margin and set a lower max instances
+     * value than your function can tolerate.
+     * See the [Max
+     * Instances](https://cloud.google.com/functions/docs/max-instances) Guide for
+     * more details.
+     * 
+ * + * int32 max_instance_count = 5; + * + * @param value The maxInstanceCount to set. + * @return This builder for chaining. + */ + public Builder setMaxInstanceCount(int value) { + + maxInstanceCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The limit on the maximum number of function instances that may coexist at a
+     * given time.
+     * In some cases, such as rapid traffic surges, Cloud Functions may, for a
+     * short period of time, create more instances than the specified max
+     * instances limit. If your function cannot tolerate this temporary behavior,
+     * you may want to factor in a safety margin and set a lower max instances
+     * value than your function can tolerate.
+     * See the [Max
+     * Instances](https://cloud.google.com/functions/docs/max-instances) Guide for
+     * more details.
+     * 
+ * + * int32 max_instance_count = 5; + * + * @return This builder for chaining. + */ + public Builder clearMaxInstanceCount() { + + maxInstanceCount_ = 0; + onChanged(); + return this; + } + + private int minInstanceCount_; + /** + * + * + *
+     * The limit on the minimum number of function instances that may coexist at a
+     * given time.
+     * Function instances are kept in idle state for a short period after they
+     * finished executing the request to reduce cold start time for subsequent
+     * requests. Setting a minimum instance count will ensure that the given
+     * number of instances are kept running in idle state always. This can help
+     * with cold start times when jump in incoming request count occurs after the
+     * idle instance would have been stopped in the default case.
+     * 
+ * + * int32 min_instance_count = 12; + * + * @return The minInstanceCount. + */ + @java.lang.Override + public int getMinInstanceCount() { + return minInstanceCount_; + } + /** + * + * + *
+     * The limit on the minimum number of function instances that may coexist at a
+     * given time.
+     * Function instances are kept in idle state for a short period after they
+     * finished executing the request to reduce cold start time for subsequent
+     * requests. Setting a minimum instance count will ensure that the given
+     * number of instances are kept running in idle state always. This can help
+     * with cold start times when jump in incoming request count occurs after the
+     * idle instance would have been stopped in the default case.
+     * 
+ * + * int32 min_instance_count = 12; + * + * @param value The minInstanceCount to set. + * @return This builder for chaining. + */ + public Builder setMinInstanceCount(int value) { + + minInstanceCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The limit on the minimum number of function instances that may coexist at a
+     * given time.
+     * Function instances are kept in idle state for a short period after they
+     * finished executing the request to reduce cold start time for subsequent
+     * requests. Setting a minimum instance count will ensure that the given
+     * number of instances are kept running in idle state always. This can help
+     * with cold start times when jump in incoming request count occurs after the
+     * idle instance would have been stopped in the default case.
+     * 
+ * + * int32 min_instance_count = 12; + * + * @return This builder for chaining. + */ + public Builder clearMinInstanceCount() { + + minInstanceCount_ = 0; + onChanged(); + return this; + } + + private java.lang.Object vpcConnector_ = ""; + /** + * + * + *
+     * The Serverless VPC Access connector that this cloud function can connect
+     * to. The format of this field is `projects/*/locations/*/connectors/*`.
+     * 
+ * + * string vpc_connector = 6 [(.google.api.resource_reference) = { ... } + * + * @return The vpcConnector. + */ + public java.lang.String getVpcConnector() { + java.lang.Object ref = vpcConnector_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + vpcConnector_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The Serverless VPC Access connector that this cloud function can connect
+     * to. The format of this field is `projects/*/locations/*/connectors/*`.
+     * 
+ * + * string vpc_connector = 6 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for vpcConnector. + */ + public com.google.protobuf.ByteString getVpcConnectorBytes() { + java.lang.Object ref = vpcConnector_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + vpcConnector_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The Serverless VPC Access connector that this cloud function can connect
+     * to. The format of this field is `projects/*/locations/*/connectors/*`.
+     * 
+ * + * string vpc_connector = 6 [(.google.api.resource_reference) = { ... } + * + * @param value The vpcConnector to set. + * @return This builder for chaining. + */ + public Builder setVpcConnector(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + vpcConnector_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The Serverless VPC Access connector that this cloud function can connect
+     * to. The format of this field is `projects/*/locations/*/connectors/*`.
+     * 
+ * + * string vpc_connector = 6 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearVpcConnector() { + + vpcConnector_ = getDefaultInstance().getVpcConnector(); + onChanged(); + return this; + } + /** + * + * + *
+     * The Serverless VPC Access connector that this cloud function can connect
+     * to. The format of this field is `projects/*/locations/*/connectors/*`.
+     * 
+ * + * string vpc_connector = 6 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for vpcConnector to set. + * @return This builder for chaining. + */ + public Builder setVpcConnectorBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + vpcConnector_ = value; + onChanged(); + return this; + } + + private int vpcConnectorEgressSettings_ = 0; + /** + * + * + *
+     * The egress settings for the connector, controlling what traffic is diverted
+     * through it.
+     * 
+ * + * + * .google.cloud.functions.v2beta.ServiceConfig.VpcConnectorEgressSettings vpc_connector_egress_settings = 7; + * + * + * @return The enum numeric value on the wire for vpcConnectorEgressSettings. + */ + @java.lang.Override + public int getVpcConnectorEgressSettingsValue() { + return vpcConnectorEgressSettings_; + } + /** + * + * + *
+     * The egress settings for the connector, controlling what traffic is diverted
+     * through it.
+     * 
+ * + * + * .google.cloud.functions.v2beta.ServiceConfig.VpcConnectorEgressSettings vpc_connector_egress_settings = 7; + * + * + * @param value The enum numeric value on the wire for vpcConnectorEgressSettings to set. + * @return This builder for chaining. + */ + public Builder setVpcConnectorEgressSettingsValue(int value) { + + vpcConnectorEgressSettings_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The egress settings for the connector, controlling what traffic is diverted
+     * through it.
+     * 
+ * + * + * .google.cloud.functions.v2beta.ServiceConfig.VpcConnectorEgressSettings vpc_connector_egress_settings = 7; + * + * + * @return The vpcConnectorEgressSettings. + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.ServiceConfig.VpcConnectorEgressSettings + getVpcConnectorEgressSettings() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2beta.ServiceConfig.VpcConnectorEgressSettings result = + com.google.cloud.functions.v2beta.ServiceConfig.VpcConnectorEgressSettings.valueOf( + vpcConnectorEgressSettings_); + return result == null + ? com.google.cloud.functions.v2beta.ServiceConfig.VpcConnectorEgressSettings.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The egress settings for the connector, controlling what traffic is diverted
+     * through it.
+     * 
+ * + * + * .google.cloud.functions.v2beta.ServiceConfig.VpcConnectorEgressSettings vpc_connector_egress_settings = 7; + * + * + * @param value The vpcConnectorEgressSettings to set. + * @return This builder for chaining. + */ + public Builder setVpcConnectorEgressSettings( + com.google.cloud.functions.v2beta.ServiceConfig.VpcConnectorEgressSettings value) { + if (value == null) { + throw new NullPointerException(); + } + + vpcConnectorEgressSettings_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The egress settings for the connector, controlling what traffic is diverted
+     * through it.
+     * 
+ * + * + * .google.cloud.functions.v2beta.ServiceConfig.VpcConnectorEgressSettings vpc_connector_egress_settings = 7; + * + * + * @return This builder for chaining. + */ + public Builder clearVpcConnectorEgressSettings() { + + vpcConnectorEgressSettings_ = 0; + onChanged(); + return this; + } + + private int ingressSettings_ = 0; + /** + * + * + *
+     * The ingress settings for the function, controlling what traffic can reach
+     * it.
+     * 
+ * + * .google.cloud.functions.v2beta.ServiceConfig.IngressSettings ingress_settings = 8; + * + * + * @return The enum numeric value on the wire for ingressSettings. + */ + @java.lang.Override + public int getIngressSettingsValue() { + return ingressSettings_; + } + /** + * + * + *
+     * The ingress settings for the function, controlling what traffic can reach
+     * it.
+     * 
+ * + * .google.cloud.functions.v2beta.ServiceConfig.IngressSettings ingress_settings = 8; + * + * + * @param value The enum numeric value on the wire for ingressSettings to set. + * @return This builder for chaining. + */ + public Builder setIngressSettingsValue(int value) { + + ingressSettings_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The ingress settings for the function, controlling what traffic can reach
+     * it.
+     * 
+ * + * .google.cloud.functions.v2beta.ServiceConfig.IngressSettings ingress_settings = 8; + * + * + * @return The ingressSettings. + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.ServiceConfig.IngressSettings getIngressSettings() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2beta.ServiceConfig.IngressSettings result = + com.google.cloud.functions.v2beta.ServiceConfig.IngressSettings.valueOf(ingressSettings_); + return result == null + ? com.google.cloud.functions.v2beta.ServiceConfig.IngressSettings.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The ingress settings for the function, controlling what traffic can reach
+     * it.
+     * 
+ * + * .google.cloud.functions.v2beta.ServiceConfig.IngressSettings ingress_settings = 8; + * + * + * @param value The ingressSettings to set. + * @return This builder for chaining. + */ + public Builder setIngressSettings( + com.google.cloud.functions.v2beta.ServiceConfig.IngressSettings value) { + if (value == null) { + throw new NullPointerException(); + } + + ingressSettings_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The ingress settings for the function, controlling what traffic can reach
+     * it.
+     * 
+ * + * .google.cloud.functions.v2beta.ServiceConfig.IngressSettings ingress_settings = 8; + * + * + * @return This builder for chaining. + */ + public Builder clearIngressSettings() { + + ingressSettings_ = 0; + onChanged(); + return this; + } + + private java.lang.Object uri_ = ""; + /** + * + * + *
+     * Output only. URI of the Service deployed.
+     * 
+ * + * string uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. URI of the Service deployed.
+     * 
+ * + * string uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. URI of the Service deployed.
+     * 
+ * + * string uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The uri to set. + * @return This builder for chaining. + */ + public Builder setUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + uri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. URI of the Service deployed.
+     * 
+ * + * string uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearUri() { + + uri_ = getDefaultInstance().getUri(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. URI of the Service deployed.
+     * 
+ * + * string uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for uri to set. + * @return This builder for chaining. + */ + public Builder setUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + uri_ = value; + onChanged(); + return this; + } + + private java.lang.Object serviceAccountEmail_ = ""; + /** + * + * + *
+     * The email of the service's service account. If empty, defaults to
+     * `{project_number}-compute@developer.gserviceaccount.com`.
+     * 
+ * + * string service_account_email = 10; + * + * @return The serviceAccountEmail. + */ + public java.lang.String getServiceAccountEmail() { + java.lang.Object ref = serviceAccountEmail_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAccountEmail_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The email of the service's service account. If empty, defaults to
+     * `{project_number}-compute@developer.gserviceaccount.com`.
+     * 
+ * + * string service_account_email = 10; + * + * @return The bytes for serviceAccountEmail. + */ + public com.google.protobuf.ByteString getServiceAccountEmailBytes() { + java.lang.Object ref = serviceAccountEmail_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAccountEmail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The email of the service's service account. If empty, defaults to
+     * `{project_number}-compute@developer.gserviceaccount.com`.
+     * 
+ * + * string service_account_email = 10; + * + * @param value The serviceAccountEmail to set. + * @return This builder for chaining. + */ + public Builder setServiceAccountEmail(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + serviceAccountEmail_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The email of the service's service account. If empty, defaults to
+     * `{project_number}-compute@developer.gserviceaccount.com`.
+     * 
+ * + * string service_account_email = 10; + * + * @return This builder for chaining. + */ + public Builder clearServiceAccountEmail() { + + serviceAccountEmail_ = getDefaultInstance().getServiceAccountEmail(); + onChanged(); + return this; + } + /** + * + * + *
+     * The email of the service's service account. If empty, defaults to
+     * `{project_number}-compute@developer.gserviceaccount.com`.
+     * 
+ * + * string service_account_email = 10; + * + * @param value The bytes for serviceAccountEmail to set. + * @return This builder for chaining. + */ + public Builder setServiceAccountEmailBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + serviceAccountEmail_ = value; + onChanged(); + return this; + } + + private boolean allTrafficOnLatestRevision_; + /** + * + * + *
+     * Whether 100% of traffic is routed to the latest revision.
+     * On CreateFunction and UpdateFunction, when set to true, the revision being
+     * deployed will serve 100% of traffic, ignoring any traffic split settings,
+     * if any. On GetFunction, true will be returned if the latest revision is
+     * serving 100% of traffic.
+     * 
+ * + * bool all_traffic_on_latest_revision = 16; + * + * @return The allTrafficOnLatestRevision. + */ + @java.lang.Override + public boolean getAllTrafficOnLatestRevision() { + return allTrafficOnLatestRevision_; + } + /** + * + * + *
+     * Whether 100% of traffic is routed to the latest revision.
+     * On CreateFunction and UpdateFunction, when set to true, the revision being
+     * deployed will serve 100% of traffic, ignoring any traffic split settings,
+     * if any. On GetFunction, true will be returned if the latest revision is
+     * serving 100% of traffic.
+     * 
+ * + * bool all_traffic_on_latest_revision = 16; + * + * @param value The allTrafficOnLatestRevision to set. + * @return This builder for chaining. + */ + public Builder setAllTrafficOnLatestRevision(boolean value) { + + allTrafficOnLatestRevision_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether 100% of traffic is routed to the latest revision.
+     * On CreateFunction and UpdateFunction, when set to true, the revision being
+     * deployed will serve 100% of traffic, ignoring any traffic split settings,
+     * if any. On GetFunction, true will be returned if the latest revision is
+     * serving 100% of traffic.
+     * 
+ * + * bool all_traffic_on_latest_revision = 16; + * + * @return This builder for chaining. + */ + public Builder clearAllTrafficOnLatestRevision() { + + allTrafficOnLatestRevision_ = false; + onChanged(); + return this; + } + + private java.util.List + secretEnvironmentVariables_ = java.util.Collections.emptyList(); + + private void ensureSecretEnvironmentVariablesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + secretEnvironmentVariables_ = + new java.util.ArrayList( + secretEnvironmentVariables_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2beta.SecretEnvVar, + com.google.cloud.functions.v2beta.SecretEnvVar.Builder, + com.google.cloud.functions.v2beta.SecretEnvVarOrBuilder> + secretEnvironmentVariablesBuilder_; + + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretEnvVar secret_environment_variables = 17; + * + */ + public java.util.List + getSecretEnvironmentVariablesList() { + if (secretEnvironmentVariablesBuilder_ == null) { + return java.util.Collections.unmodifiableList(secretEnvironmentVariables_); + } else { + return secretEnvironmentVariablesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretEnvVar secret_environment_variables = 17; + * + */ + public int getSecretEnvironmentVariablesCount() { + if (secretEnvironmentVariablesBuilder_ == null) { + return secretEnvironmentVariables_.size(); + } else { + return secretEnvironmentVariablesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretEnvVar secret_environment_variables = 17; + * + */ + public com.google.cloud.functions.v2beta.SecretEnvVar getSecretEnvironmentVariables(int index) { + if (secretEnvironmentVariablesBuilder_ == null) { + return secretEnvironmentVariables_.get(index); + } else { + return secretEnvironmentVariablesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretEnvVar secret_environment_variables = 17; + * + */ + public Builder setSecretEnvironmentVariables( + int index, com.google.cloud.functions.v2beta.SecretEnvVar value) { + if (secretEnvironmentVariablesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSecretEnvironmentVariablesIsMutable(); + secretEnvironmentVariables_.set(index, value); + onChanged(); + } else { + secretEnvironmentVariablesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretEnvVar secret_environment_variables = 17; + * + */ + public Builder setSecretEnvironmentVariables( + int index, com.google.cloud.functions.v2beta.SecretEnvVar.Builder builderForValue) { + if (secretEnvironmentVariablesBuilder_ == null) { + ensureSecretEnvironmentVariablesIsMutable(); + secretEnvironmentVariables_.set(index, builderForValue.build()); + onChanged(); + } else { + secretEnvironmentVariablesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretEnvVar secret_environment_variables = 17; + * + */ + public Builder addSecretEnvironmentVariables( + com.google.cloud.functions.v2beta.SecretEnvVar value) { + if (secretEnvironmentVariablesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSecretEnvironmentVariablesIsMutable(); + secretEnvironmentVariables_.add(value); + onChanged(); + } else { + secretEnvironmentVariablesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretEnvVar secret_environment_variables = 17; + * + */ + public Builder addSecretEnvironmentVariables( + int index, com.google.cloud.functions.v2beta.SecretEnvVar value) { + if (secretEnvironmentVariablesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSecretEnvironmentVariablesIsMutable(); + secretEnvironmentVariables_.add(index, value); + onChanged(); + } else { + secretEnvironmentVariablesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretEnvVar secret_environment_variables = 17; + * + */ + public Builder addSecretEnvironmentVariables( + com.google.cloud.functions.v2beta.SecretEnvVar.Builder builderForValue) { + if (secretEnvironmentVariablesBuilder_ == null) { + ensureSecretEnvironmentVariablesIsMutable(); + secretEnvironmentVariables_.add(builderForValue.build()); + onChanged(); + } else { + secretEnvironmentVariablesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretEnvVar secret_environment_variables = 17; + * + */ + public Builder addSecretEnvironmentVariables( + int index, com.google.cloud.functions.v2beta.SecretEnvVar.Builder builderForValue) { + if (secretEnvironmentVariablesBuilder_ == null) { + ensureSecretEnvironmentVariablesIsMutable(); + secretEnvironmentVariables_.add(index, builderForValue.build()); + onChanged(); + } else { + secretEnvironmentVariablesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretEnvVar secret_environment_variables = 17; + * + */ + public Builder addAllSecretEnvironmentVariables( + java.lang.Iterable values) { + if (secretEnvironmentVariablesBuilder_ == null) { + ensureSecretEnvironmentVariablesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, secretEnvironmentVariables_); + onChanged(); + } else { + secretEnvironmentVariablesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretEnvVar secret_environment_variables = 17; + * + */ + public Builder clearSecretEnvironmentVariables() { + if (secretEnvironmentVariablesBuilder_ == null) { + secretEnvironmentVariables_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + secretEnvironmentVariablesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretEnvVar secret_environment_variables = 17; + * + */ + public Builder removeSecretEnvironmentVariables(int index) { + if (secretEnvironmentVariablesBuilder_ == null) { + ensureSecretEnvironmentVariablesIsMutable(); + secretEnvironmentVariables_.remove(index); + onChanged(); + } else { + secretEnvironmentVariablesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretEnvVar secret_environment_variables = 17; + * + */ + public com.google.cloud.functions.v2beta.SecretEnvVar.Builder + getSecretEnvironmentVariablesBuilder(int index) { + return getSecretEnvironmentVariablesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretEnvVar secret_environment_variables = 17; + * + */ + public com.google.cloud.functions.v2beta.SecretEnvVarOrBuilder + getSecretEnvironmentVariablesOrBuilder(int index) { + if (secretEnvironmentVariablesBuilder_ == null) { + return secretEnvironmentVariables_.get(index); + } else { + return secretEnvironmentVariablesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretEnvVar secret_environment_variables = 17; + * + */ + public java.util.List + getSecretEnvironmentVariablesOrBuilderList() { + if (secretEnvironmentVariablesBuilder_ != null) { + return secretEnvironmentVariablesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(secretEnvironmentVariables_); + } + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretEnvVar secret_environment_variables = 17; + * + */ + public com.google.cloud.functions.v2beta.SecretEnvVar.Builder + addSecretEnvironmentVariablesBuilder() { + return getSecretEnvironmentVariablesFieldBuilder() + .addBuilder(com.google.cloud.functions.v2beta.SecretEnvVar.getDefaultInstance()); + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretEnvVar secret_environment_variables = 17; + * + */ + public com.google.cloud.functions.v2beta.SecretEnvVar.Builder + addSecretEnvironmentVariablesBuilder(int index) { + return getSecretEnvironmentVariablesFieldBuilder() + .addBuilder(index, com.google.cloud.functions.v2beta.SecretEnvVar.getDefaultInstance()); + } + /** + * + * + *
+     * Secret environment variables configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretEnvVar secret_environment_variables = 17; + * + */ + public java.util.List + getSecretEnvironmentVariablesBuilderList() { + return getSecretEnvironmentVariablesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2beta.SecretEnvVar, + com.google.cloud.functions.v2beta.SecretEnvVar.Builder, + com.google.cloud.functions.v2beta.SecretEnvVarOrBuilder> + getSecretEnvironmentVariablesFieldBuilder() { + if (secretEnvironmentVariablesBuilder_ == null) { + secretEnvironmentVariablesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2beta.SecretEnvVar, + com.google.cloud.functions.v2beta.SecretEnvVar.Builder, + com.google.cloud.functions.v2beta.SecretEnvVarOrBuilder>( + secretEnvironmentVariables_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + secretEnvironmentVariables_ = null; + } + return secretEnvironmentVariablesBuilder_; + } + + private java.util.List secretVolumes_ = + java.util.Collections.emptyList(); + + private void ensureSecretVolumesIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + secretVolumes_ = + new java.util.ArrayList(secretVolumes_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2beta.SecretVolume, + com.google.cloud.functions.v2beta.SecretVolume.Builder, + com.google.cloud.functions.v2beta.SecretVolumeOrBuilder> + secretVolumesBuilder_; + + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume secret_volumes = 19; + */ + public java.util.List getSecretVolumesList() { + if (secretVolumesBuilder_ == null) { + return java.util.Collections.unmodifiableList(secretVolumes_); + } else { + return secretVolumesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume secret_volumes = 19; + */ + public int getSecretVolumesCount() { + if (secretVolumesBuilder_ == null) { + return secretVolumes_.size(); + } else { + return secretVolumesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume secret_volumes = 19; + */ + public com.google.cloud.functions.v2beta.SecretVolume getSecretVolumes(int index) { + if (secretVolumesBuilder_ == null) { + return secretVolumes_.get(index); + } else { + return secretVolumesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume secret_volumes = 19; + */ + public Builder setSecretVolumes( + int index, com.google.cloud.functions.v2beta.SecretVolume value) { + if (secretVolumesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSecretVolumesIsMutable(); + secretVolumes_.set(index, value); + onChanged(); + } else { + secretVolumesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume secret_volumes = 19; + */ + public Builder setSecretVolumes( + int index, com.google.cloud.functions.v2beta.SecretVolume.Builder builderForValue) { + if (secretVolumesBuilder_ == null) { + ensureSecretVolumesIsMutable(); + secretVolumes_.set(index, builderForValue.build()); + onChanged(); + } else { + secretVolumesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume secret_volumes = 19; + */ + public Builder addSecretVolumes(com.google.cloud.functions.v2beta.SecretVolume value) { + if (secretVolumesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSecretVolumesIsMutable(); + secretVolumes_.add(value); + onChanged(); + } else { + secretVolumesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume secret_volumes = 19; + */ + public Builder addSecretVolumes( + int index, com.google.cloud.functions.v2beta.SecretVolume value) { + if (secretVolumesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSecretVolumesIsMutable(); + secretVolumes_.add(index, value); + onChanged(); + } else { + secretVolumesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume secret_volumes = 19; + */ + public Builder addSecretVolumes( + com.google.cloud.functions.v2beta.SecretVolume.Builder builderForValue) { + if (secretVolumesBuilder_ == null) { + ensureSecretVolumesIsMutable(); + secretVolumes_.add(builderForValue.build()); + onChanged(); + } else { + secretVolumesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume secret_volumes = 19; + */ + public Builder addSecretVolumes( + int index, com.google.cloud.functions.v2beta.SecretVolume.Builder builderForValue) { + if (secretVolumesBuilder_ == null) { + ensureSecretVolumesIsMutable(); + secretVolumes_.add(index, builderForValue.build()); + onChanged(); + } else { + secretVolumesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume secret_volumes = 19; + */ + public Builder addAllSecretVolumes( + java.lang.Iterable values) { + if (secretVolumesBuilder_ == null) { + ensureSecretVolumesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, secretVolumes_); + onChanged(); + } else { + secretVolumesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume secret_volumes = 19; + */ + public Builder clearSecretVolumes() { + if (secretVolumesBuilder_ == null) { + secretVolumes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + secretVolumesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume secret_volumes = 19; + */ + public Builder removeSecretVolumes(int index) { + if (secretVolumesBuilder_ == null) { + ensureSecretVolumesIsMutable(); + secretVolumes_.remove(index); + onChanged(); + } else { + secretVolumesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume secret_volumes = 19; + */ + public com.google.cloud.functions.v2beta.SecretVolume.Builder getSecretVolumesBuilder( + int index) { + return getSecretVolumesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume secret_volumes = 19; + */ + public com.google.cloud.functions.v2beta.SecretVolumeOrBuilder getSecretVolumesOrBuilder( + int index) { + if (secretVolumesBuilder_ == null) { + return secretVolumes_.get(index); + } else { + return secretVolumesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume secret_volumes = 19; + */ + public java.util.List + getSecretVolumesOrBuilderList() { + if (secretVolumesBuilder_ != null) { + return secretVolumesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(secretVolumes_); + } + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume secret_volumes = 19; + */ + public com.google.cloud.functions.v2beta.SecretVolume.Builder addSecretVolumesBuilder() { + return getSecretVolumesFieldBuilder() + .addBuilder(com.google.cloud.functions.v2beta.SecretVolume.getDefaultInstance()); + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume secret_volumes = 19; + */ + public com.google.cloud.functions.v2beta.SecretVolume.Builder addSecretVolumesBuilder( + int index) { + return getSecretVolumesFieldBuilder() + .addBuilder(index, com.google.cloud.functions.v2beta.SecretVolume.getDefaultInstance()); + } + /** + * + * + *
+     * Secret volumes configuration.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume secret_volumes = 19; + */ + public java.util.List + getSecretVolumesBuilderList() { + return getSecretVolumesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2beta.SecretVolume, + com.google.cloud.functions.v2beta.SecretVolume.Builder, + com.google.cloud.functions.v2beta.SecretVolumeOrBuilder> + getSecretVolumesFieldBuilder() { + if (secretVolumesBuilder_ == null) { + secretVolumesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2beta.SecretVolume, + com.google.cloud.functions.v2beta.SecretVolume.Builder, + com.google.cloud.functions.v2beta.SecretVolumeOrBuilder>( + secretVolumes_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + secretVolumes_ = null; + } + return secretVolumesBuilder_; + } + + private java.lang.Object revision_ = ""; + /** + * + * + *
+     * Output only. The name of service revision.
+     * 
+ * + * string revision = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The revision. + */ + public java.lang.String getRevision() { + java.lang.Object ref = revision_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + revision_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The name of service revision.
+     * 
+ * + * string revision = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for revision. + */ + public com.google.protobuf.ByteString getRevisionBytes() { + java.lang.Object ref = revision_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + revision_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The name of service revision.
+     * 
+ * + * string revision = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The revision to set. + * @return This builder for chaining. + */ + public Builder setRevision(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + revision_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of service revision.
+     * 
+ * + * string revision = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearRevision() { + + revision_ = getDefaultInstance().getRevision(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of service revision.
+     * 
+ * + * string revision = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for revision to set. + * @return This builder for chaining. + */ + public Builder setRevisionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + revision_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2beta.ServiceConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2beta.ServiceConfig) + private static final com.google.cloud.functions.v2beta.ServiceConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2beta.ServiceConfig(); + } + + public static com.google.cloud.functions.v2beta.ServiceConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ServiceConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ServiceConfig(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.ServiceConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/ServiceConfigOrBuilder.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/ServiceConfigOrBuilder.java new file mode 100644 index 00000000..11e65fc9 --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/ServiceConfigOrBuilder.java @@ -0,0 +1,500 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +public interface ServiceConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2beta.ServiceConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Name of the service associated with a Function.
+   * The format of this field is
+   * `projects/{project}/locations/{region}/services/{service}`
+   * 
+ * + * + * string service = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The service. + */ + java.lang.String getService(); + /** + * + * + *
+   * Output only. Name of the service associated with a Function.
+   * The format of this field is
+   * `projects/{project}/locations/{region}/services/{service}`
+   * 
+ * + * + * string service = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for service. + */ + com.google.protobuf.ByteString getServiceBytes(); + + /** + * + * + *
+   * The function execution timeout. Execution is considered failed and
+   * can be terminated if the function is not completed at the end of the
+   * timeout period. Defaults to 60 seconds.
+   * 
+ * + * int32 timeout_seconds = 2; + * + * @return The timeoutSeconds. + */ + int getTimeoutSeconds(); + + /** + * + * + *
+   * The amount of memory available for a function.
+   * Defaults to 256M. Supported units are k, M, G, Mi, Gi. If no unit is
+   * supplied the value is interpreted as bytes.
+   * See
+   * https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go
+   * a full description.
+   * 
+ * + * string available_memory = 13; + * + * @return The availableMemory. + */ + java.lang.String getAvailableMemory(); + /** + * + * + *
+   * The amount of memory available for a function.
+   * Defaults to 256M. Supported units are k, M, G, Mi, Gi. If no unit is
+   * supplied the value is interpreted as bytes.
+   * See
+   * https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go
+   * a full description.
+   * 
+ * + * string available_memory = 13; + * + * @return The bytes for availableMemory. + */ + com.google.protobuf.ByteString getAvailableMemoryBytes(); + + /** + * + * + *
+   * Environment variables that shall be available during function execution.
+   * 
+ * + * map<string, string> environment_variables = 4; + */ + int getEnvironmentVariablesCount(); + /** + * + * + *
+   * Environment variables that shall be available during function execution.
+   * 
+ * + * map<string, string> environment_variables = 4; + */ + boolean containsEnvironmentVariables(java.lang.String key); + /** Use {@link #getEnvironmentVariablesMap()} instead. */ + @java.lang.Deprecated + java.util.Map getEnvironmentVariables(); + /** + * + * + *
+   * Environment variables that shall be available during function execution.
+   * 
+ * + * map<string, string> environment_variables = 4; + */ + java.util.Map getEnvironmentVariablesMap(); + /** + * + * + *
+   * Environment variables that shall be available during function execution.
+   * 
+ * + * map<string, string> environment_variables = 4; + */ + + /* nullable */ + java.lang.String getEnvironmentVariablesOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Environment variables that shall be available during function execution.
+   * 
+ * + * map<string, string> environment_variables = 4; + */ + java.lang.String getEnvironmentVariablesOrThrow(java.lang.String key); + + /** + * + * + *
+   * The limit on the maximum number of function instances that may coexist at a
+   * given time.
+   * In some cases, such as rapid traffic surges, Cloud Functions may, for a
+   * short period of time, create more instances than the specified max
+   * instances limit. If your function cannot tolerate this temporary behavior,
+   * you may want to factor in a safety margin and set a lower max instances
+   * value than your function can tolerate.
+   * See the [Max
+   * Instances](https://cloud.google.com/functions/docs/max-instances) Guide for
+   * more details.
+   * 
+ * + * int32 max_instance_count = 5; + * + * @return The maxInstanceCount. + */ + int getMaxInstanceCount(); + + /** + * + * + *
+   * The limit on the minimum number of function instances that may coexist at a
+   * given time.
+   * Function instances are kept in idle state for a short period after they
+   * finished executing the request to reduce cold start time for subsequent
+   * requests. Setting a minimum instance count will ensure that the given
+   * number of instances are kept running in idle state always. This can help
+   * with cold start times when jump in incoming request count occurs after the
+   * idle instance would have been stopped in the default case.
+   * 
+ * + * int32 min_instance_count = 12; + * + * @return The minInstanceCount. + */ + int getMinInstanceCount(); + + /** + * + * + *
+   * The Serverless VPC Access connector that this cloud function can connect
+   * to. The format of this field is `projects/*/locations/*/connectors/*`.
+   * 
+ * + * string vpc_connector = 6 [(.google.api.resource_reference) = { ... } + * + * @return The vpcConnector. + */ + java.lang.String getVpcConnector(); + /** + * + * + *
+   * The Serverless VPC Access connector that this cloud function can connect
+   * to. The format of this field is `projects/*/locations/*/connectors/*`.
+   * 
+ * + * string vpc_connector = 6 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for vpcConnector. + */ + com.google.protobuf.ByteString getVpcConnectorBytes(); + + /** + * + * + *
+   * The egress settings for the connector, controlling what traffic is diverted
+   * through it.
+   * 
+ * + * + * .google.cloud.functions.v2beta.ServiceConfig.VpcConnectorEgressSettings vpc_connector_egress_settings = 7; + * + * + * @return The enum numeric value on the wire for vpcConnectorEgressSettings. + */ + int getVpcConnectorEgressSettingsValue(); + /** + * + * + *
+   * The egress settings for the connector, controlling what traffic is diverted
+   * through it.
+   * 
+ * + * + * .google.cloud.functions.v2beta.ServiceConfig.VpcConnectorEgressSettings vpc_connector_egress_settings = 7; + * + * + * @return The vpcConnectorEgressSettings. + */ + com.google.cloud.functions.v2beta.ServiceConfig.VpcConnectorEgressSettings + getVpcConnectorEgressSettings(); + + /** + * + * + *
+   * The ingress settings for the function, controlling what traffic can reach
+   * it.
+   * 
+ * + * .google.cloud.functions.v2beta.ServiceConfig.IngressSettings ingress_settings = 8; + * + * @return The enum numeric value on the wire for ingressSettings. + */ + int getIngressSettingsValue(); + /** + * + * + *
+   * The ingress settings for the function, controlling what traffic can reach
+   * it.
+   * 
+ * + * .google.cloud.functions.v2beta.ServiceConfig.IngressSettings ingress_settings = 8; + * + * @return The ingressSettings. + */ + com.google.cloud.functions.v2beta.ServiceConfig.IngressSettings getIngressSettings(); + + /** + * + * + *
+   * Output only. URI of the Service deployed.
+   * 
+ * + * string uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uri. + */ + java.lang.String getUri(); + /** + * + * + *
+   * Output only. URI of the Service deployed.
+   * 
+ * + * string uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uri. + */ + com.google.protobuf.ByteString getUriBytes(); + + /** + * + * + *
+   * The email of the service's service account. If empty, defaults to
+   * `{project_number}-compute@developer.gserviceaccount.com`.
+   * 
+ * + * string service_account_email = 10; + * + * @return The serviceAccountEmail. + */ + java.lang.String getServiceAccountEmail(); + /** + * + * + *
+   * The email of the service's service account. If empty, defaults to
+   * `{project_number}-compute@developer.gserviceaccount.com`.
+   * 
+ * + * string service_account_email = 10; + * + * @return The bytes for serviceAccountEmail. + */ + com.google.protobuf.ByteString getServiceAccountEmailBytes(); + + /** + * + * + *
+   * Whether 100% of traffic is routed to the latest revision.
+   * On CreateFunction and UpdateFunction, when set to true, the revision being
+   * deployed will serve 100% of traffic, ignoring any traffic split settings,
+   * if any. On GetFunction, true will be returned if the latest revision is
+   * serving 100% of traffic.
+   * 
+ * + * bool all_traffic_on_latest_revision = 16; + * + * @return The allTrafficOnLatestRevision. + */ + boolean getAllTrafficOnLatestRevision(); + + /** + * + * + *
+   * Secret environment variables configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.SecretEnvVar secret_environment_variables = 17; + * + */ + java.util.List + getSecretEnvironmentVariablesList(); + /** + * + * + *
+   * Secret environment variables configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.SecretEnvVar secret_environment_variables = 17; + * + */ + com.google.cloud.functions.v2beta.SecretEnvVar getSecretEnvironmentVariables(int index); + /** + * + * + *
+   * Secret environment variables configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.SecretEnvVar secret_environment_variables = 17; + * + */ + int getSecretEnvironmentVariablesCount(); + /** + * + * + *
+   * Secret environment variables configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.SecretEnvVar secret_environment_variables = 17; + * + */ + java.util.List + getSecretEnvironmentVariablesOrBuilderList(); + /** + * + * + *
+   * Secret environment variables configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.SecretEnvVar secret_environment_variables = 17; + * + */ + com.google.cloud.functions.v2beta.SecretEnvVarOrBuilder getSecretEnvironmentVariablesOrBuilder( + int index); + + /** + * + * + *
+   * Secret volumes configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume secret_volumes = 19; + */ + java.util.List getSecretVolumesList(); + /** + * + * + *
+   * Secret volumes configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume secret_volumes = 19; + */ + com.google.cloud.functions.v2beta.SecretVolume getSecretVolumes(int index); + /** + * + * + *
+   * Secret volumes configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume secret_volumes = 19; + */ + int getSecretVolumesCount(); + /** + * + * + *
+   * Secret volumes configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume secret_volumes = 19; + */ + java.util.List + getSecretVolumesOrBuilderList(); + /** + * + * + *
+   * Secret volumes configuration.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.SecretVolume secret_volumes = 19; + */ + com.google.cloud.functions.v2beta.SecretVolumeOrBuilder getSecretVolumesOrBuilder(int index); + + /** + * + * + *
+   * Output only. The name of service revision.
+   * 
+ * + * string revision = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The revision. + */ + java.lang.String getRevision(); + /** + * + * + *
+   * Output only. The name of service revision.
+   * 
+ * + * string revision = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for revision. + */ + com.google.protobuf.ByteString getRevisionBytes(); +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/Source.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/Source.java new file mode 100644 index 00000000..920a9f77 --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/Source.java @@ -0,0 +1,1155 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +/** + * + * + *
+ * The location of the function source code.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.Source} + */ +public final class Source extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2beta.Source) + SourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use Source.newBuilder() to construct. + private Source(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Source() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Source(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Source( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.functions.v2beta.StorageSource.Builder subBuilder = null; + if (sourceCase_ == 1) { + subBuilder = + ((com.google.cloud.functions.v2beta.StorageSource) source_).toBuilder(); + } + source_ = + input.readMessage( + com.google.cloud.functions.v2beta.StorageSource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.functions.v2beta.StorageSource) source_); + source_ = subBuilder.buildPartial(); + } + sourceCase_ = 1; + break; + } + case 18: + { + com.google.cloud.functions.v2beta.RepoSource.Builder subBuilder = null; + if (sourceCase_ == 2) { + subBuilder = ((com.google.cloud.functions.v2beta.RepoSource) source_).toBuilder(); + } + source_ = + input.readMessage( + com.google.cloud.functions.v2beta.RepoSource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.functions.v2beta.RepoSource) source_); + source_ = subBuilder.buildPartial(); + } + sourceCase_ = 2; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_Source_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_Source_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.Source.class, + com.google.cloud.functions.v2beta.Source.Builder.class); + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public enum SourceCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + STORAGE_SOURCE(1), + REPO_SOURCE(2), + SOURCE_NOT_SET(0); + private final int value; + + private SourceCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SourceCase valueOf(int value) { + return forNumber(value); + } + + public static SourceCase forNumber(int value) { + switch (value) { + case 1: + return STORAGE_SOURCE; + case 2: + return REPO_SOURCE; + case 0: + return SOURCE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public static final int STORAGE_SOURCE_FIELD_NUMBER = 1; + /** + * + * + *
+   * If provided, get the source from this location in Google Cloud Storage.
+   * 
+ * + * .google.cloud.functions.v2beta.StorageSource storage_source = 1; + * + * @return Whether the storageSource field is set. + */ + @java.lang.Override + public boolean hasStorageSource() { + return sourceCase_ == 1; + } + /** + * + * + *
+   * If provided, get the source from this location in Google Cloud Storage.
+   * 
+ * + * .google.cloud.functions.v2beta.StorageSource storage_source = 1; + * + * @return The storageSource. + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.StorageSource getStorageSource() { + if (sourceCase_ == 1) { + return (com.google.cloud.functions.v2beta.StorageSource) source_; + } + return com.google.cloud.functions.v2beta.StorageSource.getDefaultInstance(); + } + /** + * + * + *
+   * If provided, get the source from this location in Google Cloud Storage.
+   * 
+ * + * .google.cloud.functions.v2beta.StorageSource storage_source = 1; + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.StorageSourceOrBuilder getStorageSourceOrBuilder() { + if (sourceCase_ == 1) { + return (com.google.cloud.functions.v2beta.StorageSource) source_; + } + return com.google.cloud.functions.v2beta.StorageSource.getDefaultInstance(); + } + + public static final int REPO_SOURCE_FIELD_NUMBER = 2; + /** + * + * + *
+   * If provided, get the source from this location in a Cloud Source
+   * Repository.
+   * 
+ * + * .google.cloud.functions.v2beta.RepoSource repo_source = 2; + * + * @return Whether the repoSource field is set. + */ + @java.lang.Override + public boolean hasRepoSource() { + return sourceCase_ == 2; + } + /** + * + * + *
+   * If provided, get the source from this location in a Cloud Source
+   * Repository.
+   * 
+ * + * .google.cloud.functions.v2beta.RepoSource repo_source = 2; + * + * @return The repoSource. + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.RepoSource getRepoSource() { + if (sourceCase_ == 2) { + return (com.google.cloud.functions.v2beta.RepoSource) source_; + } + return com.google.cloud.functions.v2beta.RepoSource.getDefaultInstance(); + } + /** + * + * + *
+   * If provided, get the source from this location in a Cloud Source
+   * Repository.
+   * 
+ * + * .google.cloud.functions.v2beta.RepoSource repo_source = 2; + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.RepoSourceOrBuilder getRepoSourceOrBuilder() { + if (sourceCase_ == 2) { + return (com.google.cloud.functions.v2beta.RepoSource) source_; + } + return com.google.cloud.functions.v2beta.RepoSource.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (sourceCase_ == 1) { + output.writeMessage(1, (com.google.cloud.functions.v2beta.StorageSource) source_); + } + if (sourceCase_ == 2) { + output.writeMessage(2, (com.google.cloud.functions.v2beta.RepoSource) source_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (sourceCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.cloud.functions.v2beta.StorageSource) source_); + } + if (sourceCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.functions.v2beta.RepoSource) source_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2beta.Source)) { + return super.equals(obj); + } + com.google.cloud.functions.v2beta.Source other = (com.google.cloud.functions.v2beta.Source) obj; + + if (!getSourceCase().equals(other.getSourceCase())) return false; + switch (sourceCase_) { + case 1: + if (!getStorageSource().equals(other.getStorageSource())) return false; + break; + case 2: + if (!getRepoSource().equals(other.getRepoSource())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (sourceCase_) { + case 1: + hash = (37 * hash) + STORAGE_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getStorageSource().hashCode(); + break; + case 2: + hash = (37 * hash) + REPO_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getRepoSource().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2beta.Source parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.Source parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.Source parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.Source parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.Source parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.Source parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.Source parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.Source parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.Source parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.Source parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.Source parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.Source parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v2beta.Source prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The location of the function source code.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.Source} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2beta.Source) + com.google.cloud.functions.v2beta.SourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_Source_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_Source_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.Source.class, + com.google.cloud.functions.v2beta.Source.Builder.class); + } + + // Construct using com.google.cloud.functions.v2beta.Source.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + sourceCase_ = 0; + source_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_Source_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.Source getDefaultInstanceForType() { + return com.google.cloud.functions.v2beta.Source.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.Source build() { + com.google.cloud.functions.v2beta.Source result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.Source buildPartial() { + com.google.cloud.functions.v2beta.Source result = + new com.google.cloud.functions.v2beta.Source(this); + if (sourceCase_ == 1) { + if (storageSourceBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = storageSourceBuilder_.build(); + } + } + if (sourceCase_ == 2) { + if (repoSourceBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = repoSourceBuilder_.build(); + } + } + result.sourceCase_ = sourceCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2beta.Source) { + return mergeFrom((com.google.cloud.functions.v2beta.Source) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2beta.Source other) { + if (other == com.google.cloud.functions.v2beta.Source.getDefaultInstance()) return this; + switch (other.getSourceCase()) { + case STORAGE_SOURCE: + { + mergeStorageSource(other.getStorageSource()); + break; + } + case REPO_SOURCE: + { + mergeRepoSource(other.getRepoSource()); + break; + } + case SOURCE_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2beta.Source parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v2beta.Source) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + + public SourceCase getSourceCase() { + return SourceCase.forNumber(sourceCase_); + } + + public Builder clearSource() { + sourceCase_ = 0; + source_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2beta.StorageSource, + com.google.cloud.functions.v2beta.StorageSource.Builder, + com.google.cloud.functions.v2beta.StorageSourceOrBuilder> + storageSourceBuilder_; + /** + * + * + *
+     * If provided, get the source from this location in Google Cloud Storage.
+     * 
+ * + * .google.cloud.functions.v2beta.StorageSource storage_source = 1; + * + * @return Whether the storageSource field is set. + */ + @java.lang.Override + public boolean hasStorageSource() { + return sourceCase_ == 1; + } + /** + * + * + *
+     * If provided, get the source from this location in Google Cloud Storage.
+     * 
+ * + * .google.cloud.functions.v2beta.StorageSource storage_source = 1; + * + * @return The storageSource. + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.StorageSource getStorageSource() { + if (storageSourceBuilder_ == null) { + if (sourceCase_ == 1) { + return (com.google.cloud.functions.v2beta.StorageSource) source_; + } + return com.google.cloud.functions.v2beta.StorageSource.getDefaultInstance(); + } else { + if (sourceCase_ == 1) { + return storageSourceBuilder_.getMessage(); + } + return com.google.cloud.functions.v2beta.StorageSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * If provided, get the source from this location in Google Cloud Storage.
+     * 
+ * + * .google.cloud.functions.v2beta.StorageSource storage_source = 1; + */ + public Builder setStorageSource(com.google.cloud.functions.v2beta.StorageSource value) { + if (storageSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + storageSourceBuilder_.setMessage(value); + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * If provided, get the source from this location in Google Cloud Storage.
+     * 
+ * + * .google.cloud.functions.v2beta.StorageSource storage_source = 1; + */ + public Builder setStorageSource( + com.google.cloud.functions.v2beta.StorageSource.Builder builderForValue) { + if (storageSourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + storageSourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * If provided, get the source from this location in Google Cloud Storage.
+     * 
+ * + * .google.cloud.functions.v2beta.StorageSource storage_source = 1; + */ + public Builder mergeStorageSource(com.google.cloud.functions.v2beta.StorageSource value) { + if (storageSourceBuilder_ == null) { + if (sourceCase_ == 1 + && source_ != com.google.cloud.functions.v2beta.StorageSource.getDefaultInstance()) { + source_ = + com.google.cloud.functions.v2beta.StorageSource.newBuilder( + (com.google.cloud.functions.v2beta.StorageSource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 1) { + storageSourceBuilder_.mergeFrom(value); + } else { + storageSourceBuilder_.setMessage(value); + } + } + sourceCase_ = 1; + return this; + } + /** + * + * + *
+     * If provided, get the source from this location in Google Cloud Storage.
+     * 
+ * + * .google.cloud.functions.v2beta.StorageSource storage_source = 1; + */ + public Builder clearStorageSource() { + if (storageSourceBuilder_ == null) { + if (sourceCase_ == 1) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 1) { + sourceCase_ = 0; + source_ = null; + } + storageSourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * If provided, get the source from this location in Google Cloud Storage.
+     * 
+ * + * .google.cloud.functions.v2beta.StorageSource storage_source = 1; + */ + public com.google.cloud.functions.v2beta.StorageSource.Builder getStorageSourceBuilder() { + return getStorageSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * If provided, get the source from this location in Google Cloud Storage.
+     * 
+ * + * .google.cloud.functions.v2beta.StorageSource storage_source = 1; + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.StorageSourceOrBuilder getStorageSourceOrBuilder() { + if ((sourceCase_ == 1) && (storageSourceBuilder_ != null)) { + return storageSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 1) { + return (com.google.cloud.functions.v2beta.StorageSource) source_; + } + return com.google.cloud.functions.v2beta.StorageSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * If provided, get the source from this location in Google Cloud Storage.
+     * 
+ * + * .google.cloud.functions.v2beta.StorageSource storage_source = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2beta.StorageSource, + com.google.cloud.functions.v2beta.StorageSource.Builder, + com.google.cloud.functions.v2beta.StorageSourceOrBuilder> + getStorageSourceFieldBuilder() { + if (storageSourceBuilder_ == null) { + if (!(sourceCase_ == 1)) { + source_ = com.google.cloud.functions.v2beta.StorageSource.getDefaultInstance(); + } + storageSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2beta.StorageSource, + com.google.cloud.functions.v2beta.StorageSource.Builder, + com.google.cloud.functions.v2beta.StorageSourceOrBuilder>( + (com.google.cloud.functions.v2beta.StorageSource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 1; + onChanged(); + ; + return storageSourceBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2beta.RepoSource, + com.google.cloud.functions.v2beta.RepoSource.Builder, + com.google.cloud.functions.v2beta.RepoSourceOrBuilder> + repoSourceBuilder_; + /** + * + * + *
+     * If provided, get the source from this location in a Cloud Source
+     * Repository.
+     * 
+ * + * .google.cloud.functions.v2beta.RepoSource repo_source = 2; + * + * @return Whether the repoSource field is set. + */ + @java.lang.Override + public boolean hasRepoSource() { + return sourceCase_ == 2; + } + /** + * + * + *
+     * If provided, get the source from this location in a Cloud Source
+     * Repository.
+     * 
+ * + * .google.cloud.functions.v2beta.RepoSource repo_source = 2; + * + * @return The repoSource. + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.RepoSource getRepoSource() { + if (repoSourceBuilder_ == null) { + if (sourceCase_ == 2) { + return (com.google.cloud.functions.v2beta.RepoSource) source_; + } + return com.google.cloud.functions.v2beta.RepoSource.getDefaultInstance(); + } else { + if (sourceCase_ == 2) { + return repoSourceBuilder_.getMessage(); + } + return com.google.cloud.functions.v2beta.RepoSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * If provided, get the source from this location in a Cloud Source
+     * Repository.
+     * 
+ * + * .google.cloud.functions.v2beta.RepoSource repo_source = 2; + */ + public Builder setRepoSource(com.google.cloud.functions.v2beta.RepoSource value) { + if (repoSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + repoSourceBuilder_.setMessage(value); + } + sourceCase_ = 2; + return this; + } + /** + * + * + *
+     * If provided, get the source from this location in a Cloud Source
+     * Repository.
+     * 
+ * + * .google.cloud.functions.v2beta.RepoSource repo_source = 2; + */ + public Builder setRepoSource( + com.google.cloud.functions.v2beta.RepoSource.Builder builderForValue) { + if (repoSourceBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + repoSourceBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 2; + return this; + } + /** + * + * + *
+     * If provided, get the source from this location in a Cloud Source
+     * Repository.
+     * 
+ * + * .google.cloud.functions.v2beta.RepoSource repo_source = 2; + */ + public Builder mergeRepoSource(com.google.cloud.functions.v2beta.RepoSource value) { + if (repoSourceBuilder_ == null) { + if (sourceCase_ == 2 + && source_ != com.google.cloud.functions.v2beta.RepoSource.getDefaultInstance()) { + source_ = + com.google.cloud.functions.v2beta.RepoSource.newBuilder( + (com.google.cloud.functions.v2beta.RepoSource) source_) + .mergeFrom(value) + .buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 2) { + repoSourceBuilder_.mergeFrom(value); + } else { + repoSourceBuilder_.setMessage(value); + } + } + sourceCase_ = 2; + return this; + } + /** + * + * + *
+     * If provided, get the source from this location in a Cloud Source
+     * Repository.
+     * 
+ * + * .google.cloud.functions.v2beta.RepoSource repo_source = 2; + */ + public Builder clearRepoSource() { + if (repoSourceBuilder_ == null) { + if (sourceCase_ == 2) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 2) { + sourceCase_ = 0; + source_ = null; + } + repoSourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * If provided, get the source from this location in a Cloud Source
+     * Repository.
+     * 
+ * + * .google.cloud.functions.v2beta.RepoSource repo_source = 2; + */ + public com.google.cloud.functions.v2beta.RepoSource.Builder getRepoSourceBuilder() { + return getRepoSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * If provided, get the source from this location in a Cloud Source
+     * Repository.
+     * 
+ * + * .google.cloud.functions.v2beta.RepoSource repo_source = 2; + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.RepoSourceOrBuilder getRepoSourceOrBuilder() { + if ((sourceCase_ == 2) && (repoSourceBuilder_ != null)) { + return repoSourceBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 2) { + return (com.google.cloud.functions.v2beta.RepoSource) source_; + } + return com.google.cloud.functions.v2beta.RepoSource.getDefaultInstance(); + } + } + /** + * + * + *
+     * If provided, get the source from this location in a Cloud Source
+     * Repository.
+     * 
+ * + * .google.cloud.functions.v2beta.RepoSource repo_source = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2beta.RepoSource, + com.google.cloud.functions.v2beta.RepoSource.Builder, + com.google.cloud.functions.v2beta.RepoSourceOrBuilder> + getRepoSourceFieldBuilder() { + if (repoSourceBuilder_ == null) { + if (!(sourceCase_ == 2)) { + source_ = com.google.cloud.functions.v2beta.RepoSource.getDefaultInstance(); + } + repoSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2beta.RepoSource, + com.google.cloud.functions.v2beta.RepoSource.Builder, + com.google.cloud.functions.v2beta.RepoSourceOrBuilder>( + (com.google.cloud.functions.v2beta.RepoSource) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 2; + onChanged(); + ; + return repoSourceBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2beta.Source) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2beta.Source) + private static final com.google.cloud.functions.v2beta.Source DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2beta.Source(); + } + + public static com.google.cloud.functions.v2beta.Source getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Source parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Source(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.Source getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/SourceOrBuilder.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/SourceOrBuilder.java new file mode 100644 index 00000000..bf023325 --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/SourceOrBuilder.java @@ -0,0 +1,100 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +public interface SourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2beta.Source) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * If provided, get the source from this location in Google Cloud Storage.
+   * 
+ * + * .google.cloud.functions.v2beta.StorageSource storage_source = 1; + * + * @return Whether the storageSource field is set. + */ + boolean hasStorageSource(); + /** + * + * + *
+   * If provided, get the source from this location in Google Cloud Storage.
+   * 
+ * + * .google.cloud.functions.v2beta.StorageSource storage_source = 1; + * + * @return The storageSource. + */ + com.google.cloud.functions.v2beta.StorageSource getStorageSource(); + /** + * + * + *
+   * If provided, get the source from this location in Google Cloud Storage.
+   * 
+ * + * .google.cloud.functions.v2beta.StorageSource storage_source = 1; + */ + com.google.cloud.functions.v2beta.StorageSourceOrBuilder getStorageSourceOrBuilder(); + + /** + * + * + *
+   * If provided, get the source from this location in a Cloud Source
+   * Repository.
+   * 
+ * + * .google.cloud.functions.v2beta.RepoSource repo_source = 2; + * + * @return Whether the repoSource field is set. + */ + boolean hasRepoSource(); + /** + * + * + *
+   * If provided, get the source from this location in a Cloud Source
+   * Repository.
+   * 
+ * + * .google.cloud.functions.v2beta.RepoSource repo_source = 2; + * + * @return The repoSource. + */ + com.google.cloud.functions.v2beta.RepoSource getRepoSource(); + /** + * + * + *
+   * If provided, get the source from this location in a Cloud Source
+   * Repository.
+   * 
+ * + * .google.cloud.functions.v2beta.RepoSource repo_source = 2; + */ + com.google.cloud.functions.v2beta.RepoSourceOrBuilder getRepoSourceOrBuilder(); + + public com.google.cloud.functions.v2beta.Source.SourceCase getSourceCase(); +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/SourceProvenance.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/SourceProvenance.java new file mode 100644 index 00000000..03846b0b --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/SourceProvenance.java @@ -0,0 +1,1045 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +/** + * + * + *
+ * Provenance of the source. Ways to find the original source, or verify that
+ * some source was used for this build.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.SourceProvenance} + */ +public final class SourceProvenance extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2beta.SourceProvenance) + SourceProvenanceOrBuilder { + private static final long serialVersionUID = 0L; + // Use SourceProvenance.newBuilder() to construct. + private SourceProvenance(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SourceProvenance() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SourceProvenance(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SourceProvenance( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.functions.v2beta.StorageSource.Builder subBuilder = null; + if (resolvedStorageSource_ != null) { + subBuilder = resolvedStorageSource_.toBuilder(); + } + resolvedStorageSource_ = + input.readMessage( + com.google.cloud.functions.v2beta.StorageSource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(resolvedStorageSource_); + resolvedStorageSource_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.cloud.functions.v2beta.RepoSource.Builder subBuilder = null; + if (resolvedRepoSource_ != null) { + subBuilder = resolvedRepoSource_.toBuilder(); + } + resolvedRepoSource_ = + input.readMessage( + com.google.cloud.functions.v2beta.RepoSource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(resolvedRepoSource_); + resolvedRepoSource_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_SourceProvenance_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_SourceProvenance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.SourceProvenance.class, + com.google.cloud.functions.v2beta.SourceProvenance.Builder.class); + } + + public static final int RESOLVED_STORAGE_SOURCE_FIELD_NUMBER = 1; + private com.google.cloud.functions.v2beta.StorageSource resolvedStorageSource_; + /** + * + * + *
+   * A copy of the build's `source.storage_source`, if exists, with any
+   * generations resolved.
+   * 
+ * + * .google.cloud.functions.v2beta.StorageSource resolved_storage_source = 1; + * + * @return Whether the resolvedStorageSource field is set. + */ + @java.lang.Override + public boolean hasResolvedStorageSource() { + return resolvedStorageSource_ != null; + } + /** + * + * + *
+   * A copy of the build's `source.storage_source`, if exists, with any
+   * generations resolved.
+   * 
+ * + * .google.cloud.functions.v2beta.StorageSource resolved_storage_source = 1; + * + * @return The resolvedStorageSource. + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.StorageSource getResolvedStorageSource() { + return resolvedStorageSource_ == null + ? com.google.cloud.functions.v2beta.StorageSource.getDefaultInstance() + : resolvedStorageSource_; + } + /** + * + * + *
+   * A copy of the build's `source.storage_source`, if exists, with any
+   * generations resolved.
+   * 
+ * + * .google.cloud.functions.v2beta.StorageSource resolved_storage_source = 1; + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.StorageSourceOrBuilder + getResolvedStorageSourceOrBuilder() { + return getResolvedStorageSource(); + } + + public static final int RESOLVED_REPO_SOURCE_FIELD_NUMBER = 2; + private com.google.cloud.functions.v2beta.RepoSource resolvedRepoSource_; + /** + * + * + *
+   * A copy of the build's `source.repo_source`, if exists, with any
+   * revisions resolved.
+   * 
+ * + * .google.cloud.functions.v2beta.RepoSource resolved_repo_source = 2; + * + * @return Whether the resolvedRepoSource field is set. + */ + @java.lang.Override + public boolean hasResolvedRepoSource() { + return resolvedRepoSource_ != null; + } + /** + * + * + *
+   * A copy of the build's `source.repo_source`, if exists, with any
+   * revisions resolved.
+   * 
+ * + * .google.cloud.functions.v2beta.RepoSource resolved_repo_source = 2; + * + * @return The resolvedRepoSource. + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.RepoSource getResolvedRepoSource() { + return resolvedRepoSource_ == null + ? com.google.cloud.functions.v2beta.RepoSource.getDefaultInstance() + : resolvedRepoSource_; + } + /** + * + * + *
+   * A copy of the build's `source.repo_source`, if exists, with any
+   * revisions resolved.
+   * 
+ * + * .google.cloud.functions.v2beta.RepoSource resolved_repo_source = 2; + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.RepoSourceOrBuilder getResolvedRepoSourceOrBuilder() { + return getResolvedRepoSource(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (resolvedStorageSource_ != null) { + output.writeMessage(1, getResolvedStorageSource()); + } + if (resolvedRepoSource_ != null) { + output.writeMessage(2, getResolvedRepoSource()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (resolvedStorageSource_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, getResolvedStorageSource()); + } + if (resolvedRepoSource_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getResolvedRepoSource()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2beta.SourceProvenance)) { + return super.equals(obj); + } + com.google.cloud.functions.v2beta.SourceProvenance other = + (com.google.cloud.functions.v2beta.SourceProvenance) obj; + + if (hasResolvedStorageSource() != other.hasResolvedStorageSource()) return false; + if (hasResolvedStorageSource()) { + if (!getResolvedStorageSource().equals(other.getResolvedStorageSource())) return false; + } + if (hasResolvedRepoSource() != other.hasResolvedRepoSource()) return false; + if (hasResolvedRepoSource()) { + if (!getResolvedRepoSource().equals(other.getResolvedRepoSource())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasResolvedStorageSource()) { + hash = (37 * hash) + RESOLVED_STORAGE_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getResolvedStorageSource().hashCode(); + } + if (hasResolvedRepoSource()) { + hash = (37 * hash) + RESOLVED_REPO_SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getResolvedRepoSource().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2beta.SourceProvenance parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.SourceProvenance parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.SourceProvenance parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.SourceProvenance parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.SourceProvenance parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.SourceProvenance parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.SourceProvenance parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.SourceProvenance parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.SourceProvenance parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.SourceProvenance parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.SourceProvenance parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.SourceProvenance parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v2beta.SourceProvenance prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Provenance of the source. Ways to find the original source, or verify that
+   * some source was used for this build.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.SourceProvenance} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2beta.SourceProvenance) + com.google.cloud.functions.v2beta.SourceProvenanceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_SourceProvenance_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_SourceProvenance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.SourceProvenance.class, + com.google.cloud.functions.v2beta.SourceProvenance.Builder.class); + } + + // Construct using com.google.cloud.functions.v2beta.SourceProvenance.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (resolvedStorageSourceBuilder_ == null) { + resolvedStorageSource_ = null; + } else { + resolvedStorageSource_ = null; + resolvedStorageSourceBuilder_ = null; + } + if (resolvedRepoSourceBuilder_ == null) { + resolvedRepoSource_ = null; + } else { + resolvedRepoSource_ = null; + resolvedRepoSourceBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_SourceProvenance_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.SourceProvenance getDefaultInstanceForType() { + return com.google.cloud.functions.v2beta.SourceProvenance.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.SourceProvenance build() { + com.google.cloud.functions.v2beta.SourceProvenance result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.SourceProvenance buildPartial() { + com.google.cloud.functions.v2beta.SourceProvenance result = + new com.google.cloud.functions.v2beta.SourceProvenance(this); + if (resolvedStorageSourceBuilder_ == null) { + result.resolvedStorageSource_ = resolvedStorageSource_; + } else { + result.resolvedStorageSource_ = resolvedStorageSourceBuilder_.build(); + } + if (resolvedRepoSourceBuilder_ == null) { + result.resolvedRepoSource_ = resolvedRepoSource_; + } else { + result.resolvedRepoSource_ = resolvedRepoSourceBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2beta.SourceProvenance) { + return mergeFrom((com.google.cloud.functions.v2beta.SourceProvenance) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2beta.SourceProvenance other) { + if (other == com.google.cloud.functions.v2beta.SourceProvenance.getDefaultInstance()) + return this; + if (other.hasResolvedStorageSource()) { + mergeResolvedStorageSource(other.getResolvedStorageSource()); + } + if (other.hasResolvedRepoSource()) { + mergeResolvedRepoSource(other.getResolvedRepoSource()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2beta.SourceProvenance parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2beta.SourceProvenance) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.functions.v2beta.StorageSource resolvedStorageSource_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2beta.StorageSource, + com.google.cloud.functions.v2beta.StorageSource.Builder, + com.google.cloud.functions.v2beta.StorageSourceOrBuilder> + resolvedStorageSourceBuilder_; + /** + * + * + *
+     * A copy of the build's `source.storage_source`, if exists, with any
+     * generations resolved.
+     * 
+ * + * .google.cloud.functions.v2beta.StorageSource resolved_storage_source = 1; + * + * @return Whether the resolvedStorageSource field is set. + */ + public boolean hasResolvedStorageSource() { + return resolvedStorageSourceBuilder_ != null || resolvedStorageSource_ != null; + } + /** + * + * + *
+     * A copy of the build's `source.storage_source`, if exists, with any
+     * generations resolved.
+     * 
+ * + * .google.cloud.functions.v2beta.StorageSource resolved_storage_source = 1; + * + * @return The resolvedStorageSource. + */ + public com.google.cloud.functions.v2beta.StorageSource getResolvedStorageSource() { + if (resolvedStorageSourceBuilder_ == null) { + return resolvedStorageSource_ == null + ? com.google.cloud.functions.v2beta.StorageSource.getDefaultInstance() + : resolvedStorageSource_; + } else { + return resolvedStorageSourceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * A copy of the build's `source.storage_source`, if exists, with any
+     * generations resolved.
+     * 
+ * + * .google.cloud.functions.v2beta.StorageSource resolved_storage_source = 1; + */ + public Builder setResolvedStorageSource(com.google.cloud.functions.v2beta.StorageSource value) { + if (resolvedStorageSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resolvedStorageSource_ = value; + onChanged(); + } else { + resolvedStorageSourceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * A copy of the build's `source.storage_source`, if exists, with any
+     * generations resolved.
+     * 
+ * + * .google.cloud.functions.v2beta.StorageSource resolved_storage_source = 1; + */ + public Builder setResolvedStorageSource( + com.google.cloud.functions.v2beta.StorageSource.Builder builderForValue) { + if (resolvedStorageSourceBuilder_ == null) { + resolvedStorageSource_ = builderForValue.build(); + onChanged(); + } else { + resolvedStorageSourceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * A copy of the build's `source.storage_source`, if exists, with any
+     * generations resolved.
+     * 
+ * + * .google.cloud.functions.v2beta.StorageSource resolved_storage_source = 1; + */ + public Builder mergeResolvedStorageSource( + com.google.cloud.functions.v2beta.StorageSource value) { + if (resolvedStorageSourceBuilder_ == null) { + if (resolvedStorageSource_ != null) { + resolvedStorageSource_ = + com.google.cloud.functions.v2beta.StorageSource.newBuilder(resolvedStorageSource_) + .mergeFrom(value) + .buildPartial(); + } else { + resolvedStorageSource_ = value; + } + onChanged(); + } else { + resolvedStorageSourceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * A copy of the build's `source.storage_source`, if exists, with any
+     * generations resolved.
+     * 
+ * + * .google.cloud.functions.v2beta.StorageSource resolved_storage_source = 1; + */ + public Builder clearResolvedStorageSource() { + if (resolvedStorageSourceBuilder_ == null) { + resolvedStorageSource_ = null; + onChanged(); + } else { + resolvedStorageSource_ = null; + resolvedStorageSourceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * A copy of the build's `source.storage_source`, if exists, with any
+     * generations resolved.
+     * 
+ * + * .google.cloud.functions.v2beta.StorageSource resolved_storage_source = 1; + */ + public com.google.cloud.functions.v2beta.StorageSource.Builder + getResolvedStorageSourceBuilder() { + + onChanged(); + return getResolvedStorageSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A copy of the build's `source.storage_source`, if exists, with any
+     * generations resolved.
+     * 
+ * + * .google.cloud.functions.v2beta.StorageSource resolved_storage_source = 1; + */ + public com.google.cloud.functions.v2beta.StorageSourceOrBuilder + getResolvedStorageSourceOrBuilder() { + if (resolvedStorageSourceBuilder_ != null) { + return resolvedStorageSourceBuilder_.getMessageOrBuilder(); + } else { + return resolvedStorageSource_ == null + ? com.google.cloud.functions.v2beta.StorageSource.getDefaultInstance() + : resolvedStorageSource_; + } + } + /** + * + * + *
+     * A copy of the build's `source.storage_source`, if exists, with any
+     * generations resolved.
+     * 
+ * + * .google.cloud.functions.v2beta.StorageSource resolved_storage_source = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2beta.StorageSource, + com.google.cloud.functions.v2beta.StorageSource.Builder, + com.google.cloud.functions.v2beta.StorageSourceOrBuilder> + getResolvedStorageSourceFieldBuilder() { + if (resolvedStorageSourceBuilder_ == null) { + resolvedStorageSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2beta.StorageSource, + com.google.cloud.functions.v2beta.StorageSource.Builder, + com.google.cloud.functions.v2beta.StorageSourceOrBuilder>( + getResolvedStorageSource(), getParentForChildren(), isClean()); + resolvedStorageSource_ = null; + } + return resolvedStorageSourceBuilder_; + } + + private com.google.cloud.functions.v2beta.RepoSource resolvedRepoSource_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2beta.RepoSource, + com.google.cloud.functions.v2beta.RepoSource.Builder, + com.google.cloud.functions.v2beta.RepoSourceOrBuilder> + resolvedRepoSourceBuilder_; + /** + * + * + *
+     * A copy of the build's `source.repo_source`, if exists, with any
+     * revisions resolved.
+     * 
+ * + * .google.cloud.functions.v2beta.RepoSource resolved_repo_source = 2; + * + * @return Whether the resolvedRepoSource field is set. + */ + public boolean hasResolvedRepoSource() { + return resolvedRepoSourceBuilder_ != null || resolvedRepoSource_ != null; + } + /** + * + * + *
+     * A copy of the build's `source.repo_source`, if exists, with any
+     * revisions resolved.
+     * 
+ * + * .google.cloud.functions.v2beta.RepoSource resolved_repo_source = 2; + * + * @return The resolvedRepoSource. + */ + public com.google.cloud.functions.v2beta.RepoSource getResolvedRepoSource() { + if (resolvedRepoSourceBuilder_ == null) { + return resolvedRepoSource_ == null + ? com.google.cloud.functions.v2beta.RepoSource.getDefaultInstance() + : resolvedRepoSource_; + } else { + return resolvedRepoSourceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * A copy of the build's `source.repo_source`, if exists, with any
+     * revisions resolved.
+     * 
+ * + * .google.cloud.functions.v2beta.RepoSource resolved_repo_source = 2; + */ + public Builder setResolvedRepoSource(com.google.cloud.functions.v2beta.RepoSource value) { + if (resolvedRepoSourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resolvedRepoSource_ = value; + onChanged(); + } else { + resolvedRepoSourceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * A copy of the build's `source.repo_source`, if exists, with any
+     * revisions resolved.
+     * 
+ * + * .google.cloud.functions.v2beta.RepoSource resolved_repo_source = 2; + */ + public Builder setResolvedRepoSource( + com.google.cloud.functions.v2beta.RepoSource.Builder builderForValue) { + if (resolvedRepoSourceBuilder_ == null) { + resolvedRepoSource_ = builderForValue.build(); + onChanged(); + } else { + resolvedRepoSourceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * A copy of the build's `source.repo_source`, if exists, with any
+     * revisions resolved.
+     * 
+ * + * .google.cloud.functions.v2beta.RepoSource resolved_repo_source = 2; + */ + public Builder mergeResolvedRepoSource(com.google.cloud.functions.v2beta.RepoSource value) { + if (resolvedRepoSourceBuilder_ == null) { + if (resolvedRepoSource_ != null) { + resolvedRepoSource_ = + com.google.cloud.functions.v2beta.RepoSource.newBuilder(resolvedRepoSource_) + .mergeFrom(value) + .buildPartial(); + } else { + resolvedRepoSource_ = value; + } + onChanged(); + } else { + resolvedRepoSourceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * A copy of the build's `source.repo_source`, if exists, with any
+     * revisions resolved.
+     * 
+ * + * .google.cloud.functions.v2beta.RepoSource resolved_repo_source = 2; + */ + public Builder clearResolvedRepoSource() { + if (resolvedRepoSourceBuilder_ == null) { + resolvedRepoSource_ = null; + onChanged(); + } else { + resolvedRepoSource_ = null; + resolvedRepoSourceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * A copy of the build's `source.repo_source`, if exists, with any
+     * revisions resolved.
+     * 
+ * + * .google.cloud.functions.v2beta.RepoSource resolved_repo_source = 2; + */ + public com.google.cloud.functions.v2beta.RepoSource.Builder getResolvedRepoSourceBuilder() { + + onChanged(); + return getResolvedRepoSourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A copy of the build's `source.repo_source`, if exists, with any
+     * revisions resolved.
+     * 
+ * + * .google.cloud.functions.v2beta.RepoSource resolved_repo_source = 2; + */ + public com.google.cloud.functions.v2beta.RepoSourceOrBuilder getResolvedRepoSourceOrBuilder() { + if (resolvedRepoSourceBuilder_ != null) { + return resolvedRepoSourceBuilder_.getMessageOrBuilder(); + } else { + return resolvedRepoSource_ == null + ? com.google.cloud.functions.v2beta.RepoSource.getDefaultInstance() + : resolvedRepoSource_; + } + } + /** + * + * + *
+     * A copy of the build's `source.repo_source`, if exists, with any
+     * revisions resolved.
+     * 
+ * + * .google.cloud.functions.v2beta.RepoSource resolved_repo_source = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2beta.RepoSource, + com.google.cloud.functions.v2beta.RepoSource.Builder, + com.google.cloud.functions.v2beta.RepoSourceOrBuilder> + getResolvedRepoSourceFieldBuilder() { + if (resolvedRepoSourceBuilder_ == null) { + resolvedRepoSourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2beta.RepoSource, + com.google.cloud.functions.v2beta.RepoSource.Builder, + com.google.cloud.functions.v2beta.RepoSourceOrBuilder>( + getResolvedRepoSource(), getParentForChildren(), isClean()); + resolvedRepoSource_ = null; + } + return resolvedRepoSourceBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2beta.SourceProvenance) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2beta.SourceProvenance) + private static final com.google.cloud.functions.v2beta.SourceProvenance DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2beta.SourceProvenance(); + } + + public static com.google.cloud.functions.v2beta.SourceProvenance getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SourceProvenance parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SourceProvenance(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.SourceProvenance getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/SourceProvenanceOrBuilder.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/SourceProvenanceOrBuilder.java new file mode 100644 index 00000000..6be823a6 --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/SourceProvenanceOrBuilder.java @@ -0,0 +1,101 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +public interface SourceProvenanceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2beta.SourceProvenance) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A copy of the build's `source.storage_source`, if exists, with any
+   * generations resolved.
+   * 
+ * + * .google.cloud.functions.v2beta.StorageSource resolved_storage_source = 1; + * + * @return Whether the resolvedStorageSource field is set. + */ + boolean hasResolvedStorageSource(); + /** + * + * + *
+   * A copy of the build's `source.storage_source`, if exists, with any
+   * generations resolved.
+   * 
+ * + * .google.cloud.functions.v2beta.StorageSource resolved_storage_source = 1; + * + * @return The resolvedStorageSource. + */ + com.google.cloud.functions.v2beta.StorageSource getResolvedStorageSource(); + /** + * + * + *
+   * A copy of the build's `source.storage_source`, if exists, with any
+   * generations resolved.
+   * 
+ * + * .google.cloud.functions.v2beta.StorageSource resolved_storage_source = 1; + */ + com.google.cloud.functions.v2beta.StorageSourceOrBuilder getResolvedStorageSourceOrBuilder(); + + /** + * + * + *
+   * A copy of the build's `source.repo_source`, if exists, with any
+   * revisions resolved.
+   * 
+ * + * .google.cloud.functions.v2beta.RepoSource resolved_repo_source = 2; + * + * @return Whether the resolvedRepoSource field is set. + */ + boolean hasResolvedRepoSource(); + /** + * + * + *
+   * A copy of the build's `source.repo_source`, if exists, with any
+   * revisions resolved.
+   * 
+ * + * .google.cloud.functions.v2beta.RepoSource resolved_repo_source = 2; + * + * @return The resolvedRepoSource. + */ + com.google.cloud.functions.v2beta.RepoSource getResolvedRepoSource(); + /** + * + * + *
+   * A copy of the build's `source.repo_source`, if exists, with any
+   * revisions resolved.
+   * 
+ * + * .google.cloud.functions.v2beta.RepoSource resolved_repo_source = 2; + */ + com.google.cloud.functions.v2beta.RepoSourceOrBuilder getResolvedRepoSourceOrBuilder(); +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/Stage.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/Stage.java new file mode 100644 index 00000000..cd13ddb0 --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/Stage.java @@ -0,0 +1,2221 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +/** + * + * + *
+ * Each Stage of the deployment process
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.Stage} + */ +public final class Stage extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2beta.Stage) + StageOrBuilder { + private static final long serialVersionUID = 0L; + // Use Stage.newBuilder() to construct. + private Stage(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Stage() { + name_ = 0; + message_ = ""; + state_ = 0; + resource_ = ""; + resourceUri_ = ""; + stateMessages_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Stage(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Stage( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + name_ = rawValue; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + message_ = s; + break; + } + case 24: + { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + resource_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + resourceUri_ = s; + break; + } + case 50: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + stateMessages_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + stateMessages_.add( + input.readMessage( + com.google.cloud.functions.v2beta.StateMessage.parser(), extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + stateMessages_ = java.util.Collections.unmodifiableList(stateMessages_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_Stage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_Stage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.Stage.class, + com.google.cloud.functions.v2beta.Stage.Builder.class); + } + + /** + * + * + *
+   * Possible names for a Stage
+   * 
+ * + * Protobuf enum {@code google.cloud.functions.v2beta.Stage.Name} + */ + public enum Name implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not specified. Invalid name.
+     * 
+ * + * NAME_UNSPECIFIED = 0; + */ + NAME_UNSPECIFIED(0), + /** + * + * + *
+     * Artifact Regsitry Stage
+     * 
+ * + * ARTIFACT_REGISTRY = 1; + */ + ARTIFACT_REGISTRY(1), + /** + * + * + *
+     * Build Stage
+     * 
+ * + * BUILD = 2; + */ + BUILD(2), + /** + * + * + *
+     * Service Stage
+     * 
+ * + * SERVICE = 3; + */ + SERVICE(3), + /** + * + * + *
+     * Trigger Stage
+     * 
+ * + * TRIGGER = 4; + */ + TRIGGER(4), + /** + * + * + *
+     * Service Rollback Stage
+     * 
+ * + * SERVICE_ROLLBACK = 5; + */ + SERVICE_ROLLBACK(5), + /** + * + * + *
+     * Trigger Rollback Stage
+     * 
+ * + * TRIGGER_ROLLBACK = 6; + */ + TRIGGER_ROLLBACK(6), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not specified. Invalid name.
+     * 
+ * + * NAME_UNSPECIFIED = 0; + */ + public static final int NAME_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Artifact Regsitry Stage
+     * 
+ * + * ARTIFACT_REGISTRY = 1; + */ + public static final int ARTIFACT_REGISTRY_VALUE = 1; + /** + * + * + *
+     * Build Stage
+     * 
+ * + * BUILD = 2; + */ + public static final int BUILD_VALUE = 2; + /** + * + * + *
+     * Service Stage
+     * 
+ * + * SERVICE = 3; + */ + public static final int SERVICE_VALUE = 3; + /** + * + * + *
+     * Trigger Stage
+     * 
+ * + * TRIGGER = 4; + */ + public static final int TRIGGER_VALUE = 4; + /** + * + * + *
+     * Service Rollback Stage
+     * 
+ * + * SERVICE_ROLLBACK = 5; + */ + public static final int SERVICE_ROLLBACK_VALUE = 5; + /** + * + * + *
+     * Trigger Rollback Stage
+     * 
+ * + * TRIGGER_ROLLBACK = 6; + */ + public static final int TRIGGER_ROLLBACK_VALUE = 6; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Name valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Name forNumber(int value) { + switch (value) { + case 0: + return NAME_UNSPECIFIED; + case 1: + return ARTIFACT_REGISTRY; + case 2: + return BUILD; + case 3: + return SERVICE; + case 4: + return TRIGGER; + case 5: + return SERVICE_ROLLBACK; + case 6: + return TRIGGER_ROLLBACK; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Name findValueByNumber(int number) { + return Name.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.functions.v2beta.Stage.getDescriptor().getEnumTypes().get(0); + } + + private static final Name[] VALUES = values(); + + public static Name valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Name(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.functions.v2beta.Stage.Name) + } + + /** + * + * + *
+   * Possible states for a Stage
+   * 
+ * + * Protobuf enum {@code google.cloud.functions.v2beta.Stage.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not specified. Invalid state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Stage has not started.
+     * 
+ * + * NOT_STARTED = 1; + */ + NOT_STARTED(1), + /** + * + * + *
+     * Stage is in progress.
+     * 
+ * + * IN_PROGRESS = 2; + */ + IN_PROGRESS(2), + /** + * + * + *
+     * Stage has completed.
+     * 
+ * + * COMPLETE = 3; + */ + COMPLETE(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not specified. Invalid state.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Stage has not started.
+     * 
+ * + * NOT_STARTED = 1; + */ + public static final int NOT_STARTED_VALUE = 1; + /** + * + * + *
+     * Stage is in progress.
+     * 
+ * + * IN_PROGRESS = 2; + */ + public static final int IN_PROGRESS_VALUE = 2; + /** + * + * + *
+     * Stage has completed.
+     * 
+ * + * COMPLETE = 3; + */ + public static final int COMPLETE_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static State valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static State forNumber(int value) { + switch (value) { + case 0: + return STATE_UNSPECIFIED; + case 1: + return NOT_STARTED; + case 2: + return IN_PROGRESS; + case 3: + return COMPLETE; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.functions.v2beta.Stage.getDescriptor().getEnumTypes().get(1); + } + + private static final State[] VALUES = values(); + + public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.functions.v2beta.Stage.State) + } + + public static final int NAME_FIELD_NUMBER = 1; + private int name_; + /** + * + * + *
+   * Name of the Stage. This will be unique for each Stage.
+   * 
+ * + * .google.cloud.functions.v2beta.Stage.Name name = 1; + * + * @return The enum numeric value on the wire for name. + */ + @java.lang.Override + public int getNameValue() { + return name_; + } + /** + * + * + *
+   * Name of the Stage. This will be unique for each Stage.
+   * 
+ * + * .google.cloud.functions.v2beta.Stage.Name name = 1; + * + * @return The name. + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.Stage.Name getName() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2beta.Stage.Name result = + com.google.cloud.functions.v2beta.Stage.Name.valueOf(name_); + return result == null ? com.google.cloud.functions.v2beta.Stage.Name.UNRECOGNIZED : result; + } + + public static final int MESSAGE_FIELD_NUMBER = 2; + private volatile java.lang.Object message_; + /** + * + * + *
+   * Message describing the Stage
+   * 
+ * + * string message = 2; + * + * @return The message. + */ + @java.lang.Override + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } + } + /** + * + * + *
+   * Message describing the Stage
+   * 
+ * + * string message = 2; + * + * @return The bytes for message. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATE_FIELD_NUMBER = 3; + private int state_; + /** + * + * + *
+   * Current state of the Stage
+   * 
+ * + * .google.cloud.functions.v2beta.Stage.State state = 3; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+   * Current state of the Stage
+   * 
+ * + * .google.cloud.functions.v2beta.Stage.State state = 3; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.Stage.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2beta.Stage.State result = + com.google.cloud.functions.v2beta.Stage.State.valueOf(state_); + return result == null ? com.google.cloud.functions.v2beta.Stage.State.UNRECOGNIZED : result; + } + + public static final int RESOURCE_FIELD_NUMBER = 4; + private volatile java.lang.Object resource_; + /** + * + * + *
+   * Resource of the Stage
+   * 
+ * + * string resource = 4; + * + * @return The resource. + */ + @java.lang.Override + public java.lang.String getResource() { + java.lang.Object ref = resource_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resource_ = s; + return s; + } + } + /** + * + * + *
+   * Resource of the Stage
+   * 
+ * + * string resource = 4; + * + * @return The bytes for resource. + */ + @java.lang.Override + public com.google.protobuf.ByteString getResourceBytes() { + java.lang.Object ref = resource_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOURCE_URI_FIELD_NUMBER = 5; + private volatile java.lang.Object resourceUri_; + /** + * + * + *
+   * Link to the current Stage resource
+   * 
+ * + * string resource_uri = 5; + * + * @return The resourceUri. + */ + @java.lang.Override + public java.lang.String getResourceUri() { + java.lang.Object ref = resourceUri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceUri_ = s; + return s; + } + } + /** + * + * + *
+   * Link to the current Stage resource
+   * 
+ * + * string resource_uri = 5; + * + * @return The bytes for resourceUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getResourceUriBytes() { + java.lang.Object ref = resourceUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATE_MESSAGES_FIELD_NUMBER = 6; + private java.util.List stateMessages_; + /** + * + * + *
+   * State messages from the current Stage.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 6; + */ + @java.lang.Override + public java.util.List getStateMessagesList() { + return stateMessages_; + } + /** + * + * + *
+   * State messages from the current Stage.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 6; + */ + @java.lang.Override + public java.util.List + getStateMessagesOrBuilderList() { + return stateMessages_; + } + /** + * + * + *
+   * State messages from the current Stage.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 6; + */ + @java.lang.Override + public int getStateMessagesCount() { + return stateMessages_.size(); + } + /** + * + * + *
+   * State messages from the current Stage.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 6; + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.StateMessage getStateMessages(int index) { + return stateMessages_.get(index); + } + /** + * + * + *
+   * State messages from the current Stage.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 6; + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.StateMessageOrBuilder getStateMessagesOrBuilder( + int index) { + return stateMessages_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (name_ != com.google.cloud.functions.v2beta.Stage.Name.NAME_UNSPECIFIED.getNumber()) { + output.writeEnum(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(message_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, message_); + } + if (state_ != com.google.cloud.functions.v2beta.Stage.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(3, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resource_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, resource_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resourceUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, resourceUri_); + } + for (int i = 0; i < stateMessages_.size(); i++) { + output.writeMessage(6, stateMessages_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (name_ != com.google.cloud.functions.v2beta.Stage.Name.NAME_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(message_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, message_); + } + if (state_ != com.google.cloud.functions.v2beta.Stage.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resource_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, resource_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(resourceUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, resourceUri_); + } + for (int i = 0; i < stateMessages_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, stateMessages_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2beta.Stage)) { + return super.equals(obj); + } + com.google.cloud.functions.v2beta.Stage other = (com.google.cloud.functions.v2beta.Stage) obj; + + if (name_ != other.name_) return false; + if (!getMessage().equals(other.getMessage())) return false; + if (state_ != other.state_) return false; + if (!getResource().equals(other.getResource())) return false; + if (!getResourceUri().equals(other.getResourceUri())) return false; + if (!getStateMessagesList().equals(other.getStateMessagesList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + name_; + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + RESOURCE_FIELD_NUMBER; + hash = (53 * hash) + getResource().hashCode(); + hash = (37 * hash) + RESOURCE_URI_FIELD_NUMBER; + hash = (53 * hash) + getResourceUri().hashCode(); + if (getStateMessagesCount() > 0) { + hash = (37 * hash) + STATE_MESSAGES_FIELD_NUMBER; + hash = (53 * hash) + getStateMessagesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2beta.Stage parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.Stage parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.Stage parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.Stage parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.Stage parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.Stage parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.Stage parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.Stage parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.Stage parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.Stage parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.Stage parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.Stage parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v2beta.Stage prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Each Stage of the deployment process
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.Stage} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2beta.Stage) + com.google.cloud.functions.v2beta.StageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_Stage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_Stage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.Stage.class, + com.google.cloud.functions.v2beta.Stage.Builder.class); + } + + // Construct using com.google.cloud.functions.v2beta.Stage.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getStateMessagesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = 0; + + message_ = ""; + + state_ = 0; + + resource_ = ""; + + resourceUri_ = ""; + + if (stateMessagesBuilder_ == null) { + stateMessages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + stateMessagesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_Stage_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.Stage getDefaultInstanceForType() { + return com.google.cloud.functions.v2beta.Stage.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.Stage build() { + com.google.cloud.functions.v2beta.Stage result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.Stage buildPartial() { + com.google.cloud.functions.v2beta.Stage result = + new com.google.cloud.functions.v2beta.Stage(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.message_ = message_; + result.state_ = state_; + result.resource_ = resource_; + result.resourceUri_ = resourceUri_; + if (stateMessagesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + stateMessages_ = java.util.Collections.unmodifiableList(stateMessages_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.stateMessages_ = stateMessages_; + } else { + result.stateMessages_ = stateMessagesBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2beta.Stage) { + return mergeFrom((com.google.cloud.functions.v2beta.Stage) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2beta.Stage other) { + if (other == com.google.cloud.functions.v2beta.Stage.getDefaultInstance()) return this; + if (other.name_ != 0) { + setNameValue(other.getNameValue()); + } + if (!other.getMessage().isEmpty()) { + message_ = other.message_; + onChanged(); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (!other.getResource().isEmpty()) { + resource_ = other.resource_; + onChanged(); + } + if (!other.getResourceUri().isEmpty()) { + resourceUri_ = other.resourceUri_; + onChanged(); + } + if (stateMessagesBuilder_ == null) { + if (!other.stateMessages_.isEmpty()) { + if (stateMessages_.isEmpty()) { + stateMessages_ = other.stateMessages_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureStateMessagesIsMutable(); + stateMessages_.addAll(other.stateMessages_); + } + onChanged(); + } + } else { + if (!other.stateMessages_.isEmpty()) { + if (stateMessagesBuilder_.isEmpty()) { + stateMessagesBuilder_.dispose(); + stateMessagesBuilder_ = null; + stateMessages_ = other.stateMessages_; + bitField0_ = (bitField0_ & ~0x00000001); + stateMessagesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getStateMessagesFieldBuilder() + : null; + } else { + stateMessagesBuilder_.addAllMessages(other.stateMessages_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2beta.Stage parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v2beta.Stage) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private int name_ = 0; + /** + * + * + *
+     * Name of the Stage. This will be unique for each Stage.
+     * 
+ * + * .google.cloud.functions.v2beta.Stage.Name name = 1; + * + * @return The enum numeric value on the wire for name. + */ + @java.lang.Override + public int getNameValue() { + return name_; + } + /** + * + * + *
+     * Name of the Stage. This will be unique for each Stage.
+     * 
+ * + * .google.cloud.functions.v2beta.Stage.Name name = 1; + * + * @param value The enum numeric value on the wire for name to set. + * @return This builder for chaining. + */ + public Builder setNameValue(int value) { + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the Stage. This will be unique for each Stage.
+     * 
+ * + * .google.cloud.functions.v2beta.Stage.Name name = 1; + * + * @return The name. + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.Stage.Name getName() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2beta.Stage.Name result = + com.google.cloud.functions.v2beta.Stage.Name.valueOf(name_); + return result == null ? com.google.cloud.functions.v2beta.Stage.Name.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Name of the Stage. This will be unique for each Stage.
+     * 
+ * + * .google.cloud.functions.v2beta.Stage.Name name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(com.google.cloud.functions.v2beta.Stage.Name value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Name of the Stage. This will be unique for each Stage.
+     * 
+ * + * .google.cloud.functions.v2beta.Stage.Name name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = 0; + onChanged(); + return this; + } + + private java.lang.Object message_ = ""; + /** + * + * + *
+     * Message describing the Stage
+     * 
+ * + * string message = 2; + * + * @return The message. + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Message describing the Stage
+     * 
+ * + * string message = 2; + * + * @return The bytes for message. + */ + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Message describing the Stage
+     * 
+ * + * string message = 2; + * + * @param value The message to set. + * @return This builder for chaining. + */ + public Builder setMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + message_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Message describing the Stage
+     * 
+ * + * string message = 2; + * + * @return This builder for chaining. + */ + public Builder clearMessage() { + + message_ = getDefaultInstance().getMessage(); + onChanged(); + return this; + } + /** + * + * + *
+     * Message describing the Stage
+     * 
+ * + * string message = 2; + * + * @param value The bytes for message to set. + * @return This builder for chaining. + */ + public Builder setMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + message_ = value; + onChanged(); + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * Current state of the Stage
+     * 
+ * + * .google.cloud.functions.v2beta.Stage.State state = 3; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + /** + * + * + *
+     * Current state of the Stage
+     * 
+ * + * .google.cloud.functions.v2beta.Stage.State state = 3; + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + + state_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Current state of the Stage
+     * 
+ * + * .google.cloud.functions.v2beta.Stage.State state = 3; + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.Stage.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2beta.Stage.State result = + com.google.cloud.functions.v2beta.Stage.State.valueOf(state_); + return result == null ? com.google.cloud.functions.v2beta.Stage.State.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Current state of the Stage
+     * 
+ * + * .google.cloud.functions.v2beta.Stage.State state = 3; + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.functions.v2beta.Stage.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Current state of the Stage
+     * 
+ * + * .google.cloud.functions.v2beta.Stage.State state = 3; + * + * @return This builder for chaining. + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private java.lang.Object resource_ = ""; + /** + * + * + *
+     * Resource of the Stage
+     * 
+ * + * string resource = 4; + * + * @return The resource. + */ + public java.lang.String getResource() { + java.lang.Object ref = resource_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resource_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Resource of the Stage
+     * 
+ * + * string resource = 4; + * + * @return The bytes for resource. + */ + public com.google.protobuf.ByteString getResourceBytes() { + java.lang.Object ref = resource_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Resource of the Stage
+     * 
+ * + * string resource = 4; + * + * @param value The resource to set. + * @return This builder for chaining. + */ + public Builder setResource(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + resource_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Resource of the Stage
+     * 
+ * + * string resource = 4; + * + * @return This builder for chaining. + */ + public Builder clearResource() { + + resource_ = getDefaultInstance().getResource(); + onChanged(); + return this; + } + /** + * + * + *
+     * Resource of the Stage
+     * 
+ * + * string resource = 4; + * + * @param value The bytes for resource to set. + * @return This builder for chaining. + */ + public Builder setResourceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + resource_ = value; + onChanged(); + return this; + } + + private java.lang.Object resourceUri_ = ""; + /** + * + * + *
+     * Link to the current Stage resource
+     * 
+ * + * string resource_uri = 5; + * + * @return The resourceUri. + */ + public java.lang.String getResourceUri() { + java.lang.Object ref = resourceUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Link to the current Stage resource
+     * 
+ * + * string resource_uri = 5; + * + * @return The bytes for resourceUri. + */ + public com.google.protobuf.ByteString getResourceUriBytes() { + java.lang.Object ref = resourceUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Link to the current Stage resource
+     * 
+ * + * string resource_uri = 5; + * + * @param value The resourceUri to set. + * @return This builder for chaining. + */ + public Builder setResourceUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + resourceUri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Link to the current Stage resource
+     * 
+ * + * string resource_uri = 5; + * + * @return This builder for chaining. + */ + public Builder clearResourceUri() { + + resourceUri_ = getDefaultInstance().getResourceUri(); + onChanged(); + return this; + } + /** + * + * + *
+     * Link to the current Stage resource
+     * 
+ * + * string resource_uri = 5; + * + * @param value The bytes for resourceUri to set. + * @return This builder for chaining. + */ + public Builder setResourceUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + resourceUri_ = value; + onChanged(); + return this; + } + + private java.util.List stateMessages_ = + java.util.Collections.emptyList(); + + private void ensureStateMessagesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + stateMessages_ = + new java.util.ArrayList(stateMessages_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2beta.StateMessage, + com.google.cloud.functions.v2beta.StateMessage.Builder, + com.google.cloud.functions.v2beta.StateMessageOrBuilder> + stateMessagesBuilder_; + + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 6; + */ + public java.util.List getStateMessagesList() { + if (stateMessagesBuilder_ == null) { + return java.util.Collections.unmodifiableList(stateMessages_); + } else { + return stateMessagesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 6; + */ + public int getStateMessagesCount() { + if (stateMessagesBuilder_ == null) { + return stateMessages_.size(); + } else { + return stateMessagesBuilder_.getCount(); + } + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 6; + */ + public com.google.cloud.functions.v2beta.StateMessage getStateMessages(int index) { + if (stateMessagesBuilder_ == null) { + return stateMessages_.get(index); + } else { + return stateMessagesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 6; + */ + public Builder setStateMessages( + int index, com.google.cloud.functions.v2beta.StateMessage value) { + if (stateMessagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStateMessagesIsMutable(); + stateMessages_.set(index, value); + onChanged(); + } else { + stateMessagesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 6; + */ + public Builder setStateMessages( + int index, com.google.cloud.functions.v2beta.StateMessage.Builder builderForValue) { + if (stateMessagesBuilder_ == null) { + ensureStateMessagesIsMutable(); + stateMessages_.set(index, builderForValue.build()); + onChanged(); + } else { + stateMessagesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 6; + */ + public Builder addStateMessages(com.google.cloud.functions.v2beta.StateMessage value) { + if (stateMessagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStateMessagesIsMutable(); + stateMessages_.add(value); + onChanged(); + } else { + stateMessagesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 6; + */ + public Builder addStateMessages( + int index, com.google.cloud.functions.v2beta.StateMessage value) { + if (stateMessagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStateMessagesIsMutable(); + stateMessages_.add(index, value); + onChanged(); + } else { + stateMessagesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 6; + */ + public Builder addStateMessages( + com.google.cloud.functions.v2beta.StateMessage.Builder builderForValue) { + if (stateMessagesBuilder_ == null) { + ensureStateMessagesIsMutable(); + stateMessages_.add(builderForValue.build()); + onChanged(); + } else { + stateMessagesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 6; + */ + public Builder addStateMessages( + int index, com.google.cloud.functions.v2beta.StateMessage.Builder builderForValue) { + if (stateMessagesBuilder_ == null) { + ensureStateMessagesIsMutable(); + stateMessages_.add(index, builderForValue.build()); + onChanged(); + } else { + stateMessagesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 6; + */ + public Builder addAllStateMessages( + java.lang.Iterable values) { + if (stateMessagesBuilder_ == null) { + ensureStateMessagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, stateMessages_); + onChanged(); + } else { + stateMessagesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 6; + */ + public Builder clearStateMessages() { + if (stateMessagesBuilder_ == null) { + stateMessages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + stateMessagesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 6; + */ + public Builder removeStateMessages(int index) { + if (stateMessagesBuilder_ == null) { + ensureStateMessagesIsMutable(); + stateMessages_.remove(index); + onChanged(); + } else { + stateMessagesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 6; + */ + public com.google.cloud.functions.v2beta.StateMessage.Builder getStateMessagesBuilder( + int index) { + return getStateMessagesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 6; + */ + public com.google.cloud.functions.v2beta.StateMessageOrBuilder getStateMessagesOrBuilder( + int index) { + if (stateMessagesBuilder_ == null) { + return stateMessages_.get(index); + } else { + return stateMessagesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 6; + */ + public java.util.List + getStateMessagesOrBuilderList() { + if (stateMessagesBuilder_ != null) { + return stateMessagesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(stateMessages_); + } + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 6; + */ + public com.google.cloud.functions.v2beta.StateMessage.Builder addStateMessagesBuilder() { + return getStateMessagesFieldBuilder() + .addBuilder(com.google.cloud.functions.v2beta.StateMessage.getDefaultInstance()); + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 6; + */ + public com.google.cloud.functions.v2beta.StateMessage.Builder addStateMessagesBuilder( + int index) { + return getStateMessagesFieldBuilder() + .addBuilder(index, com.google.cloud.functions.v2beta.StateMessage.getDefaultInstance()); + } + /** + * + * + *
+     * State messages from the current Stage.
+     * 
+ * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 6; + */ + public java.util.List + getStateMessagesBuilderList() { + return getStateMessagesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2beta.StateMessage, + com.google.cloud.functions.v2beta.StateMessage.Builder, + com.google.cloud.functions.v2beta.StateMessageOrBuilder> + getStateMessagesFieldBuilder() { + if (stateMessagesBuilder_ == null) { + stateMessagesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.functions.v2beta.StateMessage, + com.google.cloud.functions.v2beta.StateMessage.Builder, + com.google.cloud.functions.v2beta.StateMessageOrBuilder>( + stateMessages_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + stateMessages_ = null; + } + return stateMessagesBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2beta.Stage) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2beta.Stage) + private static final com.google.cloud.functions.v2beta.Stage DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2beta.Stage(); + } + + public static com.google.cloud.functions.v2beta.Stage getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Stage parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Stage(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.Stage getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/StageOrBuilder.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/StageOrBuilder.java new file mode 100644 index 00000000..f445c5be --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/StageOrBuilder.java @@ -0,0 +1,202 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +public interface StageOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2beta.Stage) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Name of the Stage. This will be unique for each Stage.
+   * 
+ * + * .google.cloud.functions.v2beta.Stage.Name name = 1; + * + * @return The enum numeric value on the wire for name. + */ + int getNameValue(); + /** + * + * + *
+   * Name of the Stage. This will be unique for each Stage.
+   * 
+ * + * .google.cloud.functions.v2beta.Stage.Name name = 1; + * + * @return The name. + */ + com.google.cloud.functions.v2beta.Stage.Name getName(); + + /** + * + * + *
+   * Message describing the Stage
+   * 
+ * + * string message = 2; + * + * @return The message. + */ + java.lang.String getMessage(); + /** + * + * + *
+   * Message describing the Stage
+   * 
+ * + * string message = 2; + * + * @return The bytes for message. + */ + com.google.protobuf.ByteString getMessageBytes(); + + /** + * + * + *
+   * Current state of the Stage
+   * 
+ * + * .google.cloud.functions.v2beta.Stage.State state = 3; + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Current state of the Stage
+   * 
+ * + * .google.cloud.functions.v2beta.Stage.State state = 3; + * + * @return The state. + */ + com.google.cloud.functions.v2beta.Stage.State getState(); + + /** + * + * + *
+   * Resource of the Stage
+   * 
+ * + * string resource = 4; + * + * @return The resource. + */ + java.lang.String getResource(); + /** + * + * + *
+   * Resource of the Stage
+   * 
+ * + * string resource = 4; + * + * @return The bytes for resource. + */ + com.google.protobuf.ByteString getResourceBytes(); + + /** + * + * + *
+   * Link to the current Stage resource
+   * 
+ * + * string resource_uri = 5; + * + * @return The resourceUri. + */ + java.lang.String getResourceUri(); + /** + * + * + *
+   * Link to the current Stage resource
+   * 
+ * + * string resource_uri = 5; + * + * @return The bytes for resourceUri. + */ + com.google.protobuf.ByteString getResourceUriBytes(); + + /** + * + * + *
+   * State messages from the current Stage.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 6; + */ + java.util.List getStateMessagesList(); + /** + * + * + *
+   * State messages from the current Stage.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 6; + */ + com.google.cloud.functions.v2beta.StateMessage getStateMessages(int index); + /** + * + * + *
+   * State messages from the current Stage.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 6; + */ + int getStateMessagesCount(); + /** + * + * + *
+   * State messages from the current Stage.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 6; + */ + java.util.List + getStateMessagesOrBuilderList(); + /** + * + * + *
+   * State messages from the current Stage.
+   * 
+ * + * repeated .google.cloud.functions.v2beta.StateMessage state_messages = 6; + */ + com.google.cloud.functions.v2beta.StateMessageOrBuilder getStateMessagesOrBuilder(int index); +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/StateMessage.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/StateMessage.java new file mode 100644 index 00000000..4ec960aa --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/StateMessage.java @@ -0,0 +1,1152 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +/** + * + * + *
+ * Informational messages about the state of the Cloud Function or Operation.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.StateMessage} + */ +public final class StateMessage extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2beta.StateMessage) + StateMessageOrBuilder { + private static final long serialVersionUID = 0L; + // Use StateMessage.newBuilder() to construct. + private StateMessage(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StateMessage() { + severity_ = 0; + type_ = ""; + message_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StateMessage(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private StateMessage( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + severity_ = rawValue; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + type_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + message_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_StateMessage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_StateMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.StateMessage.class, + com.google.cloud.functions.v2beta.StateMessage.Builder.class); + } + + /** + * + * + *
+   * Severity of the state message.
+   * 
+ * + * Protobuf enum {@code google.cloud.functions.v2beta.StateMessage.Severity} + */ + public enum Severity implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not specified. Invalid severity.
+     * 
+ * + * SEVERITY_UNSPECIFIED = 0; + */ + SEVERITY_UNSPECIFIED(0), + /** + * + * + *
+     * ERROR-level severity.
+     * 
+ * + * ERROR = 1; + */ + ERROR(1), + /** + * + * + *
+     * WARNING-level severity.
+     * 
+ * + * WARNING = 2; + */ + WARNING(2), + /** + * + * + *
+     * INFO-level severity.
+     * 
+ * + * INFO = 3; + */ + INFO(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not specified. Invalid severity.
+     * 
+ * + * SEVERITY_UNSPECIFIED = 0; + */ + public static final int SEVERITY_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * ERROR-level severity.
+     * 
+ * + * ERROR = 1; + */ + public static final int ERROR_VALUE = 1; + /** + * + * + *
+     * WARNING-level severity.
+     * 
+ * + * WARNING = 2; + */ + public static final int WARNING_VALUE = 2; + /** + * + * + *
+     * INFO-level severity.
+     * 
+ * + * INFO = 3; + */ + public static final int INFO_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Severity valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Severity forNumber(int value) { + switch (value) { + case 0: + return SEVERITY_UNSPECIFIED; + case 1: + return ERROR; + case 2: + return WARNING; + case 3: + return INFO; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Severity findValueByNumber(int number) { + return Severity.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.functions.v2beta.StateMessage.getDescriptor().getEnumTypes().get(0); + } + + private static final Severity[] VALUES = values(); + + public static Severity valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Severity(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.functions.v2beta.StateMessage.Severity) + } + + public static final int SEVERITY_FIELD_NUMBER = 1; + private int severity_; + /** + * + * + *
+   * Severity of the state message.
+   * 
+ * + * .google.cloud.functions.v2beta.StateMessage.Severity severity = 1; + * + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override + public int getSeverityValue() { + return severity_; + } + /** + * + * + *
+   * Severity of the state message.
+   * 
+ * + * .google.cloud.functions.v2beta.StateMessage.Severity severity = 1; + * + * @return The severity. + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.StateMessage.Severity getSeverity() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2beta.StateMessage.Severity result = + com.google.cloud.functions.v2beta.StateMessage.Severity.valueOf(severity_); + return result == null + ? com.google.cloud.functions.v2beta.StateMessage.Severity.UNRECOGNIZED + : result; + } + + public static final int TYPE_FIELD_NUMBER = 2; + private volatile java.lang.Object type_; + /** + * + * + *
+   * One-word CamelCase type of the state message.
+   * 
+ * + * string type = 2; + * + * @return The type. + */ + @java.lang.Override + public java.lang.String getType() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } + } + /** + * + * + *
+   * One-word CamelCase type of the state message.
+   * 
+ * + * string type = 2; + * + * @return The bytes for type. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MESSAGE_FIELD_NUMBER = 3; + private volatile java.lang.Object message_; + /** + * + * + *
+   * The message.
+   * 
+ * + * string message = 3; + * + * @return The message. + */ + @java.lang.Override + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } + } + /** + * + * + *
+   * The message.
+   * 
+ * + * string message = 3; + * + * @return The bytes for message. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (severity_ + != com.google.cloud.functions.v2beta.StateMessage.Severity.SEVERITY_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, severity_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, type_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(message_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, message_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (severity_ + != com.google.cloud.functions.v2beta.StateMessage.Severity.SEVERITY_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, severity_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, type_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(message_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, message_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2beta.StateMessage)) { + return super.equals(obj); + } + com.google.cloud.functions.v2beta.StateMessage other = + (com.google.cloud.functions.v2beta.StateMessage) obj; + + if (severity_ != other.severity_) return false; + if (!getType().equals(other.getType())) return false; + if (!getMessage().equals(other.getMessage())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SEVERITY_FIELD_NUMBER; + hash = (53 * hash) + severity_; + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2beta.StateMessage parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.StateMessage parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.StateMessage parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.StateMessage parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.StateMessage parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.StateMessage parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.StateMessage parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.StateMessage parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.StateMessage parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.StateMessage parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.StateMessage parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.StateMessage parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v2beta.StateMessage prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Informational messages about the state of the Cloud Function or Operation.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.StateMessage} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2beta.StateMessage) + com.google.cloud.functions.v2beta.StateMessageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_StateMessage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_StateMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.StateMessage.class, + com.google.cloud.functions.v2beta.StateMessage.Builder.class); + } + + // Construct using com.google.cloud.functions.v2beta.StateMessage.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + severity_ = 0; + + type_ = ""; + + message_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_StateMessage_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.StateMessage getDefaultInstanceForType() { + return com.google.cloud.functions.v2beta.StateMessage.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.StateMessage build() { + com.google.cloud.functions.v2beta.StateMessage result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.StateMessage buildPartial() { + com.google.cloud.functions.v2beta.StateMessage result = + new com.google.cloud.functions.v2beta.StateMessage(this); + result.severity_ = severity_; + result.type_ = type_; + result.message_ = message_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2beta.StateMessage) { + return mergeFrom((com.google.cloud.functions.v2beta.StateMessage) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2beta.StateMessage other) { + if (other == com.google.cloud.functions.v2beta.StateMessage.getDefaultInstance()) return this; + if (other.severity_ != 0) { + setSeverityValue(other.getSeverityValue()); + } + if (!other.getType().isEmpty()) { + type_ = other.type_; + onChanged(); + } + if (!other.getMessage().isEmpty()) { + message_ = other.message_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2beta.StateMessage parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v2beta.StateMessage) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int severity_ = 0; + /** + * + * + *
+     * Severity of the state message.
+     * 
+ * + * .google.cloud.functions.v2beta.StateMessage.Severity severity = 1; + * + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override + public int getSeverityValue() { + return severity_; + } + /** + * + * + *
+     * Severity of the state message.
+     * 
+ * + * .google.cloud.functions.v2beta.StateMessage.Severity severity = 1; + * + * @param value The enum numeric value on the wire for severity to set. + * @return This builder for chaining. + */ + public Builder setSeverityValue(int value) { + + severity_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Severity of the state message.
+     * 
+ * + * .google.cloud.functions.v2beta.StateMessage.Severity severity = 1; + * + * @return The severity. + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.StateMessage.Severity getSeverity() { + @SuppressWarnings("deprecation") + com.google.cloud.functions.v2beta.StateMessage.Severity result = + com.google.cloud.functions.v2beta.StateMessage.Severity.valueOf(severity_); + return result == null + ? com.google.cloud.functions.v2beta.StateMessage.Severity.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Severity of the state message.
+     * 
+ * + * .google.cloud.functions.v2beta.StateMessage.Severity severity = 1; + * + * @param value The severity to set. + * @return This builder for chaining. + */ + public Builder setSeverity(com.google.cloud.functions.v2beta.StateMessage.Severity value) { + if (value == null) { + throw new NullPointerException(); + } + + severity_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Severity of the state message.
+     * 
+ * + * .google.cloud.functions.v2beta.StateMessage.Severity severity = 1; + * + * @return This builder for chaining. + */ + public Builder clearSeverity() { + + severity_ = 0; + onChanged(); + return this; + } + + private java.lang.Object type_ = ""; + /** + * + * + *
+     * One-word CamelCase type of the state message.
+     * 
+ * + * string type = 2; + * + * @return The type. + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * One-word CamelCase type of the state message.
+     * 
+ * + * string type = 2; + * + * @return The bytes for type. + */ + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * One-word CamelCase type of the state message.
+     * 
+ * + * string type = 2; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * One-word CamelCase type of the state message.
+     * 
+ * + * string type = 2; + * + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = getDefaultInstance().getType(); + onChanged(); + return this; + } + /** + * + * + *
+     * One-word CamelCase type of the state message.
+     * 
+ * + * string type = 2; + * + * @param value The bytes for type to set. + * @return This builder for chaining. + */ + public Builder setTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + type_ = value; + onChanged(); + return this; + } + + private java.lang.Object message_ = ""; + /** + * + * + *
+     * The message.
+     * 
+ * + * string message = 3; + * + * @return The message. + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The message.
+     * 
+ * + * string message = 3; + * + * @return The bytes for message. + */ + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The message.
+     * 
+ * + * string message = 3; + * + * @param value The message to set. + * @return This builder for chaining. + */ + public Builder setMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + message_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The message.
+     * 
+ * + * string message = 3; + * + * @return This builder for chaining. + */ + public Builder clearMessage() { + + message_ = getDefaultInstance().getMessage(); + onChanged(); + return this; + } + /** + * + * + *
+     * The message.
+     * 
+ * + * string message = 3; + * + * @param value The bytes for message to set. + * @return This builder for chaining. + */ + public Builder setMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + message_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2beta.StateMessage) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2beta.StateMessage) + private static final com.google.cloud.functions.v2beta.StateMessage DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2beta.StateMessage(); + } + + public static com.google.cloud.functions.v2beta.StateMessage getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StateMessage parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StateMessage(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.StateMessage getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/StateMessageOrBuilder.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/StateMessageOrBuilder.java new file mode 100644 index 00000000..a5e2eef9 --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/StateMessageOrBuilder.java @@ -0,0 +1,100 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +public interface StateMessageOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2beta.StateMessage) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Severity of the state message.
+   * 
+ * + * .google.cloud.functions.v2beta.StateMessage.Severity severity = 1; + * + * @return The enum numeric value on the wire for severity. + */ + int getSeverityValue(); + /** + * + * + *
+   * Severity of the state message.
+   * 
+ * + * .google.cloud.functions.v2beta.StateMessage.Severity severity = 1; + * + * @return The severity. + */ + com.google.cloud.functions.v2beta.StateMessage.Severity getSeverity(); + + /** + * + * + *
+   * One-word CamelCase type of the state message.
+   * 
+ * + * string type = 2; + * + * @return The type. + */ + java.lang.String getType(); + /** + * + * + *
+   * One-word CamelCase type of the state message.
+   * 
+ * + * string type = 2; + * + * @return The bytes for type. + */ + com.google.protobuf.ByteString getTypeBytes(); + + /** + * + * + *
+   * The message.
+   * 
+ * + * string message = 3; + * + * @return The message. + */ + java.lang.String getMessage(); + /** + * + * + *
+   * The message.
+   * 
+ * + * string message = 3; + * + * @return The bytes for message. + */ + com.google.protobuf.ByteString getMessageBytes(); +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/StorageSource.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/StorageSource.java new file mode 100644 index 00000000..f99dec2b --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/StorageSource.java @@ -0,0 +1,938 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +/** + * + * + *
+ * Location of the source in an archive file in Google Cloud Storage.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.StorageSource} + */ +public final class StorageSource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2beta.StorageSource) + StorageSourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use StorageSource.newBuilder() to construct. + private StorageSource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StorageSource() { + bucket_ = ""; + object_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StorageSource(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private StorageSource( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + bucket_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + object_ = s; + break; + } + case 24: + { + generation_ = input.readInt64(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_StorageSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_StorageSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.StorageSource.class, + com.google.cloud.functions.v2beta.StorageSource.Builder.class); + } + + public static final int BUCKET_FIELD_NUMBER = 1; + private volatile java.lang.Object bucket_; + /** + * + * + *
+   * Google Cloud Storage bucket containing the source (see
+   * [Bucket Name
+   * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
+   * 
+ * + * string bucket = 1; + * + * @return The bucket. + */ + @java.lang.Override + public java.lang.String getBucket() { + java.lang.Object ref = bucket_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + bucket_ = s; + return s; + } + } + /** + * + * + *
+   * Google Cloud Storage bucket containing the source (see
+   * [Bucket Name
+   * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
+   * 
+ * + * string bucket = 1; + * + * @return The bytes for bucket. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBucketBytes() { + java.lang.Object ref = bucket_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + bucket_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OBJECT_FIELD_NUMBER = 2; + private volatile java.lang.Object object_; + /** + * + * + *
+   * Google Cloud Storage object containing the source.
+   * This object must be a gzipped archive file (`.tar.gz`) containing source to
+   * build.
+   * 
+ * + * string object = 2; + * + * @return The object. + */ + @java.lang.Override + public java.lang.String getObject() { + java.lang.Object ref = object_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + object_ = s; + return s; + } + } + /** + * + * + *
+   * Google Cloud Storage object containing the source.
+   * This object must be a gzipped archive file (`.tar.gz`) containing source to
+   * build.
+   * 
+ * + * string object = 2; + * + * @return The bytes for object. + */ + @java.lang.Override + public com.google.protobuf.ByteString getObjectBytes() { + java.lang.Object ref = object_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + object_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GENERATION_FIELD_NUMBER = 3; + private long generation_; + /** + * + * + *
+   * Google Cloud Storage generation for the object. If the generation is
+   * omitted, the latest generation will be used.
+   * 
+ * + * int64 generation = 3; + * + * @return The generation. + */ + @java.lang.Override + public long getGeneration() { + return generation_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bucket_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, bucket_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(object_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, object_); + } + if (generation_ != 0L) { + output.writeInt64(3, generation_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bucket_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, bucket_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(object_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, object_); + } + if (generation_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, generation_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2beta.StorageSource)) { + return super.equals(obj); + } + com.google.cloud.functions.v2beta.StorageSource other = + (com.google.cloud.functions.v2beta.StorageSource) obj; + + if (!getBucket().equals(other.getBucket())) return false; + if (!getObject().equals(other.getObject())) return false; + if (getGeneration() != other.getGeneration()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + BUCKET_FIELD_NUMBER; + hash = (53 * hash) + getBucket().hashCode(); + hash = (37 * hash) + OBJECT_FIELD_NUMBER; + hash = (53 * hash) + getObject().hashCode(); + hash = (37 * hash) + GENERATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getGeneration()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2beta.StorageSource parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.StorageSource parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.StorageSource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.StorageSource parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.StorageSource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.StorageSource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.StorageSource parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.StorageSource parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.StorageSource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.StorageSource parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.StorageSource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.StorageSource parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.functions.v2beta.StorageSource prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Location of the source in an archive file in Google Cloud Storage.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.StorageSource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2beta.StorageSource) + com.google.cloud.functions.v2beta.StorageSourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_StorageSource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_StorageSource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.StorageSource.class, + com.google.cloud.functions.v2beta.StorageSource.Builder.class); + } + + // Construct using com.google.cloud.functions.v2beta.StorageSource.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bucket_ = ""; + + object_ = ""; + + generation_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_StorageSource_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.StorageSource getDefaultInstanceForType() { + return com.google.cloud.functions.v2beta.StorageSource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.StorageSource build() { + com.google.cloud.functions.v2beta.StorageSource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.StorageSource buildPartial() { + com.google.cloud.functions.v2beta.StorageSource result = + new com.google.cloud.functions.v2beta.StorageSource(this); + result.bucket_ = bucket_; + result.object_ = object_; + result.generation_ = generation_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2beta.StorageSource) { + return mergeFrom((com.google.cloud.functions.v2beta.StorageSource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2beta.StorageSource other) { + if (other == com.google.cloud.functions.v2beta.StorageSource.getDefaultInstance()) + return this; + if (!other.getBucket().isEmpty()) { + bucket_ = other.bucket_; + onChanged(); + } + if (!other.getObject().isEmpty()) { + object_ = other.object_; + onChanged(); + } + if (other.getGeneration() != 0L) { + setGeneration(other.getGeneration()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2beta.StorageSource parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.functions.v2beta.StorageSource) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object bucket_ = ""; + /** + * + * + *
+     * Google Cloud Storage bucket containing the source (see
+     * [Bucket Name
+     * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
+     * 
+ * + * string bucket = 1; + * + * @return The bucket. + */ + public java.lang.String getBucket() { + java.lang.Object ref = bucket_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + bucket_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Google Cloud Storage bucket containing the source (see
+     * [Bucket Name
+     * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
+     * 
+ * + * string bucket = 1; + * + * @return The bytes for bucket. + */ + public com.google.protobuf.ByteString getBucketBytes() { + java.lang.Object ref = bucket_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + bucket_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Google Cloud Storage bucket containing the source (see
+     * [Bucket Name
+     * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
+     * 
+ * + * string bucket = 1; + * + * @param value The bucket to set. + * @return This builder for chaining. + */ + public Builder setBucket(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + bucket_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Google Cloud Storage bucket containing the source (see
+     * [Bucket Name
+     * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
+     * 
+ * + * string bucket = 1; + * + * @return This builder for chaining. + */ + public Builder clearBucket() { + + bucket_ = getDefaultInstance().getBucket(); + onChanged(); + return this; + } + /** + * + * + *
+     * Google Cloud Storage bucket containing the source (see
+     * [Bucket Name
+     * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
+     * 
+ * + * string bucket = 1; + * + * @param value The bytes for bucket to set. + * @return This builder for chaining. + */ + public Builder setBucketBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + bucket_ = value; + onChanged(); + return this; + } + + private java.lang.Object object_ = ""; + /** + * + * + *
+     * Google Cloud Storage object containing the source.
+     * This object must be a gzipped archive file (`.tar.gz`) containing source to
+     * build.
+     * 
+ * + * string object = 2; + * + * @return The object. + */ + public java.lang.String getObject() { + java.lang.Object ref = object_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + object_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Google Cloud Storage object containing the source.
+     * This object must be a gzipped archive file (`.tar.gz`) containing source to
+     * build.
+     * 
+ * + * string object = 2; + * + * @return The bytes for object. + */ + public com.google.protobuf.ByteString getObjectBytes() { + java.lang.Object ref = object_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + object_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Google Cloud Storage object containing the source.
+     * This object must be a gzipped archive file (`.tar.gz`) containing source to
+     * build.
+     * 
+ * + * string object = 2; + * + * @param value The object to set. + * @return This builder for chaining. + */ + public Builder setObject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + object_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Google Cloud Storage object containing the source.
+     * This object must be a gzipped archive file (`.tar.gz`) containing source to
+     * build.
+     * 
+ * + * string object = 2; + * + * @return This builder for chaining. + */ + public Builder clearObject() { + + object_ = getDefaultInstance().getObject(); + onChanged(); + return this; + } + /** + * + * + *
+     * Google Cloud Storage object containing the source.
+     * This object must be a gzipped archive file (`.tar.gz`) containing source to
+     * build.
+     * 
+ * + * string object = 2; + * + * @param value The bytes for object to set. + * @return This builder for chaining. + */ + public Builder setObjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + object_ = value; + onChanged(); + return this; + } + + private long generation_; + /** + * + * + *
+     * Google Cloud Storage generation for the object. If the generation is
+     * omitted, the latest generation will be used.
+     * 
+ * + * int64 generation = 3; + * + * @return The generation. + */ + @java.lang.Override + public long getGeneration() { + return generation_; + } + /** + * + * + *
+     * Google Cloud Storage generation for the object. If the generation is
+     * omitted, the latest generation will be used.
+     * 
+ * + * int64 generation = 3; + * + * @param value The generation to set. + * @return This builder for chaining. + */ + public Builder setGeneration(long value) { + + generation_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Google Cloud Storage generation for the object. If the generation is
+     * omitted, the latest generation will be used.
+     * 
+ * + * int64 generation = 3; + * + * @return This builder for chaining. + */ + public Builder clearGeneration() { + + generation_ = 0L; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2beta.StorageSource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2beta.StorageSource) + private static final com.google.cloud.functions.v2beta.StorageSource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2beta.StorageSource(); + } + + public static com.google.cloud.functions.v2beta.StorageSource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StorageSource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StorageSource(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.StorageSource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/StorageSourceOrBuilder.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/StorageSourceOrBuilder.java new file mode 100644 index 00000000..cc284c24 --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/StorageSourceOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +public interface StorageSourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2beta.StorageSource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Google Cloud Storage bucket containing the source (see
+   * [Bucket Name
+   * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
+   * 
+ * + * string bucket = 1; + * + * @return The bucket. + */ + java.lang.String getBucket(); + /** + * + * + *
+   * Google Cloud Storage bucket containing the source (see
+   * [Bucket Name
+   * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
+   * 
+ * + * string bucket = 1; + * + * @return The bytes for bucket. + */ + com.google.protobuf.ByteString getBucketBytes(); + + /** + * + * + *
+   * Google Cloud Storage object containing the source.
+   * This object must be a gzipped archive file (`.tar.gz`) containing source to
+   * build.
+   * 
+ * + * string object = 2; + * + * @return The object. + */ + java.lang.String getObject(); + /** + * + * + *
+   * Google Cloud Storage object containing the source.
+   * This object must be a gzipped archive file (`.tar.gz`) containing source to
+   * build.
+   * 
+ * + * string object = 2; + * + * @return The bytes for object. + */ + com.google.protobuf.ByteString getObjectBytes(); + + /** + * + * + *
+   * Google Cloud Storage generation for the object. If the generation is
+   * omitted, the latest generation will be used.
+   * 
+ * + * int64 generation = 3; + * + * @return The generation. + */ + long getGeneration(); +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/UpdateFunctionRequest.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/UpdateFunctionRequest.java new file mode 100644 index 00000000..3c236b7e --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/UpdateFunctionRequest.java @@ -0,0 +1,1056 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +/** + * + * + *
+ * Request for the `UpdateFunction` method.
+ * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.UpdateFunctionRequest} + */ +public final class UpdateFunctionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.functions.v2beta.UpdateFunctionRequest) + UpdateFunctionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateFunctionRequest.newBuilder() to construct. + private UpdateFunctionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateFunctionRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateFunctionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateFunctionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.functions.v2beta.Function.Builder subBuilder = null; + if (function_ != null) { + subBuilder = function_.toBuilder(); + } + function_ = + input.readMessage( + com.google.cloud.functions.v2beta.Function.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(function_); + function_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_UpdateFunctionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_UpdateFunctionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.UpdateFunctionRequest.class, + com.google.cloud.functions.v2beta.UpdateFunctionRequest.Builder.class); + } + + public static final int FUNCTION_FIELD_NUMBER = 1; + private com.google.cloud.functions.v2beta.Function function_; + /** + * + * + *
+   * Required. New version of the function.
+   * 
+ * + * + * .google.cloud.functions.v2beta.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the function field is set. + */ + @java.lang.Override + public boolean hasFunction() { + return function_ != null; + } + /** + * + * + *
+   * Required. New version of the function.
+   * 
+ * + * + * .google.cloud.functions.v2beta.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The function. + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.Function getFunction() { + return function_ == null + ? com.google.cloud.functions.v2beta.Function.getDefaultInstance() + : function_; + } + /** + * + * + *
+   * Required. New version of the function.
+   * 
+ * + * + * .google.cloud.functions.v2beta.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.functions.v2beta.FunctionOrBuilder getFunctionOrBuilder() { + return getFunction(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * The list of fields to be updated.
+   * If no field mask is provided, all provided fields in the request will be
+   * updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * The list of fields to be updated.
+   * If no field mask is provided, all provided fields in the request will be
+   * updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * The list of fields to be updated.
+   * If no field mask is provided, all provided fields in the request will be
+   * updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (function_ != null) { + output.writeMessage(1, getFunction()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (function_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getFunction()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.functions.v2beta.UpdateFunctionRequest)) { + return super.equals(obj); + } + com.google.cloud.functions.v2beta.UpdateFunctionRequest other = + (com.google.cloud.functions.v2beta.UpdateFunctionRequest) obj; + + if (hasFunction() != other.hasFunction()) return false; + if (hasFunction()) { + if (!getFunction().equals(other.getFunction())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasFunction()) { + hash = (37 * hash) + FUNCTION_FIELD_NUMBER; + hash = (53 * hash) + getFunction().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.functions.v2beta.UpdateFunctionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.UpdateFunctionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.UpdateFunctionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.UpdateFunctionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.UpdateFunctionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.functions.v2beta.UpdateFunctionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.UpdateFunctionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.UpdateFunctionRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.UpdateFunctionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.UpdateFunctionRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.functions.v2beta.UpdateFunctionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.functions.v2beta.UpdateFunctionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.functions.v2beta.UpdateFunctionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the `UpdateFunction` method.
+   * 
+ * + * Protobuf type {@code google.cloud.functions.v2beta.UpdateFunctionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.functions.v2beta.UpdateFunctionRequest) + com.google.cloud.functions.v2beta.UpdateFunctionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_UpdateFunctionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_UpdateFunctionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.functions.v2beta.UpdateFunctionRequest.class, + com.google.cloud.functions.v2beta.UpdateFunctionRequest.Builder.class); + } + + // Construct using com.google.cloud.functions.v2beta.UpdateFunctionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (functionBuilder_ == null) { + function_ = null; + } else { + function_ = null; + functionBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.functions.v2beta.FunctionsProto + .internal_static_google_cloud_functions_v2beta_UpdateFunctionRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.UpdateFunctionRequest getDefaultInstanceForType() { + return com.google.cloud.functions.v2beta.UpdateFunctionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.UpdateFunctionRequest build() { + com.google.cloud.functions.v2beta.UpdateFunctionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.UpdateFunctionRequest buildPartial() { + com.google.cloud.functions.v2beta.UpdateFunctionRequest result = + new com.google.cloud.functions.v2beta.UpdateFunctionRequest(this); + if (functionBuilder_ == null) { + result.function_ = function_; + } else { + result.function_ = functionBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.functions.v2beta.UpdateFunctionRequest) { + return mergeFrom((com.google.cloud.functions.v2beta.UpdateFunctionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.functions.v2beta.UpdateFunctionRequest other) { + if (other == com.google.cloud.functions.v2beta.UpdateFunctionRequest.getDefaultInstance()) + return this; + if (other.hasFunction()) { + mergeFunction(other.getFunction()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.functions.v2beta.UpdateFunctionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.functions.v2beta.UpdateFunctionRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.functions.v2beta.Function function_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2beta.Function, + com.google.cloud.functions.v2beta.Function.Builder, + com.google.cloud.functions.v2beta.FunctionOrBuilder> + functionBuilder_; + /** + * + * + *
+     * Required. New version of the function.
+     * 
+ * + * + * .google.cloud.functions.v2beta.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the function field is set. + */ + public boolean hasFunction() { + return functionBuilder_ != null || function_ != null; + } + /** + * + * + *
+     * Required. New version of the function.
+     * 
+ * + * + * .google.cloud.functions.v2beta.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The function. + */ + public com.google.cloud.functions.v2beta.Function getFunction() { + if (functionBuilder_ == null) { + return function_ == null + ? com.google.cloud.functions.v2beta.Function.getDefaultInstance() + : function_; + } else { + return functionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. New version of the function.
+     * 
+ * + * + * .google.cloud.functions.v2beta.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setFunction(com.google.cloud.functions.v2beta.Function value) { + if (functionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + function_ = value; + onChanged(); + } else { + functionBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. New version of the function.
+     * 
+ * + * + * .google.cloud.functions.v2beta.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setFunction(com.google.cloud.functions.v2beta.Function.Builder builderForValue) { + if (functionBuilder_ == null) { + function_ = builderForValue.build(); + onChanged(); + } else { + functionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. New version of the function.
+     * 
+ * + * + * .google.cloud.functions.v2beta.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeFunction(com.google.cloud.functions.v2beta.Function value) { + if (functionBuilder_ == null) { + if (function_ != null) { + function_ = + com.google.cloud.functions.v2beta.Function.newBuilder(function_) + .mergeFrom(value) + .buildPartial(); + } else { + function_ = value; + } + onChanged(); + } else { + functionBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. New version of the function.
+     * 
+ * + * + * .google.cloud.functions.v2beta.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearFunction() { + if (functionBuilder_ == null) { + function_ = null; + onChanged(); + } else { + function_ = null; + functionBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. New version of the function.
+     * 
+ * + * + * .google.cloud.functions.v2beta.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.functions.v2beta.Function.Builder getFunctionBuilder() { + + onChanged(); + return getFunctionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. New version of the function.
+     * 
+ * + * + * .google.cloud.functions.v2beta.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.functions.v2beta.FunctionOrBuilder getFunctionOrBuilder() { + if (functionBuilder_ != null) { + return functionBuilder_.getMessageOrBuilder(); + } else { + return function_ == null + ? com.google.cloud.functions.v2beta.Function.getDefaultInstance() + : function_; + } + } + /** + * + * + *
+     * Required. New version of the function.
+     * 
+ * + * + * .google.cloud.functions.v2beta.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2beta.Function, + com.google.cloud.functions.v2beta.Function.Builder, + com.google.cloud.functions.v2beta.FunctionOrBuilder> + getFunctionFieldBuilder() { + if (functionBuilder_ == null) { + functionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.functions.v2beta.Function, + com.google.cloud.functions.v2beta.Function.Builder, + com.google.cloud.functions.v2beta.FunctionOrBuilder>( + getFunction(), getParentForChildren(), isClean()); + function_ = null; + } + return functionBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * The list of fields to be updated.
+     * If no field mask is provided, all provided fields in the request will be
+     * updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * The list of fields to be updated.
+     * If no field mask is provided, all provided fields in the request will be
+     * updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The list of fields to be updated.
+     * If no field mask is provided, all provided fields in the request will be
+     * updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The list of fields to be updated.
+     * If no field mask is provided, all provided fields in the request will be
+     * updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The list of fields to be updated.
+     * If no field mask is provided, all provided fields in the request will be
+     * updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The list of fields to be updated.
+     * If no field mask is provided, all provided fields in the request will be
+     * updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The list of fields to be updated.
+     * If no field mask is provided, all provided fields in the request will be
+     * updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The list of fields to be updated.
+     * If no field mask is provided, all provided fields in the request will be
+     * updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * The list of fields to be updated.
+     * If no field mask is provided, all provided fields in the request will be
+     * updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.functions.v2beta.UpdateFunctionRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.functions.v2beta.UpdateFunctionRequest) + private static final com.google.cloud.functions.v2beta.UpdateFunctionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.functions.v2beta.UpdateFunctionRequest(); + } + + public static com.google.cloud.functions.v2beta.UpdateFunctionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateFunctionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateFunctionRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.functions.v2beta.UpdateFunctionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/UpdateFunctionRequestOrBuilder.java b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/UpdateFunctionRequestOrBuilder.java new file mode 100644 index 00000000..e8f2bac4 --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/java/com/google/cloud/functions/v2beta/UpdateFunctionRequestOrBuilder.java @@ -0,0 +1,107 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/functions/v2beta/functions.proto + +package com.google.cloud.functions.v2beta; + +public interface UpdateFunctionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.functions.v2beta.UpdateFunctionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. New version of the function.
+   * 
+ * + * + * .google.cloud.functions.v2beta.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the function field is set. + */ + boolean hasFunction(); + /** + * + * + *
+   * Required. New version of the function.
+   * 
+ * + * + * .google.cloud.functions.v2beta.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The function. + */ + com.google.cloud.functions.v2beta.Function getFunction(); + /** + * + * + *
+   * Required. New version of the function.
+   * 
+ * + * + * .google.cloud.functions.v2beta.Function function = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.functions.v2beta.FunctionOrBuilder getFunctionOrBuilder(); + + /** + * + * + *
+   * The list of fields to be updated.
+   * If no field mask is provided, all provided fields in the request will be
+   * updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * The list of fields to be updated.
+   * If no field mask is provided, all provided fields in the request will be
+   * updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * The list of fields to be updated.
+   * If no field mask is provided, all provided fields in the request will be
+   * updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-functions-v2beta/src/main/proto/google/cloud/functions/v2beta/functions.proto b/proto-google-cloud-functions-v2beta/src/main/proto/google/cloud/functions/v2beta/functions.proto new file mode 100644 index 00000000..4d8ee95f --- /dev/null +++ b/proto-google-cloud-functions-v2beta/src/main/proto/google/cloud/functions/v2beta/functions.proto @@ -0,0 +1,1033 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.functions.v2beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/functions/v2beta;functions"; +option java_multiple_files = true; +option java_outer_classname = "FunctionsProto"; +option java_package = "com.google.cloud.functions.v2beta"; +option objc_class_prefix = "GCF"; +option (google.api.resource_definition) = { + type: "artifactregistry.googleapis.com/Repository" + pattern: "projects/{project}/locations/{location}/repositories/{repository}" +}; +option (google.api.resource_definition) = { + type: "cloudbuild.googleapis.com/Build" + pattern: "projects/{project}/locations/{location}/builds/{build}" +}; +option (google.api.resource_definition) = { + type: "cloudbuild.googleapis.com/WorkerPool" + pattern: "projects/{project}/locations/{location}/workerPools/{worker_pool}" +}; +option (google.api.resource_definition) = { + type: "run.googleapis.com/Service" + pattern: "projects/{project}/locations/{location}/services/{service}" +}; +option (google.api.resource_definition) = { + type: "vpcaccess.googleapis.com/Connector" + pattern: "projects/{project}/locations/{location}/connectors/{connector}" +}; +option (google.api.resource_definition) = { + type: "eventarc.googleapis.com/Trigger" + pattern: "projects/{project}/locations/{location}/triggers/{trigger}" +}; +option (google.api.resource_definition) = { + type: "eventarc.googleapis.com/Channel" + pattern: "projects/{project}/locations/{location}/channels/{channel}" +}; +option (google.api.resource_definition) = { + type: "pubsub.googleapis.com/Topic" + pattern: "projects/{project}/topics/{topic}" +}; + +// Google Cloud Functions is used to deploy functions that are executed by +// Google in response to various events. Data connected with that event is +// passed to a function as the input data. +// +// A **function** is a resource which describes a function that should be +// executed and how it is triggered. +service FunctionService { + option (google.api.default_host) = "cloudfunctions.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Returns a function with the given name from the requested project. + rpc GetFunction(GetFunctionRequest) returns (Function) { + option (google.api.http) = { + get: "/v2beta/{name=projects/*/locations/*/functions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Returns a list of functions that belong to the requested project. + rpc ListFunctions(ListFunctionsRequest) returns (ListFunctionsResponse) { + option (google.api.http) = { + get: "/v2beta/{parent=projects/*/locations/*}/functions" + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a new function. If a function with the given name already exists in + // the specified project, the long running operation will return + // `ALREADY_EXISTS` error. + rpc CreateFunction(CreateFunctionRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2beta/{parent=projects/*/locations/*}/functions" + body: "function" + }; + option (google.api.method_signature) = "parent,function,function_id"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.functions.v2beta.Function" + metadata_type: "google.cloud.functions.v2beta.OperationMetadata" + }; + } + + // Updates existing function. + rpc UpdateFunction(UpdateFunctionRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v2beta/{function.name=projects/*/locations/*/functions/*}" + body: "function" + }; + option (google.api.method_signature) = "function,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.functions.v2beta.Function" + metadata_type: "google.cloud.functions.v2beta.OperationMetadata" + }; + } + + // Deletes a function with the given name from the specified project. If the + // given function is used by some trigger, the trigger will be updated to + // remove this function. + rpc DeleteFunction(DeleteFunctionRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v2beta/{name=projects/*/locations/*/functions/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.functions.v2beta.OperationMetadata" + }; + } + + // Returns a signed URL for uploading a function source code. + // For more information about the signed URL usage see: + // https://cloud.google.com/storage/docs/access-control/signed-urls. + // Once the function source code upload is complete, the used signed + // URL should be provided in CreateFunction or UpdateFunction request + // as a reference to the function source code. + // + // When uploading source code to the generated signed URL, please follow + // these restrictions: + // + // * Source file type should be a zip file. + // * No credentials should be attached - the signed URLs provide access to the + // target bucket using internal service identity; if credentials were + // attached, the identity from the credentials would be used, but that + // identity does not have permissions to upload files to the URL. + // + // When making a HTTP PUT request, these two headers need to be specified: + // + // * `content-type: application/zip` + // + // And this header SHOULD NOT be specified: + // + // * `Authorization: Bearer YOUR_TOKEN` + rpc GenerateUploadUrl(GenerateUploadUrlRequest) returns (GenerateUploadUrlResponse) { + option (google.api.http) = { + post: "/v2beta/{parent=projects/*/locations/*}/functions:generateUploadUrl" + body: "*" + }; + } + + // Returns a signed URL for downloading deployed function source code. + // The URL is only valid for a limited period and should be used within + // 30 minutes of generation. + // For more information about the signed URL usage see: + // https://cloud.google.com/storage/docs/access-control/signed-urls + rpc GenerateDownloadUrl(GenerateDownloadUrlRequest) returns (GenerateDownloadUrlResponse) { + option (google.api.http) = { + post: "/v2beta/{name=projects/*/locations/*/functions/*}:generateDownloadUrl" + body: "*" + }; + } + + // Returns a list of runtimes that are supported for the requested project. + rpc ListRuntimes(ListRuntimesRequest) returns (ListRuntimesResponse) { + option (google.api.http) = { + get: "/v2beta/{parent=projects/*/locations/*}/runtimes" + }; + option (google.api.method_signature) = "parent"; + } +} + +// The environment the function is hosted on. +enum Environment { + // Unspecified + ENVIRONMENT_UNSPECIFIED = 0; + + // Gen 1 + GEN_1 = 1; + + // Gen 2 + GEN_2 = 2; +} + +// Describes a Cloud Function that contains user computation executed in +// response to an event. It encapsulates function and trigger configurations. +message Function { + option (google.api.resource) = { + type: "cloudfunctions.googleapis.com/Function" + pattern: "projects/{project}/locations/{location}/functions/{function}" + plural: "functions" + singular: "function" + }; + + // Describes the current state of the function. + enum State { + // Not specified. Invalid state. + STATE_UNSPECIFIED = 0; + + // Function has been successfully deployed and is serving. + ACTIVE = 1; + + // Function deployment failed and the function is not serving. + FAILED = 2; + + // Function is being created or updated. + DEPLOYING = 3; + + // Function is being deleted. + DELETING = 4; + + // Function deployment failed and the function serving state is undefined. + // The function should be updated or deleted to move it out of this state. + UNKNOWN = 5; + } + + // A user-defined name of the function. Function names must be unique + // globally and match pattern `projects/*/locations/*/functions/*` + string name = 1; + + // Describe whether the function is gen1 or gen2. + Environment environment = 10; + + // User-provided description of a function. + string description = 2; + + // Describes the Build step of the function that builds a container from the + // given source. + BuildConfig build_config = 3; + + // Describes the Service being deployed. Currently deploys services to Cloud + // Run (fully managed). + ServiceConfig service_config = 4; + + // An Eventarc trigger managed by Google Cloud Functions that fires events in + // response to a condition in another service. + EventTrigger event_trigger = 5; + + // Output only. State of the function. + State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last update timestamp of a Cloud Function. + google.protobuf.Timestamp update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels associated with this Cloud Function. + map labels = 8; + + // Output only. State Messages for this Cloud Function. + repeated StateMessage state_messages = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Informational messages about the state of the Cloud Function or Operation. +message StateMessage { + // Severity of the state message. + enum Severity { + // Not specified. Invalid severity. + SEVERITY_UNSPECIFIED = 0; + + // ERROR-level severity. + ERROR = 1; + + // WARNING-level severity. + WARNING = 2; + + // INFO-level severity. + INFO = 3; + } + + // Severity of the state message. + Severity severity = 1; + + // One-word CamelCase type of the state message. + string type = 2; + + // The message. + string message = 3; +} + +// Location of the source in an archive file in Google Cloud Storage. +message StorageSource { + // Google Cloud Storage bucket containing the source (see + // [Bucket Name + // Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). + string bucket = 1; + + // Google Cloud Storage object containing the source. + // + // This object must be a gzipped archive file (`.tar.gz`) containing source to + // build. + string object = 2; + + // Google Cloud Storage generation for the object. If the generation is + // omitted, the latest generation will be used. + int64 generation = 3; +} + +// Location of the source in a Google Cloud Source Repository. +message RepoSource { + // A revision within the Cloud Source Repository must be specified in + // one of these ways. + oneof revision { + // Regex matching branches to build. + // + // The syntax of the regular expressions accepted is the syntax accepted by + // RE2 and described at https://github.com/google/re2/wiki/Syntax + string branch_name = 3; + + // Regex matching tags to build. + // + // The syntax of the regular expressions accepted is the syntax accepted by + // RE2 and described at https://github.com/google/re2/wiki/Syntax + string tag_name = 4; + + // Explicit commit SHA to build. + string commit_sha = 5; + } + + // ID of the project that owns the Cloud Source Repository. If omitted, the + // project ID requesting the build is assumed. + string project_id = 1; + + // Name of the Cloud Source Repository. + string repo_name = 2; + + // Directory, relative to the source root, in which to run the build. + // + // This must be a relative path. If a step's `dir` is specified and is an + // absolute path, this value is ignored for that step's execution. + // eg. helloworld (no leading slash allowed) + string dir = 6; + + // Only trigger a build if the revision regex does NOT match the revision + // regex. + bool invert_regex = 7; +} + +// The location of the function source code. +message Source { + // Location of the source. + // At least one source needs to be provided for the deployment to succeed. + oneof source { + // If provided, get the source from this location in Google Cloud Storage. + StorageSource storage_source = 1; + + // If provided, get the source from this location in a Cloud Source + // Repository. + RepoSource repo_source = 2; + } +} + +// Provenance of the source. Ways to find the original source, or verify that +// some source was used for this build. +message SourceProvenance { + // A copy of the build's `source.storage_source`, if exists, with any + // generations resolved. + StorageSource resolved_storage_source = 1; + + // A copy of the build's `source.repo_source`, if exists, with any + // revisions resolved. + RepoSource resolved_repo_source = 2; +} + +// Describes the Build step of the function that builds a container from the +// given source. +message BuildConfig { + // Output only. The Cloud Build name of the latest successful deployment of the + // function. + string build = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/Build" + } + ]; + + // The runtime in which to run the function. Required when deploying a new + // function, optional when updating an existing function. For a complete + // list of possible choices, see the + // [`gcloud` command + // reference](https://cloud.google.com/sdk/gcloud/reference/functions/deploy#--runtime). + string runtime = 2; + + // The name of the function (as defined in source code) that will be + // executed. Defaults to the resource name suffix, if not specified. For + // backward compatibility, if function with given name is not found, then the + // system will try to use function named "function". + // For Node.js this is name of a function exported by the module specified + // in `source_location`. + string entry_point = 3; + + // The location of the function source code. + Source source = 4; + + // Output only. A permanent fixed identifier for source. + SourceProvenance source_provenance = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Name of the Cloud Build Custom Worker Pool that should be used to build the + // function. The format of this field is + // `projects/{project}/locations/{region}/workerPools/{workerPool}` where + // {project} and {region} are the project id and region respectively where the + // worker pool is defined and {workerPool} is the short name of the worker + // pool. + // + // If the project id is not the same as the function, then the Cloud + // Functions Service Agent + // (service-@gcf-admin-robot.iam.gserviceaccount.com) must be + // granted the role Cloud Build Custom Workers Builder + // (roles/cloudbuild.customworkers.builder) in the project. + string worker_pool = 5 [(google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/WorkerPool" + }]; + + // User-provided build-time environment variables for the function + map environment_variables = 6; + + // Optional. User managed repository created in Artifact Registry optionally with a + // customer managed encryption key. This is the repository to which the + // function docker image will be pushed after it is built by Cloud Build. + // If unspecified, GCF will create and use a repository named 'gcf-artifacts' + // for every deployed region. + // + // It must match the pattern + // `projects/{project}/locations/{location}/repositories/{repository}`. + // + // Cross-project repositories are not supported. + // Cross-location repositories are not supported. + // Repository format must be 'DOCKER'. + string docker_repository = 7 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "artifactregistry.googleapis.com/Repository" + } + ]; +} + +// Describes the Service being deployed. +// Currently Supported : Cloud Run (fully managed). +message ServiceConfig { + // Available egress settings. + // + // This controls what traffic is diverted through the VPC Access Connector + // resource. By default PRIVATE_RANGES_ONLY will be used. + enum VpcConnectorEgressSettings { + // Unspecified. + VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED = 0; + + // Use the VPC Access Connector only for private IP space from RFC1918. + PRIVATE_RANGES_ONLY = 1; + + // Force the use of VPC Access Connector for all egress traffic from the + // function. + ALL_TRAFFIC = 2; + } + + // Available ingress settings. + // + // This controls what traffic can reach the function. + // + // If unspecified, ALLOW_ALL will be used. + enum IngressSettings { + // Unspecified. + INGRESS_SETTINGS_UNSPECIFIED = 0; + + // Allow HTTP traffic from public and private sources. + ALLOW_ALL = 1; + + // Allow HTTP traffic from only private VPC sources. + ALLOW_INTERNAL_ONLY = 2; + + // Allow HTTP traffic from private VPC sources and through GCLB. + ALLOW_INTERNAL_AND_GCLB = 3; + } + + // Output only. Name of the service associated with a Function. + // The format of this field is + // `projects/{project}/locations/{region}/services/{service}` + string service = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "run.googleapis.com/Service" + } + ]; + + // The function execution timeout. Execution is considered failed and + // can be terminated if the function is not completed at the end of the + // timeout period. Defaults to 60 seconds. + int32 timeout_seconds = 2; + + // The amount of memory available for a function. + // Defaults to 256M. Supported units are k, M, G, Mi, Gi. If no unit is + // supplied the value is interpreted as bytes. + // See + // https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go + // a full description. + string available_memory = 13; + + // Environment variables that shall be available during function execution. + map environment_variables = 4; + + // The limit on the maximum number of function instances that may coexist at a + // given time. + // + // In some cases, such as rapid traffic surges, Cloud Functions may, for a + // short period of time, create more instances than the specified max + // instances limit. If your function cannot tolerate this temporary behavior, + // you may want to factor in a safety margin and set a lower max instances + // value than your function can tolerate. + // + // See the [Max + // Instances](https://cloud.google.com/functions/docs/max-instances) Guide for + // more details. + int32 max_instance_count = 5; + + // The limit on the minimum number of function instances that may coexist at a + // given time. + // + // Function instances are kept in idle state for a short period after they + // finished executing the request to reduce cold start time for subsequent + // requests. Setting a minimum instance count will ensure that the given + // number of instances are kept running in idle state always. This can help + // with cold start times when jump in incoming request count occurs after the + // idle instance would have been stopped in the default case. + int32 min_instance_count = 12; + + // The Serverless VPC Access connector that this cloud function can connect + // to. The format of this field is `projects/*/locations/*/connectors/*`. + string vpc_connector = 6 [(google.api.resource_reference) = { + type: "vpcaccess.googleapis.com/Connector" + }]; + + // The egress settings for the connector, controlling what traffic is diverted + // through it. + VpcConnectorEgressSettings vpc_connector_egress_settings = 7; + + // The ingress settings for the function, controlling what traffic can reach + // it. + IngressSettings ingress_settings = 8; + + // Output only. URI of the Service deployed. + string uri = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The email of the service's service account. If empty, defaults to + // `{project_number}-compute@developer.gserviceaccount.com`. + string service_account_email = 10; + + // Whether 100% of traffic is routed to the latest revision. + // On CreateFunction and UpdateFunction, when set to true, the revision being + // deployed will serve 100% of traffic, ignoring any traffic split settings, + // if any. On GetFunction, true will be returned if the latest revision is + // serving 100% of traffic. + bool all_traffic_on_latest_revision = 16; + + // Secret environment variables configuration. + repeated SecretEnvVar secret_environment_variables = 17; + + // Secret volumes configuration. + repeated SecretVolume secret_volumes = 19; + + // Output only. The name of service revision. + string revision = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Configuration for a secret environment variable. It has the information +// necessary to fetch the secret value from secret manager and expose it as an +// environment variable. +message SecretEnvVar { + // Name of the environment variable. + string key = 1; + + // Project identifier (preferably project number but can also be the + // project ID) of the project that contains the secret. If not set, it is + // assumed that the secret is in the same project as the function. + string project_id = 2; + + // Name of the secret in secret manager (not the full resource name). + string secret = 3; + + // Version of the secret (version number or the string 'latest'). It is + // recommended to use a numeric version for secret environment variables as + // any updates to the secret value is not reflected until new instances + // start. + string version = 4; +} + +// Configuration for a secret volume. It has the information necessary to fetch +// the secret value from secret manager and make it available as files mounted +// at the requested paths within the application container. +message SecretVolume { + // Configuration for a single version. + message SecretVersion { + // Version of the secret (version number or the string 'latest'). It is + // preferable to use `latest` version with secret volumes as secret value + // changes are reflected immediately. + string version = 1; + + // Relative path of the file under the mount path where the secret value for + // this version will be fetched and made available. For example, setting the + // mount_path as '/etc/secrets' and path as `secret_foo` would mount the + // secret value file at `/etc/secrets/secret_foo`. + string path = 2; + } + + // The path within the container to mount the secret volume. For example, + // setting the mount_path as `/etc/secrets` would mount the secret value files + // under the `/etc/secrets` directory. This directory will also be completely + // shadowed and unavailable to mount any other secrets. + // Recommended mount path: /etc/secrets + string mount_path = 1; + + // Project identifier (preferably project number but can also be the project + // ID) of the project that contains the secret. If not set, it is + // assumed that the secret is in the same project as the function. + string project_id = 2; + + // Name of the secret in secret manager (not the full resource name). + string secret = 3; + + // List of secret versions to mount for this secret. If empty, the `latest` + // version of the secret will be made available in a file named after the + // secret under the mount point. + repeated SecretVersion versions = 4; +} + +// Describes EventTrigger, used to request events to be sent from another +// service. +message EventTrigger { + // Describes the retry policy in case of function's execution failure. + // Retried execution is charged as any other execution. + enum RetryPolicy { + // Not specified. + RETRY_POLICY_UNSPECIFIED = 0; + + // Do not retry. + RETRY_POLICY_DO_NOT_RETRY = 1; + + // Retry on any failure, retry up to 7 days with an exponential backoff + // (capped at 10 seconds). + RETRY_POLICY_RETRY = 2; + } + + // Output only. The resource name of the Eventarc trigger. The format of this field is + // `projects/{project}/locations/{region}/triggers/{trigger}`. + string trigger = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "eventarc.googleapis.com/Trigger" + } + ]; + + // The region that the trigger will be in. The trigger will only receive + // events originating in this region. It can be the same + // region as the function, a different region or multi-region, or the global + // region. If not provided, defaults to the same region as the function. + string trigger_region = 2; + + // Required. The type of event to observe. For example: + // `google.cloud.audit.log.v1.written` or + // `google.cloud.pubsub.topic.v1.messagePublished`. + string event_type = 3 [(google.api.field_behavior) = REQUIRED]; + + // Criteria used to filter events. + repeated EventFilter event_filters = 4; + + // Optional. The name of a Pub/Sub topic in the same project that will be used + // as the transport topic for the event delivery. Format: + // `projects/{project}/topics/{topic}`. + // + // This is only valid for events of type + // `google.cloud.pubsub.topic.v1.messagePublished`. The topic provided here + // will not be deleted at function deletion. + string pubsub_topic = 5 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "pubsub.googleapis.com/Topic" + } + ]; + + // Optional. The email of the trigger's service account. The service account must have + // permission to invoke Cloud Run services, the permission is + // `run.routes.invoke`. + // If empty, defaults to the Compute Engine default service account: + // `{project_number}-compute@developer.gserviceaccount.com`. + string service_account_email = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If unset, then defaults to ignoring failures (i.e. not retrying them). + RetryPolicy retry_policy = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The name of the channel associated with the trigger in + // `projects/{project}/locations/{location}/channels/{channel}` format. + // You must provide a channel to receive events from Eventarc SaaS partners. + string channel = 8 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "eventarc.googleapis.com/Channel" + } + ]; +} + +// Filters events based on exact matches on the CloudEvents attributes. +message EventFilter { + // Required. The name of a CloudEvents attribute. + string attribute = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The value for the attribute. + string value = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The operator used for matching the events with the value of the + // filter. If not specified, only events that have an exact key-value pair + // specified in the filter are matched. The only allowed value is + // `match-path-pattern`. + string operator = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for the `GetFunction` method. +message GetFunctionRequest { + // Required. The name of the function which details should be obtained. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudfunctions.googleapis.com/Function" + } + ]; +} + +// Request for the `ListFunctions` method. +message ListFunctionsRequest { + // Required. The project and location from which the function should be listed, + // specified in the format `projects/*/locations/*` + // If you want to list functions in all locations, use "-" in place of a + // location. When listing functions in all locations, if one or more + // location(s) are unreachable, the response will contain functions from all + // reachable locations along with the names of any unreachable locations. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudfunctions.googleapis.com/Function" + } + ]; + + // Maximum number of functions to return per call. + int32 page_size = 2; + + // The value returned by the last + // `ListFunctionsResponse`; indicates that + // this is a continuation of a prior `ListFunctions` call, and that the + // system should return the next page of data. + string page_token = 3; + + // The filter for Functions that match the filter expression, + // following the syntax outlined in https://google.aip.dev/160. + string filter = 4; + + // The sorting order of the resources returned. Value should be a comma + // separated list of fields. The default sorting oder is ascending. + // See https://google.aip.dev/132#ordering. + string order_by = 5; +} + +// Response for the `ListFunctions` method. +message ListFunctionsResponse { + // The functions that match the request. + repeated Function functions = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; + + // Locations that could not be reached. The response does not include any + // functions from these locations. + repeated string unreachable = 3; +} + +// Request for the `CreateFunction` method. +message CreateFunctionRequest { + // Required. The project and location in which the function should be created, specified + // in the format `projects/*/locations/*` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. Function to be created. + Function function = 2 [(google.api.field_behavior) = REQUIRED]; + + // The ID to use for the function, which will become the final component of + // the function's resource name. + // + // This value should be 4-63 characters, and valid characters + // are /[a-z][0-9]-/. + string function_id = 3; +} + +// Request for the `UpdateFunction` method. +message UpdateFunctionRequest { + // Required. New version of the function. + Function function = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. + // If no field mask is provided, all provided fields in the request will be + // updated. + google.protobuf.FieldMask update_mask = 2; +} + +// Request for the `DeleteFunction` method. +message DeleteFunctionRequest { + // Required. The name of the function which should be deleted. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudfunctions.googleapis.com/Function" + } + ]; +} + +// Request of `GenerateSourceUploadUrl` method. +message GenerateUploadUrlRequest { + // Required. The project and location in which the Google Cloud Storage signed URL + // should be generated, specified in the format `projects/*/locations/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; +} + +// Response of `GenerateSourceUploadUrl` method. +message GenerateUploadUrlResponse { + // The generated Google Cloud Storage signed URL that should be used for a + // function source code upload. The uploaded file should be a zip archive + // which contains a function. + string upload_url = 1; + + // The location of the source code in the upload bucket. + // + // Once the archive is uploaded using the `upload_url` use this field to + // set the `function.build_config.source.storage_source` + // during CreateFunction and UpdateFunction. + // + // Generation defaults to 0, as Cloud Storage provides a new generation only + // upon uploading a new object or version of an object. + StorageSource storage_source = 2; +} + +// Request of `GenerateDownloadUrl` method. +message GenerateDownloadUrlRequest { + // Required. The name of function for which source code Google Cloud Storage signed + // URL should be generated. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudfunctions.googleapis.com/Function" + } + ]; +} + +// Response of `GenerateDownloadUrl` method. +message GenerateDownloadUrlResponse { + // The generated Google Cloud Storage signed URL that should be used for + // function source code download. + string download_url = 1; +} + +// Request for the `ListRuntimes` method. +message ListRuntimesRequest { + // Required. The project and location from which the runtimes should be listed, + // specified in the format `projects/*/locations/*` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The filter for Runtimes that match the filter expression, + // following the syntax outlined in https://google.aip.dev/160. + string filter = 2; +} + +// Response for the `ListRuntimes` method. +message ListRuntimesResponse { + // Describes a runtime and any special information (e.g., deprecation status) + // related to it. + message Runtime { + // The name of the runtime, e.g., 'go113', 'nodejs12', etc. + string name = 1; + + // The user facing name, eg 'Go 1.13', 'Node.js 12', etc. + string display_name = 5; + + // The stage of life this runtime is in, e.g., BETA, GA, etc. + RuntimeStage stage = 2; + + // Warning messages, e.g., a deprecation warning. + repeated string warnings = 3; + + // The environment for the runtime. + Environment environment = 4; + } + + // The various stages that a runtime can be in. + enum RuntimeStage { + // Not specified. + RUNTIME_STAGE_UNSPECIFIED = 0; + + // The runtime is in development. + DEVELOPMENT = 1; + + // The runtime is in the Alpha stage. + ALPHA = 2; + + // The runtime is in the Beta stage. + BETA = 3; + + // The runtime is generally available. + GA = 4; + + // The runtime is deprecated. + DEPRECATED = 5; + + // The runtime is no longer supported. + DECOMMISSIONED = 6; + } + + // The runtimes that match the request. + repeated Runtime runtimes = 1; +} + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // The time the operation was created. + google.protobuf.Timestamp create_time = 1; + + // The time the operation finished running. + google.protobuf.Timestamp end_time = 2; + + // Server-defined resource path for the target of the operation. + string target = 3; + + // Name of the verb executed by the operation. + string verb = 4; + + // Human-readable status of the operation, if any. + string status_detail = 5; + + // Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`. + bool cancel_requested = 6; + + // API version used to start the operation. + string api_version = 7; + + // The original request that started the operation. + google.protobuf.Any request_resource = 8; + + // Mechanism for reporting in-progress stages + repeated Stage stages = 9; +} + +// Each Stage of the deployment process +message Stage { + // Possible names for a Stage + enum Name { + // Not specified. Invalid name. + NAME_UNSPECIFIED = 0; + + // Artifact Regsitry Stage + ARTIFACT_REGISTRY = 1; + + // Build Stage + BUILD = 2; + + // Service Stage + SERVICE = 3; + + // Trigger Stage + TRIGGER = 4; + + // Service Rollback Stage + SERVICE_ROLLBACK = 5; + + // Trigger Rollback Stage + TRIGGER_ROLLBACK = 6; + } + + // Possible states for a Stage + enum State { + // Not specified. Invalid state. + STATE_UNSPECIFIED = 0; + + // Stage has not started. + NOT_STARTED = 1; + + // Stage is in progress. + IN_PROGRESS = 2; + + // Stage has completed. + COMPLETE = 3; + } + + // Name of the Stage. This will be unique for each Stage. + Name name = 1; + + // Message describing the Stage + string message = 2; + + // Current state of the Stage + State state = 3; + + // Resource of the Stage + string resource = 4; + + // Link to the current Stage resource + string resource_uri = 5; + + // State messages from the current Stage. + repeated StateMessage state_messages = 6; +} diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/callfunction/AsyncCallFunction.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/callfunction/AsyncCallFunction.java new file mode 100644 index 00000000..8a2faafa --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/callfunction/AsyncCallFunction.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v1.samples; + +// [START functions_v1_generated_cloudfunctionsserviceclient_callfunction_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.functions.v1.CallFunctionRequest; +import com.google.cloud.functions.v1.CallFunctionResponse; +import com.google.cloud.functions.v1.CloudFunctionName; +import com.google.cloud.functions.v1.CloudFunctionsServiceClient; + +public class AsyncCallFunction { + + public static void main(String[] args) throws Exception { + asyncCallFunction(); + } + + public static void asyncCallFunction() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudFunctionsServiceClient cloudFunctionsServiceClient = + CloudFunctionsServiceClient.create()) { + CallFunctionRequest request = + CallFunctionRequest.newBuilder() + .setName(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setData("data3076010") + .build(); + ApiFuture future = + cloudFunctionsServiceClient.callFunctionCallable().futureCall(request); + // Do something. + CallFunctionResponse response = future.get(); + } + } +} +// [END functions_v1_generated_cloudfunctionsserviceclient_callfunction_async] diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/callfunction/SyncCallFunction.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/callfunction/SyncCallFunction.java new file mode 100644 index 00000000..e95ae545 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/callfunction/SyncCallFunction.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v1.samples; + +// [START functions_v1_generated_cloudfunctionsserviceclient_callfunction_sync] +import com.google.cloud.functions.v1.CallFunctionRequest; +import com.google.cloud.functions.v1.CallFunctionResponse; +import com.google.cloud.functions.v1.CloudFunctionName; +import com.google.cloud.functions.v1.CloudFunctionsServiceClient; + +public class SyncCallFunction { + + public static void main(String[] args) throws Exception { + syncCallFunction(); + } + + public static void syncCallFunction() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudFunctionsServiceClient cloudFunctionsServiceClient = + CloudFunctionsServiceClient.create()) { + CallFunctionRequest request = + CallFunctionRequest.newBuilder() + .setName(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setData("data3076010") + .build(); + CallFunctionResponse response = cloudFunctionsServiceClient.callFunction(request); + } + } +} +// [END functions_v1_generated_cloudfunctionsserviceclient_callfunction_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/callfunction/SyncCallFunctionCloudfunctionnameString.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/callfunction/SyncCallFunctionCloudfunctionnameString.java new file mode 100644 index 00000000..d6402f88 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/callfunction/SyncCallFunctionCloudfunctionnameString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v1.samples; + +// [START +// functions_v1_generated_cloudfunctionsserviceclient_callfunction_cloudfunctionnamestring_sync] +import com.google.cloud.functions.v1.CallFunctionResponse; +import com.google.cloud.functions.v1.CloudFunctionName; +import com.google.cloud.functions.v1.CloudFunctionsServiceClient; + +public class SyncCallFunctionCloudfunctionnameString { + + public static void main(String[] args) throws Exception { + syncCallFunctionCloudfunctionnameString(); + } + + public static void syncCallFunctionCloudfunctionnameString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudFunctionsServiceClient cloudFunctionsServiceClient = + CloudFunctionsServiceClient.create()) { + CloudFunctionName name = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + String data = "data3076010"; + CallFunctionResponse response = cloudFunctionsServiceClient.callFunction(name, data); + } + } +} +// [END +// functions_v1_generated_cloudfunctionsserviceclient_callfunction_cloudfunctionnamestring_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/callfunction/SyncCallFunctionStringString.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/callfunction/SyncCallFunctionStringString.java new file mode 100644 index 00000000..f873a2fe --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/callfunction/SyncCallFunctionStringString.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v1.samples; + +// [START functions_v1_generated_cloudfunctionsserviceclient_callfunction_stringstring_sync] +import com.google.cloud.functions.v1.CallFunctionResponse; +import com.google.cloud.functions.v1.CloudFunctionName; +import com.google.cloud.functions.v1.CloudFunctionsServiceClient; + +public class SyncCallFunctionStringString { + + public static void main(String[] args) throws Exception { + syncCallFunctionStringString(); + } + + public static void syncCallFunctionStringString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudFunctionsServiceClient cloudFunctionsServiceClient = + CloudFunctionsServiceClient.create()) { + String name = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString(); + String data = "data3076010"; + CallFunctionResponse response = cloudFunctionsServiceClient.callFunction(name, data); + } + } +} +// [END functions_v1_generated_cloudfunctionsserviceclient_callfunction_stringstring_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/create/SyncCreateSetCredentialsProvider.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 00000000..112bbc48 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,42 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v1.samples; + +// [START functions_v1_generated_cloudfunctionsserviceclient_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.functions.v1.CloudFunctionsServiceClient; +import com.google.cloud.functions.v1.CloudFunctionsServiceSettings; +import com.google.cloud.functions.v1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + CloudFunctionsServiceSettings cloudFunctionsServiceSettings = + CloudFunctionsServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + CloudFunctionsServiceClient cloudFunctionsServiceClient = + CloudFunctionsServiceClient.create(cloudFunctionsServiceSettings); + } +} +// [END functions_v1_generated_cloudfunctionsserviceclient_create_setcredentialsprovider_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/create/SyncCreateSetCredentialsProvider1.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 00000000..c1bdc146 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v1.samples; + +// [START functions_v1_generated_cloudfunctionsserviceclient_create_setcredentialsprovider1_sync] +import com.google.cloud.functions.v1.CloudFunctionsServiceClient; +import com.google.cloud.functions.v1.CloudFunctionsServiceSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + CloudFunctionsServiceSettings cloudFunctionsServiceSettings = + CloudFunctionsServiceSettings.newBuilder() + .setTransportChannelProvider( + CloudFunctionsServiceSettings.defaultHttpJsonTransportProviderBuilder().build()) + .build(); + CloudFunctionsServiceClient cloudFunctionsServiceClient = + CloudFunctionsServiceClient.create(cloudFunctionsServiceSettings); + } +} +// [END functions_v1_generated_cloudfunctionsserviceclient_create_setcredentialsprovider1_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/create/SyncCreateSetEndpoint.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/create/SyncCreateSetEndpoint.java new file mode 100644 index 00000000..4fc21fbd --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/create/SyncCreateSetEndpoint.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v1.samples; + +// [START functions_v1_generated_cloudfunctionsserviceclient_create_setendpoint_sync] +import com.google.cloud.functions.v1.CloudFunctionsServiceClient; +import com.google.cloud.functions.v1.CloudFunctionsServiceSettings; +import com.google.cloud.functions.v1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + CloudFunctionsServiceSettings cloudFunctionsServiceSettings = + CloudFunctionsServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + CloudFunctionsServiceClient cloudFunctionsServiceClient = + CloudFunctionsServiceClient.create(cloudFunctionsServiceSettings); + } +} +// [END functions_v1_generated_cloudfunctionsserviceclient_create_setendpoint_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/createfunction/AsyncCreateFunction.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/createfunction/AsyncCreateFunction.java new file mode 100644 index 00000000..e8835fc6 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/createfunction/AsyncCreateFunction.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v1.samples; + +// [START functions_v1_generated_cloudfunctionsserviceclient_createfunction_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.functions.v1.CloudFunction; +import com.google.cloud.functions.v1.CloudFunctionsServiceClient; +import com.google.cloud.functions.v1.CreateFunctionRequest; +import com.google.cloud.functions.v1.LocationName; +import com.google.longrunning.Operation; + +public class AsyncCreateFunction { + + public static void main(String[] args) throws Exception { + asyncCreateFunction(); + } + + public static void asyncCreateFunction() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudFunctionsServiceClient cloudFunctionsServiceClient = + CloudFunctionsServiceClient.create()) { + CreateFunctionRequest request = + CreateFunctionRequest.newBuilder() + .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setFunction(CloudFunction.newBuilder().build()) + .build(); + ApiFuture future = + cloudFunctionsServiceClient.createFunctionCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END functions_v1_generated_cloudfunctionsserviceclient_createfunction_async] diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/createfunction/AsyncCreateFunctionLRO.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/createfunction/AsyncCreateFunctionLRO.java new file mode 100644 index 00000000..2abe1b69 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/createfunction/AsyncCreateFunctionLRO.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v1.samples; + +// [START functions_v1_generated_cloudfunctionsserviceclient_createfunction_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.functions.v1.CloudFunction; +import com.google.cloud.functions.v1.CloudFunctionsServiceClient; +import com.google.cloud.functions.v1.CreateFunctionRequest; +import com.google.cloud.functions.v1.LocationName; +import com.google.cloud.functions.v1.OperationMetadataV1; + +public class AsyncCreateFunctionLRO { + + public static void main(String[] args) throws Exception { + asyncCreateFunctionLRO(); + } + + public static void asyncCreateFunctionLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudFunctionsServiceClient cloudFunctionsServiceClient = + CloudFunctionsServiceClient.create()) { + CreateFunctionRequest request = + CreateFunctionRequest.newBuilder() + .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setFunction(CloudFunction.newBuilder().build()) + .build(); + OperationFuture future = + cloudFunctionsServiceClient.createFunctionOperationCallable().futureCall(request); + // Do something. + CloudFunction response = future.get(); + } + } +} +// [END functions_v1_generated_cloudfunctionsserviceclient_createfunction_lro_async] diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/createfunction/SyncCreateFunction.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/createfunction/SyncCreateFunction.java new file mode 100644 index 00000000..612c4a60 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/createfunction/SyncCreateFunction.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v1.samples; + +// [START functions_v1_generated_cloudfunctionsserviceclient_createfunction_sync] +import com.google.cloud.functions.v1.CloudFunction; +import com.google.cloud.functions.v1.CloudFunctionsServiceClient; +import com.google.cloud.functions.v1.CreateFunctionRequest; +import com.google.cloud.functions.v1.LocationName; + +public class SyncCreateFunction { + + public static void main(String[] args) throws Exception { + syncCreateFunction(); + } + + public static void syncCreateFunction() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudFunctionsServiceClient cloudFunctionsServiceClient = + CloudFunctionsServiceClient.create()) { + CreateFunctionRequest request = + CreateFunctionRequest.newBuilder() + .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setFunction(CloudFunction.newBuilder().build()) + .build(); + CloudFunction response = cloudFunctionsServiceClient.createFunctionAsync(request).get(); + } + } +} +// [END functions_v1_generated_cloudfunctionsserviceclient_createfunction_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/createfunction/SyncCreateFunctionLocationnameCloudfunction.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/createfunction/SyncCreateFunctionLocationnameCloudfunction.java new file mode 100644 index 00000000..42f34f94 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/createfunction/SyncCreateFunctionLocationnameCloudfunction.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v1.samples; + +// [START +// functions_v1_generated_cloudfunctionsserviceclient_createfunction_locationnamecloudfunction_sync] +import com.google.cloud.functions.v1.CloudFunction; +import com.google.cloud.functions.v1.CloudFunctionsServiceClient; +import com.google.cloud.functions.v1.LocationName; + +public class SyncCreateFunctionLocationnameCloudfunction { + + public static void main(String[] args) throws Exception { + syncCreateFunctionLocationnameCloudfunction(); + } + + public static void syncCreateFunctionLocationnameCloudfunction() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudFunctionsServiceClient cloudFunctionsServiceClient = + CloudFunctionsServiceClient.create()) { + LocationName location = LocationName.of("[PROJECT]", "[LOCATION]"); + CloudFunction function = CloudFunction.newBuilder().build(); + CloudFunction response = + cloudFunctionsServiceClient.createFunctionAsync(location, function).get(); + } + } +} +// [END +// functions_v1_generated_cloudfunctionsserviceclient_createfunction_locationnamecloudfunction_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/createfunction/SyncCreateFunctionStringCloudfunction.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/createfunction/SyncCreateFunctionStringCloudfunction.java new file mode 100644 index 00000000..89770276 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/createfunction/SyncCreateFunctionStringCloudfunction.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v1.samples; + +// [START +// functions_v1_generated_cloudfunctionsserviceclient_createfunction_stringcloudfunction_sync] +import com.google.cloud.functions.v1.CloudFunction; +import com.google.cloud.functions.v1.CloudFunctionsServiceClient; +import com.google.cloud.functions.v1.LocationName; + +public class SyncCreateFunctionStringCloudfunction { + + public static void main(String[] args) throws Exception { + syncCreateFunctionStringCloudfunction(); + } + + public static void syncCreateFunctionStringCloudfunction() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudFunctionsServiceClient cloudFunctionsServiceClient = + CloudFunctionsServiceClient.create()) { + String location = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + CloudFunction function = CloudFunction.newBuilder().build(); + CloudFunction response = + cloudFunctionsServiceClient.createFunctionAsync(location, function).get(); + } + } +} +// [END functions_v1_generated_cloudfunctionsserviceclient_createfunction_stringcloudfunction_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/deletefunction/AsyncDeleteFunction.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/deletefunction/AsyncDeleteFunction.java new file mode 100644 index 00000000..82f1f4cd --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/deletefunction/AsyncDeleteFunction.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v1.samples; + +// [START functions_v1_generated_cloudfunctionsserviceclient_deletefunction_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.functions.v1.CloudFunctionName; +import com.google.cloud.functions.v1.CloudFunctionsServiceClient; +import com.google.cloud.functions.v1.DeleteFunctionRequest; +import com.google.longrunning.Operation; + +public class AsyncDeleteFunction { + + public static void main(String[] args) throws Exception { + asyncDeleteFunction(); + } + + public static void asyncDeleteFunction() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudFunctionsServiceClient cloudFunctionsServiceClient = + CloudFunctionsServiceClient.create()) { + DeleteFunctionRequest request = + DeleteFunctionRequest.newBuilder() + .setName(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .build(); + ApiFuture future = + cloudFunctionsServiceClient.deleteFunctionCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END functions_v1_generated_cloudfunctionsserviceclient_deletefunction_async] diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/deletefunction/AsyncDeleteFunctionLRO.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/deletefunction/AsyncDeleteFunctionLRO.java new file mode 100644 index 00000000..bb95e01c --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/deletefunction/AsyncDeleteFunctionLRO.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v1.samples; + +// [START functions_v1_generated_cloudfunctionsserviceclient_deletefunction_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.functions.v1.CloudFunctionName; +import com.google.cloud.functions.v1.CloudFunctionsServiceClient; +import com.google.cloud.functions.v1.DeleteFunctionRequest; +import com.google.cloud.functions.v1.OperationMetadataV1; +import com.google.protobuf.Empty; + +public class AsyncDeleteFunctionLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteFunctionLRO(); + } + + public static void asyncDeleteFunctionLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudFunctionsServiceClient cloudFunctionsServiceClient = + CloudFunctionsServiceClient.create()) { + DeleteFunctionRequest request = + DeleteFunctionRequest.newBuilder() + .setName(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .build(); + OperationFuture future = + cloudFunctionsServiceClient.deleteFunctionOperationCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END functions_v1_generated_cloudfunctionsserviceclient_deletefunction_lro_async] diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/deletefunction/SyncDeleteFunction.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/deletefunction/SyncDeleteFunction.java new file mode 100644 index 00000000..89b80149 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/deletefunction/SyncDeleteFunction.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v1.samples; + +// [START functions_v1_generated_cloudfunctionsserviceclient_deletefunction_sync] +import com.google.cloud.functions.v1.CloudFunctionName; +import com.google.cloud.functions.v1.CloudFunctionsServiceClient; +import com.google.cloud.functions.v1.DeleteFunctionRequest; + +public class SyncDeleteFunction { + + public static void main(String[] args) throws Exception { + syncDeleteFunction(); + } + + public static void syncDeleteFunction() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudFunctionsServiceClient cloudFunctionsServiceClient = + CloudFunctionsServiceClient.create()) { + DeleteFunctionRequest request = + DeleteFunctionRequest.newBuilder() + .setName(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .build(); + cloudFunctionsServiceClient.deleteFunctionAsync(request).get(); + } + } +} +// [END functions_v1_generated_cloudfunctionsserviceclient_deletefunction_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/deletefunction/SyncDeleteFunctionCloudfunctionname.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/deletefunction/SyncDeleteFunctionCloudfunctionname.java new file mode 100644 index 00000000..df111f77 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/deletefunction/SyncDeleteFunctionCloudfunctionname.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v1.samples; + +// [START functions_v1_generated_cloudfunctionsserviceclient_deletefunction_cloudfunctionname_sync] +import com.google.cloud.functions.v1.CloudFunctionName; +import com.google.cloud.functions.v1.CloudFunctionsServiceClient; + +public class SyncDeleteFunctionCloudfunctionname { + + public static void main(String[] args) throws Exception { + syncDeleteFunctionCloudfunctionname(); + } + + public static void syncDeleteFunctionCloudfunctionname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudFunctionsServiceClient cloudFunctionsServiceClient = + CloudFunctionsServiceClient.create()) { + CloudFunctionName name = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + cloudFunctionsServiceClient.deleteFunctionAsync(name).get(); + } + } +} +// [END functions_v1_generated_cloudfunctionsserviceclient_deletefunction_cloudfunctionname_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/deletefunction/SyncDeleteFunctionString.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/deletefunction/SyncDeleteFunctionString.java new file mode 100644 index 00000000..97b54cda --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/deletefunction/SyncDeleteFunctionString.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v1.samples; + +// [START functions_v1_generated_cloudfunctionsserviceclient_deletefunction_string_sync] +import com.google.cloud.functions.v1.CloudFunctionName; +import com.google.cloud.functions.v1.CloudFunctionsServiceClient; + +public class SyncDeleteFunctionString { + + public static void main(String[] args) throws Exception { + syncDeleteFunctionString(); + } + + public static void syncDeleteFunctionString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudFunctionsServiceClient cloudFunctionsServiceClient = + CloudFunctionsServiceClient.create()) { + String name = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString(); + cloudFunctionsServiceClient.deleteFunctionAsync(name).get(); + } + } +} +// [END functions_v1_generated_cloudfunctionsserviceclient_deletefunction_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/generatedownloadurl/AsyncGenerateDownloadUrl.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/generatedownloadurl/AsyncGenerateDownloadUrl.java new file mode 100644 index 00000000..f6a2b3b0 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/generatedownloadurl/AsyncGenerateDownloadUrl.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v1.samples; + +// [START functions_v1_generated_cloudfunctionsserviceclient_generatedownloadurl_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.functions.v1.CloudFunctionsServiceClient; +import com.google.cloud.functions.v1.GenerateDownloadUrlRequest; +import com.google.cloud.functions.v1.GenerateDownloadUrlResponse; + +public class AsyncGenerateDownloadUrl { + + public static void main(String[] args) throws Exception { + asyncGenerateDownloadUrl(); + } + + public static void asyncGenerateDownloadUrl() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudFunctionsServiceClient cloudFunctionsServiceClient = + CloudFunctionsServiceClient.create()) { + GenerateDownloadUrlRequest request = + GenerateDownloadUrlRequest.newBuilder() + .setName("name3373707") + .setVersionId(-670497310) + .build(); + ApiFuture future = + cloudFunctionsServiceClient.generateDownloadUrlCallable().futureCall(request); + // Do something. + GenerateDownloadUrlResponse response = future.get(); + } + } +} +// [END functions_v1_generated_cloudfunctionsserviceclient_generatedownloadurl_async] diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/generatedownloadurl/SyncGenerateDownloadUrl.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/generatedownloadurl/SyncGenerateDownloadUrl.java new file mode 100644 index 00000000..966420d2 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/generatedownloadurl/SyncGenerateDownloadUrl.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v1.samples; + +// [START functions_v1_generated_cloudfunctionsserviceclient_generatedownloadurl_sync] +import com.google.cloud.functions.v1.CloudFunctionsServiceClient; +import com.google.cloud.functions.v1.GenerateDownloadUrlRequest; +import com.google.cloud.functions.v1.GenerateDownloadUrlResponse; + +public class SyncGenerateDownloadUrl { + + public static void main(String[] args) throws Exception { + syncGenerateDownloadUrl(); + } + + public static void syncGenerateDownloadUrl() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudFunctionsServiceClient cloudFunctionsServiceClient = + CloudFunctionsServiceClient.create()) { + GenerateDownloadUrlRequest request = + GenerateDownloadUrlRequest.newBuilder() + .setName("name3373707") + .setVersionId(-670497310) + .build(); + GenerateDownloadUrlResponse response = + cloudFunctionsServiceClient.generateDownloadUrl(request); + } + } +} +// [END functions_v1_generated_cloudfunctionsserviceclient_generatedownloadurl_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/generateuploadurl/AsyncGenerateUploadUrl.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/generateuploadurl/AsyncGenerateUploadUrl.java new file mode 100644 index 00000000..ed1eb857 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/generateuploadurl/AsyncGenerateUploadUrl.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v1.samples; + +// [START functions_v1_generated_cloudfunctionsserviceclient_generateuploadurl_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.functions.v1.CloudFunctionsServiceClient; +import com.google.cloud.functions.v1.CryptoKeyName; +import com.google.cloud.functions.v1.GenerateUploadUrlRequest; +import com.google.cloud.functions.v1.GenerateUploadUrlResponse; + +public class AsyncGenerateUploadUrl { + + public static void main(String[] args) throws Exception { + asyncGenerateUploadUrl(); + } + + public static void asyncGenerateUploadUrl() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudFunctionsServiceClient cloudFunctionsServiceClient = + CloudFunctionsServiceClient.create()) { + GenerateUploadUrlRequest request = + GenerateUploadUrlRequest.newBuilder() + .setParent("parent-995424086") + .setKmsKeyName( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .build(); + ApiFuture future = + cloudFunctionsServiceClient.generateUploadUrlCallable().futureCall(request); + // Do something. + GenerateUploadUrlResponse response = future.get(); + } + } +} +// [END functions_v1_generated_cloudfunctionsserviceclient_generateuploadurl_async] diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/generateuploadurl/SyncGenerateUploadUrl.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/generateuploadurl/SyncGenerateUploadUrl.java new file mode 100644 index 00000000..f6bf1a58 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/generateuploadurl/SyncGenerateUploadUrl.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v1.samples; + +// [START functions_v1_generated_cloudfunctionsserviceclient_generateuploadurl_sync] +import com.google.cloud.functions.v1.CloudFunctionsServiceClient; +import com.google.cloud.functions.v1.CryptoKeyName; +import com.google.cloud.functions.v1.GenerateUploadUrlRequest; +import com.google.cloud.functions.v1.GenerateUploadUrlResponse; + +public class SyncGenerateUploadUrl { + + public static void main(String[] args) throws Exception { + syncGenerateUploadUrl(); + } + + public static void syncGenerateUploadUrl() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudFunctionsServiceClient cloudFunctionsServiceClient = + CloudFunctionsServiceClient.create()) { + GenerateUploadUrlRequest request = + GenerateUploadUrlRequest.newBuilder() + .setParent("parent-995424086") + .setKmsKeyName( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .build(); + GenerateUploadUrlResponse response = cloudFunctionsServiceClient.generateUploadUrl(request); + } + } +} +// [END functions_v1_generated_cloudfunctionsserviceclient_generateuploadurl_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/getfunction/AsyncGetFunction.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/getfunction/AsyncGetFunction.java new file mode 100644 index 00000000..ccd7519a --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/getfunction/AsyncGetFunction.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v1.samples; + +// [START functions_v1_generated_cloudfunctionsserviceclient_getfunction_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.functions.v1.CloudFunction; +import com.google.cloud.functions.v1.CloudFunctionName; +import com.google.cloud.functions.v1.CloudFunctionsServiceClient; +import com.google.cloud.functions.v1.GetFunctionRequest; + +public class AsyncGetFunction { + + public static void main(String[] args) throws Exception { + asyncGetFunction(); + } + + public static void asyncGetFunction() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudFunctionsServiceClient cloudFunctionsServiceClient = + CloudFunctionsServiceClient.create()) { + GetFunctionRequest request = + GetFunctionRequest.newBuilder() + .setName(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .build(); + ApiFuture future = + cloudFunctionsServiceClient.getFunctionCallable().futureCall(request); + // Do something. + CloudFunction response = future.get(); + } + } +} +// [END functions_v1_generated_cloudfunctionsserviceclient_getfunction_async] diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/getfunction/SyncGetFunction.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/getfunction/SyncGetFunction.java new file mode 100644 index 00000000..8eb801ec --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/getfunction/SyncGetFunction.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v1.samples; + +// [START functions_v1_generated_cloudfunctionsserviceclient_getfunction_sync] +import com.google.cloud.functions.v1.CloudFunction; +import com.google.cloud.functions.v1.CloudFunctionName; +import com.google.cloud.functions.v1.CloudFunctionsServiceClient; +import com.google.cloud.functions.v1.GetFunctionRequest; + +public class SyncGetFunction { + + public static void main(String[] args) throws Exception { + syncGetFunction(); + } + + public static void syncGetFunction() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudFunctionsServiceClient cloudFunctionsServiceClient = + CloudFunctionsServiceClient.create()) { + GetFunctionRequest request = + GetFunctionRequest.newBuilder() + .setName(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .build(); + CloudFunction response = cloudFunctionsServiceClient.getFunction(request); + } + } +} +// [END functions_v1_generated_cloudfunctionsserviceclient_getfunction_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/getfunction/SyncGetFunctionCloudfunctionname.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/getfunction/SyncGetFunctionCloudfunctionname.java new file mode 100644 index 00000000..d9ab0ba9 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/getfunction/SyncGetFunctionCloudfunctionname.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v1.samples; + +// [START functions_v1_generated_cloudfunctionsserviceclient_getfunction_cloudfunctionname_sync] +import com.google.cloud.functions.v1.CloudFunction; +import com.google.cloud.functions.v1.CloudFunctionName; +import com.google.cloud.functions.v1.CloudFunctionsServiceClient; + +public class SyncGetFunctionCloudfunctionname { + + public static void main(String[] args) throws Exception { + syncGetFunctionCloudfunctionname(); + } + + public static void syncGetFunctionCloudfunctionname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudFunctionsServiceClient cloudFunctionsServiceClient = + CloudFunctionsServiceClient.create()) { + CloudFunctionName name = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]"); + CloudFunction response = cloudFunctionsServiceClient.getFunction(name); + } + } +} +// [END functions_v1_generated_cloudfunctionsserviceclient_getfunction_cloudfunctionname_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/getfunction/SyncGetFunctionString.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/getfunction/SyncGetFunctionString.java new file mode 100644 index 00000000..76eabfe0 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/getfunction/SyncGetFunctionString.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v1.samples; + +// [START functions_v1_generated_cloudfunctionsserviceclient_getfunction_string_sync] +import com.google.cloud.functions.v1.CloudFunction; +import com.google.cloud.functions.v1.CloudFunctionName; +import com.google.cloud.functions.v1.CloudFunctionsServiceClient; + +public class SyncGetFunctionString { + + public static void main(String[] args) throws Exception { + syncGetFunctionString(); + } + + public static void syncGetFunctionString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudFunctionsServiceClient cloudFunctionsServiceClient = + CloudFunctionsServiceClient.create()) { + String name = CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString(); + CloudFunction response = cloudFunctionsServiceClient.getFunction(name); + } + } +} +// [END functions_v1_generated_cloudfunctionsserviceclient_getfunction_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/getiampolicy/AsyncGetIamPolicy.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/getiampolicy/AsyncGetIamPolicy.java new file mode 100644 index 00000000..cdd00f2f --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/getiampolicy/AsyncGetIamPolicy.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v1.samples; + +// [START functions_v1_generated_cloudfunctionsserviceclient_getiampolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.functions.v1.CloudFunctionName; +import com.google.cloud.functions.v1.CloudFunctionsServiceClient; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; + +public class AsyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncGetIamPolicy(); + } + + public static void asyncGetIamPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudFunctionsServiceClient cloudFunctionsServiceClient = + CloudFunctionsServiceClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + ApiFuture future = + cloudFunctionsServiceClient.getIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END functions_v1_generated_cloudfunctionsserviceclient_getiampolicy_async] diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/getiampolicy/SyncGetIamPolicy.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/getiampolicy/SyncGetIamPolicy.java new file mode 100644 index 00000000..aaadb6c2 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/getiampolicy/SyncGetIamPolicy.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v1.samples; + +// [START functions_v1_generated_cloudfunctionsserviceclient_getiampolicy_sync] +import com.google.cloud.functions.v1.CloudFunctionName; +import com.google.cloud.functions.v1.CloudFunctionsServiceClient; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; + +public class SyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + syncGetIamPolicy(); + } + + public static void syncGetIamPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudFunctionsServiceClient cloudFunctionsServiceClient = + CloudFunctionsServiceClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + Policy response = cloudFunctionsServiceClient.getIamPolicy(request); + } + } +} +// [END functions_v1_generated_cloudfunctionsserviceclient_getiampolicy_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/listfunctions/AsyncListFunctions.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/listfunctions/AsyncListFunctions.java new file mode 100644 index 00000000..390a9c77 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/listfunctions/AsyncListFunctions.java @@ -0,0 +1,52 @@ +/* + * 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.v1.samples; + +// [START functions_v1_generated_cloudfunctionsserviceclient_listfunctions_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.functions.v1.CloudFunction; +import com.google.cloud.functions.v1.CloudFunctionsServiceClient; +import com.google.cloud.functions.v1.ListFunctionsRequest; +import com.google.cloud.functions.v1.LocationName; + +public class AsyncListFunctions { + + public static void main(String[] args) throws Exception { + asyncListFunctions(); + } + + public static void asyncListFunctions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudFunctionsServiceClient cloudFunctionsServiceClient = + CloudFunctionsServiceClient.create()) { + ListFunctionsRequest request = + ListFunctionsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + cloudFunctionsServiceClient.listFunctionsPagedCallable().futureCall(request); + // Do something. + for (CloudFunction element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END functions_v1_generated_cloudfunctionsserviceclient_listfunctions_async] diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/listfunctions/AsyncListFunctionsPaged.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/listfunctions/AsyncListFunctionsPaged.java new file mode 100644 index 00000000..7aff89f9 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/listfunctions/AsyncListFunctionsPaged.java @@ -0,0 +1,60 @@ +/* + * 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.v1.samples; + +// [START functions_v1_generated_cloudfunctionsserviceclient_listfunctions_paged_async] +import com.google.cloud.functions.v1.CloudFunction; +import com.google.cloud.functions.v1.CloudFunctionsServiceClient; +import com.google.cloud.functions.v1.ListFunctionsRequest; +import com.google.cloud.functions.v1.ListFunctionsResponse; +import com.google.cloud.functions.v1.LocationName; +import com.google.common.base.Strings; + +public class AsyncListFunctionsPaged { + + public static void main(String[] args) throws Exception { + asyncListFunctionsPaged(); + } + + public static void asyncListFunctionsPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudFunctionsServiceClient cloudFunctionsServiceClient = + CloudFunctionsServiceClient.create()) { + ListFunctionsRequest request = + ListFunctionsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListFunctionsResponse response = + cloudFunctionsServiceClient.listFunctionsCallable().call(request); + for (CloudFunction element : response.getFunctionsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END functions_v1_generated_cloudfunctionsserviceclient_listfunctions_paged_async] diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/listfunctions/SyncListFunctions.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/listfunctions/SyncListFunctions.java new file mode 100644 index 00000000..d2953fdb --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/listfunctions/SyncListFunctions.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v1.samples; + +// [START functions_v1_generated_cloudfunctionsserviceclient_listfunctions_sync] +import com.google.cloud.functions.v1.CloudFunction; +import com.google.cloud.functions.v1.CloudFunctionsServiceClient; +import com.google.cloud.functions.v1.ListFunctionsRequest; +import com.google.cloud.functions.v1.LocationName; + +public class SyncListFunctions { + + public static void main(String[] args) throws Exception { + syncListFunctions(); + } + + public static void syncListFunctions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudFunctionsServiceClient cloudFunctionsServiceClient = + CloudFunctionsServiceClient.create()) { + ListFunctionsRequest request = + ListFunctionsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (CloudFunction element : + cloudFunctionsServiceClient.listFunctions(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END functions_v1_generated_cloudfunctionsserviceclient_listfunctions_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/setiampolicy/AsyncSetIamPolicy.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/setiampolicy/AsyncSetIamPolicy.java new file mode 100644 index 00000000..e268b3f3 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/setiampolicy/AsyncSetIamPolicy.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v1.samples; + +// [START functions_v1_generated_cloudfunctionsserviceclient_setiampolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.functions.v1.CloudFunctionName; +import com.google.cloud.functions.v1.CloudFunctionsServiceClient; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; + +public class AsyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncSetIamPolicy(); + } + + public static void asyncSetIamPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudFunctionsServiceClient cloudFunctionsServiceClient = + CloudFunctionsServiceClient.create()) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = + cloudFunctionsServiceClient.setIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END functions_v1_generated_cloudfunctionsserviceclient_setiampolicy_async] diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/setiampolicy/SyncSetIamPolicy.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/setiampolicy/SyncSetIamPolicy.java new file mode 100644 index 00000000..026ca914 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/setiampolicy/SyncSetIamPolicy.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v1.samples; + +// [START functions_v1_generated_cloudfunctionsserviceclient_setiampolicy_sync] +import com.google.cloud.functions.v1.CloudFunctionName; +import com.google.cloud.functions.v1.CloudFunctionsServiceClient; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.protobuf.FieldMask; + +public class SyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + syncSetIamPolicy(); + } + + public static void syncSetIamPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudFunctionsServiceClient cloudFunctionsServiceClient = + CloudFunctionsServiceClient.create()) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + Policy response = cloudFunctionsServiceClient.setIamPolicy(request); + } + } +} +// [END functions_v1_generated_cloudfunctionsserviceclient_setiampolicy_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/testiampermissions/AsyncTestIamPermissions.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/testiampermissions/AsyncTestIamPermissions.java new file mode 100644 index 00000000..00693874 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/testiampermissions/AsyncTestIamPermissions.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v1.samples; + +// [START functions_v1_generated_cloudfunctionsserviceclient_testiampermissions_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.functions.v1.CloudFunctionName; +import com.google.cloud.functions.v1.CloudFunctionsServiceClient; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import java.util.ArrayList; + +public class AsyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + asyncTestIamPermissions(); + } + + public static void asyncTestIamPermissions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudFunctionsServiceClient cloudFunctionsServiceClient = + CloudFunctionsServiceClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + ApiFuture future = + cloudFunctionsServiceClient.testIamPermissionsCallable().futureCall(request); + // Do something. + TestIamPermissionsResponse response = future.get(); + } + } +} +// [END functions_v1_generated_cloudfunctionsserviceclient_testiampermissions_async] diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/testiampermissions/SyncTestIamPermissions.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/testiampermissions/SyncTestIamPermissions.java new file mode 100644 index 00000000..2ba11f3a --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/testiampermissions/SyncTestIamPermissions.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v1.samples; + +// [START functions_v1_generated_cloudfunctionsserviceclient_testiampermissions_sync] +import com.google.cloud.functions.v1.CloudFunctionName; +import com.google.cloud.functions.v1.CloudFunctionsServiceClient; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import java.util.ArrayList; + +public class SyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + syncTestIamPermissions(); + } + + public static void syncTestIamPermissions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudFunctionsServiceClient cloudFunctionsServiceClient = + CloudFunctionsServiceClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(CloudFunctionName.of("[PROJECT]", "[LOCATION]", "[FUNCTION]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + TestIamPermissionsResponse response = cloudFunctionsServiceClient.testIamPermissions(request); + } + } +} +// [END functions_v1_generated_cloudfunctionsserviceclient_testiampermissions_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/updatefunction/AsyncUpdateFunction.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/updatefunction/AsyncUpdateFunction.java new file mode 100644 index 00000000..eeffd877 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/updatefunction/AsyncUpdateFunction.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v1.samples; + +// [START functions_v1_generated_cloudfunctionsserviceclient_updatefunction_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.functions.v1.CloudFunction; +import com.google.cloud.functions.v1.CloudFunctionsServiceClient; +import com.google.cloud.functions.v1.UpdateFunctionRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateFunction { + + public static void main(String[] args) throws Exception { + asyncUpdateFunction(); + } + + public static void asyncUpdateFunction() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudFunctionsServiceClient cloudFunctionsServiceClient = + CloudFunctionsServiceClient.create()) { + UpdateFunctionRequest request = + UpdateFunctionRequest.newBuilder() + .setFunction(CloudFunction.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = + cloudFunctionsServiceClient.updateFunctionCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END functions_v1_generated_cloudfunctionsserviceclient_updatefunction_async] diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/updatefunction/AsyncUpdateFunctionLRO.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/updatefunction/AsyncUpdateFunctionLRO.java new file mode 100644 index 00000000..3512869a --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/updatefunction/AsyncUpdateFunctionLRO.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v1.samples; + +// [START functions_v1_generated_cloudfunctionsserviceclient_updatefunction_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.functions.v1.CloudFunction; +import com.google.cloud.functions.v1.CloudFunctionsServiceClient; +import com.google.cloud.functions.v1.OperationMetadataV1; +import com.google.cloud.functions.v1.UpdateFunctionRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateFunctionLRO { + + public static void main(String[] args) throws Exception { + asyncUpdateFunctionLRO(); + } + + public static void asyncUpdateFunctionLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudFunctionsServiceClient cloudFunctionsServiceClient = + CloudFunctionsServiceClient.create()) { + UpdateFunctionRequest request = + UpdateFunctionRequest.newBuilder() + .setFunction(CloudFunction.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + OperationFuture future = + cloudFunctionsServiceClient.updateFunctionOperationCallable().futureCall(request); + // Do something. + CloudFunction response = future.get(); + } + } +} +// [END functions_v1_generated_cloudfunctionsserviceclient_updatefunction_lro_async] diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/updatefunction/SyncUpdateFunction.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/updatefunction/SyncUpdateFunction.java new file mode 100644 index 00000000..52e64c6a --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/updatefunction/SyncUpdateFunction.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v1.samples; + +// [START functions_v1_generated_cloudfunctionsserviceclient_updatefunction_sync] +import com.google.cloud.functions.v1.CloudFunction; +import com.google.cloud.functions.v1.CloudFunctionsServiceClient; +import com.google.cloud.functions.v1.UpdateFunctionRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateFunction { + + public static void main(String[] args) throws Exception { + syncUpdateFunction(); + } + + public static void syncUpdateFunction() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudFunctionsServiceClient cloudFunctionsServiceClient = + CloudFunctionsServiceClient.create()) { + UpdateFunctionRequest request = + UpdateFunctionRequest.newBuilder() + .setFunction(CloudFunction.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + CloudFunction response = cloudFunctionsServiceClient.updateFunctionAsync(request).get(); + } + } +} +// [END functions_v1_generated_cloudfunctionsserviceclient_updatefunction_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/updatefunction/SyncUpdateFunctionCloudfunction.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/updatefunction/SyncUpdateFunctionCloudfunction.java new file mode 100644 index 00000000..6affbdc0 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsserviceclient/updatefunction/SyncUpdateFunctionCloudfunction.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v1.samples; + +// [START functions_v1_generated_cloudfunctionsserviceclient_updatefunction_cloudfunction_sync] +import com.google.cloud.functions.v1.CloudFunction; +import com.google.cloud.functions.v1.CloudFunctionsServiceClient; + +public class SyncUpdateFunctionCloudfunction { + + public static void main(String[] args) throws Exception { + syncUpdateFunctionCloudfunction(); + } + + public static void syncUpdateFunctionCloudfunction() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudFunctionsServiceClient cloudFunctionsServiceClient = + CloudFunctionsServiceClient.create()) { + CloudFunction function = CloudFunction.newBuilder().build(); + CloudFunction response = cloudFunctionsServiceClient.updateFunctionAsync(function).get(); + } + } +} +// [END functions_v1_generated_cloudfunctionsserviceclient_updatefunction_cloudfunction_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsservicesettings/getfunction/SyncGetFunction.java b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsservicesettings/getfunction/SyncGetFunction.java new file mode 100644 index 00000000..a68f82ea --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v1/cloudfunctionsservicesettings/getfunction/SyncGetFunction.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v1.samples; + +// [START functions_v1_generated_cloudfunctionsservicesettings_getfunction_sync] +import com.google.cloud.functions.v1.CloudFunctionsServiceSettings; +import java.time.Duration; + +public class SyncGetFunction { + + public static void main(String[] args) throws Exception { + syncGetFunction(); + } + + public static void syncGetFunction() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + CloudFunctionsServiceSettings.Builder cloudFunctionsServiceSettingsBuilder = + CloudFunctionsServiceSettings.newBuilder(); + cloudFunctionsServiceSettingsBuilder + .getFunctionSettings() + .setRetrySettings( + cloudFunctionsServiceSettingsBuilder + .getFunctionSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + CloudFunctionsServiceSettings cloudFunctionsServiceSettings = + cloudFunctionsServiceSettingsBuilder.build(); + } +} +// [END functions_v1_generated_cloudfunctionsservicesettings_getfunction_sync] diff --git a/samples/snippets/generated/com/google/cloud/functions/v1/stub/cloudfunctionsservicestubsettings/getfunction/SyncGetFunction.java b/samples/snippets/generated/com/google/cloud/functions/v1/stub/cloudfunctionsservicestubsettings/getfunction/SyncGetFunction.java new file mode 100644 index 00000000..ce1ef95c --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/functions/v1/stub/cloudfunctionsservicestubsettings/getfunction/SyncGetFunction.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.functions.v1.stub.samples; + +// [START functions_v1_generated_cloudfunctionsservicestubsettings_getfunction_sync] +import com.google.cloud.functions.v1.stub.CloudFunctionsServiceStubSettings; +import java.time.Duration; + +public class SyncGetFunction { + + public static void main(String[] args) throws Exception { + syncGetFunction(); + } + + public static void syncGetFunction() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + CloudFunctionsServiceStubSettings.Builder cloudFunctionsServiceSettingsBuilder = + CloudFunctionsServiceStubSettings.newBuilder(); + cloudFunctionsServiceSettingsBuilder + .getFunctionSettings() + .setRetrySettings( + cloudFunctionsServiceSettingsBuilder + .getFunctionSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + CloudFunctionsServiceStubSettings cloudFunctionsServiceSettings = + cloudFunctionsServiceSettingsBuilder.build(); + } +} +// [END functions_v1_generated_cloudfunctionsservicestubsettings_getfunction_sync] diff --git a/versions.txt b/versions.txt index 026fc9ce..7b1d70ff 100644 --- a/versions.txt +++ b/versions.txt @@ -4,3 +4,7 @@ google-cloud-functions:2.4.1:2.4.2-SNAPSHOT grpc-google-cloud-functions-v1:2.4.1:2.4.2-SNAPSHOT proto-google-cloud-functions-v1:2.4.1:2.4.2-SNAPSHOT +proto-google-cloud-functions-v2beta:2.4.1:2.4.2-SNAPSHOT +proto-google-cloud-functions-v2alpha:2.4.1:2.4.2-SNAPSHOT +grpc-google-cloud-functions-v2beta:2.4.1:2.4.2-SNAPSHOT +grpc-google-cloud-functions-v2alpha:2.4.1:2.4.2-SNAPSHOT