diff --git a/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageClient.java b/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageClient.java new file mode 100644 index 0000000000..78b7fd7e08 --- /dev/null +++ b/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageClient.java @@ -0,0 +1,428 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.storage.v2; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.storage.v2.stub.StorageStub; +import com.google.storage.v2.stub.StorageStubSettings; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Manages Google Cloud Storage resources. + * + *
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 + * try (StorageClient storageClient = StorageClient.create()) { + * StartResumableWriteRequest request = + * StartResumableWriteRequest.newBuilder() + * .setWriteObjectSpec(WriteObjectSpec.newBuilder().build()) + * .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) + * .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + * .build(); + * StartResumableWriteResponse response = storageClient.startResumableWrite(request); + * } + * }+ * + *
Note: close() needs to be called on the StorageClient 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: + * + *
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 StorageSettings to create(). + * For example: + * + *
To customize credentials: + * + *
{@code + * StorageSettings storageSettings = + * StorageSettings.newBuilder() + * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + * .build(); + * StorageClient storageClient = StorageClient.create(storageSettings); + * }+ * + *
To customize the endpoint: + * + *
{@code + * StorageSettings storageSettings = StorageSettings.newBuilder().setEndpoint(myEndpoint).build(); + * StorageClient storageClient = StorageClient.create(storageSettings); + * }+ * + *
Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class StorageClient implements BackgroundResource { + private final StorageSettings settings; + private final StorageStub stub; + + /** Constructs an instance of StorageClient with default settings. */ + public static final StorageClient create() throws IOException { + return create(StorageSettings.newBuilder().build()); + } + + /** + * Constructs an instance of StorageClient, 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 StorageClient create(StorageSettings settings) throws IOException { + return new StorageClient(settings); + } + + /** + * Constructs an instance of StorageClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(StorageSettings). + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final StorageClient create(StorageStub stub) { + return new StorageClient(stub); + } + + /** + * Constructs an instance of StorageClient, 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 StorageClient(StorageSettings settings) throws IOException { + this.settings = settings; + this.stub = ((StorageStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected StorageClient(StorageStub stub) { + this.settings = null; + this.stub = stub; + } + + public final StorageSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public StorageStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Reads an object's data. + * + *
Sample code: + * + *
{@code + * try (StorageClient storageClient = StorageClient.create()) { + * ReadObjectRequest request = + * ReadObjectRequest.newBuilder() + * .setBucket("bucket-1378203158") + * .setObject("object-1023368385") + * .setGeneration(305703192) + * .setReadOffset(-715377828) + * .setReadLimit(-164298798) + * .setIfGenerationMatch(-1086241088) + * .setIfGenerationNotMatch(1475720404) + * .setIfMetagenerationMatch(1043427781) + * .setIfMetagenerationNotMatch(1025430873) + * .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) + * .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + * .setReadMask(FieldMask.newBuilder().build()) + * .build(); + * ServerStream+ */ + public final ServerStreamingCallablestream = storageClient.readObjectCallable().call(request); + * for (ReadObjectResponse response : stream) { + * // Do something when a response is received. + * } + * } + * }
An object can be written either in a single message stream or in a resumable sequence of + * message streams. To write using a single stream, the client should include in the first message + * of the stream an `WriteObjectSpec` describing the destination bucket, object, and any + * preconditions. Additionally, the final message must set 'finish_write' to true, or else it is + * an error. + * + *
For a resumable write, the client should instead call `StartResumableWrite()` and provide + * that method an `WriteObjectSpec.` They should then attach the returned `upload_id` to the first + * message of each following call to `Create`. If there is an error or the connection is broken + * during the resumable `Create()`, the client should check the status of the `Create()` by + * calling `QueryWriteStatus()` and continue writing from the returned `committed_size`. This may + * be less than the amount of data the client previously sent. + * + *
The service will not view the object as complete until the client has sent a + * `WriteObjectRequest` with `finish_write` set to `true`. Sending any requests on a stream after + * sending a request with `finish_write` set to `true` will cause an error. The client + * **should** check the response it receives to determine how much data the + * service was able to commit and whether the service views the object as complete. + * + *
Sample code: + * + *
{@code + * try (StorageClient storageClient = StorageClient.create()) { + * ApiStreamObserver+ */ + public final ClientStreamingCallableresponseObserver = + * new ApiStreamObserver () { + * {@literal @}Override + * public void onNext(WriteObjectResponse response) { + * // Do something when a response is received. + * } + * + * {@literal @}Override + * public void onError(Throwable t) { + * // Add error-handling + * } + * + * {@literal @}Override + * public void onCompleted() { + * // Do something when complete. + * } + * }; + * ApiStreamObserver requestObserver = + * storageClient.writeObject().clientStreamingCall(responseObserver); + * WriteObjectRequest request = + * WriteObjectRequest.newBuilder() + * .setWriteOffset(-1559543565) + * .setObjectChecksums(ObjectChecksums.newBuilder().build()) + * .setFinishWrite(true) + * .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) + * .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + * .build(); + * requestObserver.onNext(request); + * } + * }
Sample code: + * + *
{@code + * try (StorageClient storageClient = StorageClient.create()) { + * StartResumableWriteRequest request = + * StartResumableWriteRequest.newBuilder() + * .setWriteObjectSpec(WriteObjectSpec.newBuilder().build()) + * .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) + * .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + * .build(); + * StartResumableWriteResponse response = storageClient.startResumableWrite(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 StartResumableWriteResponse startResumableWrite(StartResumableWriteRequest request) { + return startResumableWriteCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Starts a resumable write. How long the write operation remains valid, and what happens when the + * write operation becomes invalid, are service-dependent. + * + *
Sample code: + * + *
{@code + * try (StorageClient storageClient = StorageClient.create()) { + * StartResumableWriteRequest request = + * StartResumableWriteRequest.newBuilder() + * .setWriteObjectSpec(WriteObjectSpec.newBuilder().build()) + * .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) + * .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * storageClient.startResumableWriteCallable().futureCall(request); + * // Do something. + * StartResumableWriteResponse response = future.get(); + * } + * }
If the object does not exist (i.e., the object has been deleted, or the first `Write()` has + * not yet reached the service), this method returns the error `NOT_FOUND`. + * + *
The client **may** call `QueryWriteStatus()` at any time to determine how + * much data has been processed for this object. This is useful if the client is buffering data + * and needs to know which data can be safely evicted. For any sequence of `QueryWriteStatus()` + * calls for a given object name, the sequence of returned `committed_size` values will be + * non-decreasing. + * + *
Sample code: + * + *
{@code + * try (StorageClient storageClient = StorageClient.create()) { + * String uploadId = "uploadId1563990780"; + * QueryWriteStatusResponse response = storageClient.queryWriteStatus(uploadId); + * } + * }+ * + * @param uploadId Required. The name of the resume token for the object whose write status is + * being requested. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final QueryWriteStatusResponse queryWriteStatus(String uploadId) { + QueryWriteStatusRequest request = + QueryWriteStatusRequest.newBuilder().setUploadId(uploadId).build(); + return queryWriteStatus(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Determines the `committed_size` for an object that is being written, which can then be used as + * the `write_offset` for the next `Write()` call. + * + *
If the object does not exist (i.e., the object has been deleted, or the first `Write()` has + * not yet reached the service), this method returns the error `NOT_FOUND`. + * + *
The client **may** call `QueryWriteStatus()` at any time to determine how + * much data has been processed for this object. This is useful if the client is buffering data + * and needs to know which data can be safely evicted. For any sequence of `QueryWriteStatus()` + * calls for a given object name, the sequence of returned `committed_size` values will be + * non-decreasing. + * + *
Sample code: + * + *
{@code + * try (StorageClient storageClient = StorageClient.create()) { + * QueryWriteStatusRequest request = + * QueryWriteStatusRequest.newBuilder() + * .setUploadId("uploadId1563990780") + * .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) + * .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + * .build(); + * QueryWriteStatusResponse response = storageClient.queryWriteStatus(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 QueryWriteStatusResponse queryWriteStatus(QueryWriteStatusRequest request) { + return queryWriteStatusCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Determines the `committed_size` for an object that is being written, which can then be used as + * the `write_offset` for the next `Write()` call. + * + *
If the object does not exist (i.e., the object has been deleted, or the first `Write()` has + * not yet reached the service), this method returns the error `NOT_FOUND`. + * + *
The client **may** call `QueryWriteStatus()` at any time to determine how + * much data has been processed for this object. This is useful if the client is buffering data + * and needs to know which data can be safely evicted. For any sequence of `QueryWriteStatus()` + * calls for a given object name, the sequence of returned `committed_size` values will be + * non-decreasing. + * + *
Sample code: + * + *
{@code + * try (StorageClient storageClient = StorageClient.create()) { + * QueryWriteStatusRequest request = + * QueryWriteStatusRequest.newBuilder() + * .setUploadId("uploadId1563990780") + * .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) + * .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * storageClient.queryWriteStatusCallable().futureCall(request); + * // Do something. + * QueryWriteStatusResponse response = future.get(); + * } + * }
The default instance has everything set to sensible defaults: + * + *
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 startResumableWrite to 30 seconds: + * + *
{@code + * StorageSettings.Builder storageSettingsBuilder = StorageSettings.newBuilder(); + * storageSettingsBuilder + * .startResumableWriteSettings() + * .setRetrySettings( + * storageSettingsBuilder + * .startResumableWriteSettings() + * .getRetrySettings() + * .toBuilder() + * .setTotalTimeout(Duration.ofSeconds(30)) + * .build()); + * StorageSettings storageSettings = storageSettingsBuilder.build(); + * }+ */ +@Generated("by gapic-generator-java") +public class StorageSettings extends ClientSettings
Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction ======================= StorageClient =======================
+ *
+ * Service Description: Manages Google Cloud Storage resources.
+ *
+ * Sample for StorageClient:
+ *
+ * This class is for advanced usage.
+ */
+@Generated("by gapic-generator-java")
+public class GrpcStorageCallableFactory implements GrpcStubCallableFactory {
+
+ @Override
+ public This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator-java")
+public class GrpcStorageStub extends StorageStub {
+ private static final MethodDescriptor This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator-java")
+public abstract class StorageStub implements BackgroundResource {
+
+ public ServerStreamingCallable The default instance has everything set to sensible defaults:
+ *
+ * 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 startResumableWrite to 30 seconds:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction{@code
+ * try (StorageClient storageClient = StorageClient.create()) {
+ * StartResumableWriteRequest request =
+ * StartResumableWriteRequest.newBuilder()
+ * .setWriteObjectSpec(WriteObjectSpec.newBuilder().build())
+ * .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build())
+ * .setCommonRequestParams(CommonRequestParams.newBuilder().build())
+ * .build();
+ * StartResumableWriteResponse response = storageClient.startResumableWrite(request);
+ * }
+ * }
+ */
+@Generated("by gapic-generator-java")
+package com.google.storage.v2;
+
+import javax.annotation.Generated;
diff --git a/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/GrpcStorageCallableFactory.java b/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/GrpcStorageCallableFactory.java
new file mode 100644
index 0000000000..47ef05368a
--- /dev/null
+++ b/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/GrpcStorageCallableFactory.java
@@ -0,0 +1,113 @@
+/*
+ * Copyright 2021 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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.storage.v2.stub;
+
+import com.google.api.gax.grpc.GrpcCallSettings;
+import com.google.api.gax.grpc.GrpcCallableFactory;
+import com.google.api.gax.grpc.GrpcStubCallableFactory;
+import com.google.api.gax.rpc.BatchingCallSettings;
+import com.google.api.gax.rpc.BidiStreamingCallable;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.ClientStreamingCallable;
+import com.google.api.gax.rpc.OperationCallSettings;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.PagedCallSettings;
+import com.google.api.gax.rpc.ServerStreamingCallSettings;
+import com.google.api.gax.rpc.ServerStreamingCallable;
+import com.google.api.gax.rpc.StreamingCallSettings;
+import com.google.api.gax.rpc.UnaryCallSettings;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.longrunning.Operation;
+import com.google.longrunning.stub.OperationsStub;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * gRPC callable factory implementation for the Storage service API.
+ *
+ *
+ *
+ *
+ * {@code
+ * StorageStubSettings.Builder storageSettingsBuilder = StorageStubSettings.newBuilder();
+ * storageSettingsBuilder
+ * .startResumableWriteSettings()
+ * .setRetrySettings(
+ * storageSettingsBuilder
+ * .startResumableWriteSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * StorageStubSettings storageSettings = storageSettingsBuilder.build();
+ * }
+ */
+@Generated("by gapic-generator-java")
+public class StorageStubSettings extends StubSettings
+ * Manages Google Cloud Storage resources.
+ *
+ */
+@javax.annotation.Generated(
+ value = "by gRPC proto compiler",
+ comments = "Source: google/storage/v2/storage.proto")
+public final class StorageGrpc {
+
+ private StorageGrpc() {}
+
+ public static final String SERVICE_NAME = "google.storage.v2.Storage";
+
+ // Static method descriptors that strictly reflect the proto.
+ private static volatile io.grpc.MethodDescriptor<
+ com.google.storage.v2.ReadObjectRequest, com.google.storage.v2.ReadObjectResponse>
+ getReadObjectMethod;
+
+ @io.grpc.stub.annotations.RpcMethod(
+ fullMethodName = SERVICE_NAME + '/' + "ReadObject",
+ requestType = com.google.storage.v2.ReadObjectRequest.class,
+ responseType = com.google.storage.v2.ReadObjectResponse.class,
+ methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING)
+ public static io.grpc.MethodDescriptor<
+ com.google.storage.v2.ReadObjectRequest, com.google.storage.v2.ReadObjectResponse>
+ getReadObjectMethod() {
+ io.grpc.MethodDescriptor<
+ com.google.storage.v2.ReadObjectRequest, com.google.storage.v2.ReadObjectResponse>
+ getReadObjectMethod;
+ if ((getReadObjectMethod = StorageGrpc.getReadObjectMethod) == null) {
+ synchronized (StorageGrpc.class) {
+ if ((getReadObjectMethod = StorageGrpc.getReadObjectMethod) == null) {
+ StorageGrpc.getReadObjectMethod =
+ getReadObjectMethod =
+ io.grpc.MethodDescriptor
+ .
+ * Manages Google Cloud Storage resources.
+ *
+ */
+ public abstract static class StorageImplBase implements io.grpc.BindableService {
+
+ /**
+ *
+ *
+ *
+ * Reads an object's data.
+ *
+ */
+ public void readObject(
+ com.google.storage.v2.ReadObjectRequest request,
+ io.grpc.stub.StreamObserver
+ * Stores a new object and metadata.
+ * An object can be written either in a single message stream or in a
+ * resumable sequence of message streams. To write using a single stream,
+ * the client should include in the first message of the stream an
+ * `WriteObjectSpec` describing the destination bucket, object, and any
+ * preconditions. Additionally, the final message must set 'finish_write' to
+ * true, or else it is an error.
+ * For a resumable write, the client should instead call
+ * `StartResumableWrite()` and provide that method an `WriteObjectSpec.`
+ * They should then attach the returned `upload_id` to the first message of
+ * each following call to `Create`. If there is an error or the connection is
+ * broken during the resumable `Create()`, the client should check the status
+ * of the `Create()` by calling `QueryWriteStatus()` and continue writing from
+ * the returned `committed_size`. This may be less than the amount of data the
+ * client previously sent.
+ * The service will not view the object as complete until the client has
+ * sent a `WriteObjectRequest` with `finish_write` set to `true`. Sending any
+ * requests on a stream after sending a request with `finish_write` set to
+ * `true` will cause an error. The client **should** check the response it
+ * receives to determine how much data the service was able to commit and
+ * whether the service views the object as complete.
+ *
+ */
+ public io.grpc.stub.StreamObserver
+ * Starts a resumable write. How long the write operation remains valid, and
+ * what happens when the write operation becomes invalid, are
+ * service-dependent.
+ *
+ */
+ public void startResumableWrite(
+ com.google.storage.v2.StartResumableWriteRequest request,
+ io.grpc.stub.StreamObserver
+ * Determines the `committed_size` for an object that is being written, which
+ * can then be used as the `write_offset` for the next `Write()` call.
+ * If the object does not exist (i.e., the object has been deleted, or the
+ * first `Write()` has not yet reached the service), this method returns the
+ * error `NOT_FOUND`.
+ * The client **may** call `QueryWriteStatus()` at any time to determine how
+ * much data has been processed for this object. This is useful if the
+ * client is buffering data and needs to know which data can be safely
+ * evicted. For any sequence of `QueryWriteStatus()` calls for a given
+ * object name, the sequence of returned `committed_size` values will be
+ * non-decreasing.
+ *
+ */
+ public void queryWriteStatus(
+ com.google.storage.v2.QueryWriteStatusRequest request,
+ io.grpc.stub.StreamObserver
+ * Manages Google Cloud Storage resources.
+ *
+ */
+ public static final class StorageStub extends io.grpc.stub.AbstractAsyncStub
+ * Reads an object's data.
+ *
+ */
+ public void readObject(
+ com.google.storage.v2.ReadObjectRequest request,
+ io.grpc.stub.StreamObserver
+ * Stores a new object and metadata.
+ * An object can be written either in a single message stream or in a
+ * resumable sequence of message streams. To write using a single stream,
+ * the client should include in the first message of the stream an
+ * `WriteObjectSpec` describing the destination bucket, object, and any
+ * preconditions. Additionally, the final message must set 'finish_write' to
+ * true, or else it is an error.
+ * For a resumable write, the client should instead call
+ * `StartResumableWrite()` and provide that method an `WriteObjectSpec.`
+ * They should then attach the returned `upload_id` to the first message of
+ * each following call to `Create`. If there is an error or the connection is
+ * broken during the resumable `Create()`, the client should check the status
+ * of the `Create()` by calling `QueryWriteStatus()` and continue writing from
+ * the returned `committed_size`. This may be less than the amount of data the
+ * client previously sent.
+ * The service will not view the object as complete until the client has
+ * sent a `WriteObjectRequest` with `finish_write` set to `true`. Sending any
+ * requests on a stream after sending a request with `finish_write` set to
+ * `true` will cause an error. The client **should** check the response it
+ * receives to determine how much data the service was able to commit and
+ * whether the service views the object as complete.
+ *
+ */
+ public io.grpc.stub.StreamObserver
+ * Starts a resumable write. How long the write operation remains valid, and
+ * what happens when the write operation becomes invalid, are
+ * service-dependent.
+ *
+ */
+ public void startResumableWrite(
+ com.google.storage.v2.StartResumableWriteRequest request,
+ io.grpc.stub.StreamObserver
+ * Determines the `committed_size` for an object that is being written, which
+ * can then be used as the `write_offset` for the next `Write()` call.
+ * If the object does not exist (i.e., the object has been deleted, or the
+ * first `Write()` has not yet reached the service), this method returns the
+ * error `NOT_FOUND`.
+ * The client **may** call `QueryWriteStatus()` at any time to determine how
+ * much data has been processed for this object. This is useful if the
+ * client is buffering data and needs to know which data can be safely
+ * evicted. For any sequence of `QueryWriteStatus()` calls for a given
+ * object name, the sequence of returned `committed_size` values will be
+ * non-decreasing.
+ *
+ */
+ public void queryWriteStatus(
+ com.google.storage.v2.QueryWriteStatusRequest request,
+ io.grpc.stub.StreamObserver
+ * Manages Google Cloud Storage resources.
+ *
+ */
+ public static final class StorageBlockingStub
+ extends io.grpc.stub.AbstractBlockingStub
+ * Reads an object's data.
+ *
+ */
+ public java.util.Iterator
+ * Starts a resumable write. How long the write operation remains valid, and
+ * what happens when the write operation becomes invalid, are
+ * service-dependent.
+ *
+ */
+ public com.google.storage.v2.StartResumableWriteResponse startResumableWrite(
+ com.google.storage.v2.StartResumableWriteRequest request) {
+ return io.grpc.stub.ClientCalls.blockingUnaryCall(
+ getChannel(), getStartResumableWriteMethod(), getCallOptions(), request);
+ }
+
+ /**
+ *
+ *
+ *
+ * Determines the `committed_size` for an object that is being written, which
+ * can then be used as the `write_offset` for the next `Write()` call.
+ * If the object does not exist (i.e., the object has been deleted, or the
+ * first `Write()` has not yet reached the service), this method returns the
+ * error `NOT_FOUND`.
+ * The client **may** call `QueryWriteStatus()` at any time to determine how
+ * much data has been processed for this object. This is useful if the
+ * client is buffering data and needs to know which data can be safely
+ * evicted. For any sequence of `QueryWriteStatus()` calls for a given
+ * object name, the sequence of returned `committed_size` values will be
+ * non-decreasing.
+ *
+ */
+ public com.google.storage.v2.QueryWriteStatusResponse queryWriteStatus(
+ com.google.storage.v2.QueryWriteStatusRequest request) {
+ return io.grpc.stub.ClientCalls.blockingUnaryCall(
+ getChannel(), getQueryWriteStatusMethod(), getCallOptions(), request);
+ }
+ }
+
+ /**
+ *
+ *
+ *
+ * Manages Google Cloud Storage resources.
+ *
+ */
+ public static final class StorageFutureStub
+ extends io.grpc.stub.AbstractFutureStub
+ * Starts a resumable write. How long the write operation remains valid, and
+ * what happens when the write operation becomes invalid, are
+ * service-dependent.
+ *
+ */
+ public com.google.common.util.concurrent.ListenableFuture<
+ com.google.storage.v2.StartResumableWriteResponse>
+ startResumableWrite(com.google.storage.v2.StartResumableWriteRequest request) {
+ return io.grpc.stub.ClientCalls.futureUnaryCall(
+ getChannel().newCall(getStartResumableWriteMethod(), getCallOptions()), request);
+ }
+
+ /**
+ *
+ *
+ *
+ * Determines the `committed_size` for an object that is being written, which
+ * can then be used as the `write_offset` for the next `Write()` call.
+ * If the object does not exist (i.e., the object has been deleted, or the
+ * first `Write()` has not yet reached the service), this method returns the
+ * error `NOT_FOUND`.
+ * The client **may** call `QueryWriteStatus()` at any time to determine how
+ * much data has been processed for this object. This is useful if the
+ * client is buffering data and needs to know which data can be safely
+ * evicted. For any sequence of `QueryWriteStatus()` calls for a given
+ * object name, the sequence of returned `committed_size` values will be
+ * non-decreasing.
+ *
+ */
+ public com.google.common.util.concurrent.ListenableFuture<
+ com.google.storage.v2.QueryWriteStatusResponse>
+ queryWriteStatus(com.google.storage.v2.QueryWriteStatusRequest request) {
+ return io.grpc.stub.ClientCalls.futureUnaryCall(
+ getChannel().newCall(getQueryWriteStatusMethod(), getCallOptions()), request);
+ }
+ }
+
+ private static final int METHODID_READ_OBJECT = 0;
+ private static final int METHODID_START_RESUMABLE_WRITE = 1;
+ private static final int METHODID_QUERY_WRITE_STATUS = 2;
+ private static final int METHODID_WRITE_OBJECT = 3;
+
+ private static final class MethodHandlers
+ * A bucket.
+ *
+ *
+ * Protobuf type {@code google.storage.v2.Bucket}
+ */
+public final class Bucket extends com.google.protobuf.GeneratedMessageV3
+ implements
+ // @@protoc_insertion_point(message_implements:google.storage.v2.Bucket)
+ BucketOrBuilder {
+ private static final long serialVersionUID = 0L;
+ // Use Bucket.newBuilder() to construct.
+ private Bucket(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ super(builder);
+ }
+
+ private Bucket() {
+ name_ = "";
+ bucketId_ = "";
+ project_ = "";
+ location_ = "";
+ locationType_ = "";
+ storageClass_ = "";
+ acl_ = java.util.Collections.emptyList();
+ defaultObjectAcl_ = java.util.Collections.emptyList();
+ cors_ = java.util.Collections.emptyList();
+ zoneAffinity_ = com.google.protobuf.LazyStringArrayList.EMPTY;
+ }
+
+ @java.lang.Override
+ @SuppressWarnings({"unused"})
+ protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
+ return new Bucket();
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
+ return this.unknownFields;
+ }
+
+ private Bucket(
+ 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();
+
+ bucketId_ = s;
+ break;
+ }
+ case 26:
+ {
+ java.lang.String s = input.readStringRequireUtf8();
+
+ project_ = s;
+ break;
+ }
+ case 32:
+ {
+ metageneration_ = input.readInt64();
+ break;
+ }
+ case 42:
+ {
+ java.lang.String s = input.readStringRequireUtf8();
+
+ location_ = s;
+ break;
+ }
+ case 50:
+ {
+ java.lang.String s = input.readStringRequireUtf8();
+
+ locationType_ = s;
+ break;
+ }
+ case 58:
+ {
+ java.lang.String s = input.readStringRequireUtf8();
+
+ storageClass_ = s;
+ break;
+ }
+ case 66:
+ {
+ if (!((mutable_bitField0_ & 0x00000001) != 0)) {
+ acl_ = new java.util.ArrayList
+ * When set to true, Requester Pays is enabled for this bucket.
+ *
+ *
+ * bool requester_pays = 1;
+ *
+ * @return The requesterPays.
+ */
+ boolean getRequesterPays();
+ }
+ /**
+ *
+ *
+ *
+ * Billing properties of a bucket.
+ *
+ *
+ * Protobuf type {@code google.storage.v2.Bucket.Billing}
+ */
+ public static final class Billing extends com.google.protobuf.GeneratedMessageV3
+ implements
+ // @@protoc_insertion_point(message_implements:google.storage.v2.Bucket.Billing)
+ BillingOrBuilder {
+ private static final long serialVersionUID = 0L;
+ // Use Billing.newBuilder() to construct.
+ private Billing(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ super(builder);
+ }
+
+ private Billing() {}
+
+ @java.lang.Override
+ @SuppressWarnings({"unused"})
+ protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
+ return new Billing();
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
+ return this.unknownFields;
+ }
+
+ private Billing(
+ 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:
+ {
+ requesterPays_ = input.readBool();
+ break;
+ }
+ default:
+ {
+ if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+
+ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
+ return com.google.storage.v2.StorageProto
+ .internal_static_google_storage_v2_Bucket_Billing_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.storage.v2.StorageProto
+ .internal_static_google_storage_v2_Bucket_Billing_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.storage.v2.Bucket.Billing.class,
+ com.google.storage.v2.Bucket.Billing.Builder.class);
+ }
+
+ public static final int REQUESTER_PAYS_FIELD_NUMBER = 1;
+ private boolean requesterPays_;
+ /**
+ *
+ *
+ *
+ * When set to true, Requester Pays is enabled for this bucket.
+ *
+ *
+ * bool requester_pays = 1;
+ *
+ * @return The requesterPays.
+ */
+ @java.lang.Override
+ public boolean getRequesterPays() {
+ return requesterPays_;
+ }
+
+ 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 (requesterPays_ != false) {
+ output.writeBool(1, requesterPays_);
+ }
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (requesterPays_ != false) {
+ size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, requesterPays_);
+ }
+ 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.storage.v2.Bucket.Billing)) {
+ return super.equals(obj);
+ }
+ com.google.storage.v2.Bucket.Billing other = (com.google.storage.v2.Bucket.Billing) obj;
+
+ if (getRequesterPays() != other.getRequesterPays()) 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) + REQUESTER_PAYS_FIELD_NUMBER;
+ hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRequesterPays());
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.storage.v2.Bucket.Billing parseFrom(java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.storage.v2.Bucket.Billing parseFrom(
+ java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.storage.v2.Bucket.Billing parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.storage.v2.Bucket.Billing 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.storage.v2.Bucket.Billing parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.storage.v2.Bucket.Billing parseFrom(
+ byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.storage.v2.Bucket.Billing parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.storage.v2.Bucket.Billing 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.storage.v2.Bucket.Billing parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
+ }
+
+ public static com.google.storage.v2.Bucket.Billing 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.storage.v2.Bucket.Billing parseFrom(
+ com.google.protobuf.CodedInputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.storage.v2.Bucket.Billing 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.storage.v2.Bucket.Billing 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;
+ }
+ /**
+ *
+ *
+ *
+ * Billing properties of a bucket.
+ *
+ *
+ * Protobuf type {@code google.storage.v2.Bucket.Billing}
+ */
+ public static final class Builder
+ extends com.google.protobuf.GeneratedMessageV3.Builder
+ * When set to true, Requester Pays is enabled for this bucket.
+ *
+ *
+ * bool requester_pays = 1;
+ *
+ * @return The requesterPays.
+ */
+ @java.lang.Override
+ public boolean getRequesterPays() {
+ return requesterPays_;
+ }
+ /**
+ *
+ *
+ *
+ * When set to true, Requester Pays is enabled for this bucket.
+ *
+ *
+ * bool requester_pays = 1;
+ *
+ * @param value The requesterPays to set.
+ * @return This builder for chaining.
+ */
+ public Builder setRequesterPays(boolean value) {
+
+ requesterPays_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * When set to true, Requester Pays is enabled for this bucket.
+ *
+ *
+ * bool requester_pays = 1;
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearRequesterPays() {
+
+ requesterPays_ = 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.storage.v2.Bucket.Billing)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.storage.v2.Bucket.Billing)
+ private static final com.google.storage.v2.Bucket.Billing DEFAULT_INSTANCE;
+
+ static {
+ DEFAULT_INSTANCE = new com.google.storage.v2.Bucket.Billing();
+ }
+
+ public static com.google.storage.v2.Bucket.Billing getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser
+ * The list of Origins eligible to receive CORS response headers. See
+ * [https://tools.ietf.org/html/rfc6454][RFC 6454] for more on origins.
+ * Note: "*" is permitted in the list of origins, and means "any Origin".
+ *
+ *
+ * repeated string origin = 1;
+ *
+ * @return A list containing the origin.
+ */
+ java.util.List
+ * The list of Origins eligible to receive CORS response headers. See
+ * [https://tools.ietf.org/html/rfc6454][RFC 6454] for more on origins.
+ * Note: "*" is permitted in the list of origins, and means "any Origin".
+ *
+ *
+ * repeated string origin = 1;
+ *
+ * @return The count of origin.
+ */
+ int getOriginCount();
+ /**
+ *
+ *
+ *
+ * The list of Origins eligible to receive CORS response headers. See
+ * [https://tools.ietf.org/html/rfc6454][RFC 6454] for more on origins.
+ * Note: "*" is permitted in the list of origins, and means "any Origin".
+ *
+ *
+ * repeated string origin = 1;
+ *
+ * @param index The index of the element to return.
+ * @return The origin at the given index.
+ */
+ java.lang.String getOrigin(int index);
+ /**
+ *
+ *
+ *
+ * The list of Origins eligible to receive CORS response headers. See
+ * [https://tools.ietf.org/html/rfc6454][RFC 6454] for more on origins.
+ * Note: "*" is permitted in the list of origins, and means "any Origin".
+ *
+ *
+ * repeated string origin = 1;
+ *
+ * @param index The index of the value to return.
+ * @return The bytes of the origin at the given index.
+ */
+ com.google.protobuf.ByteString getOriginBytes(int index);
+
+ /**
+ *
+ *
+ *
+ * The list of HTTP methods on which to include CORS response headers,
+ * (`GET`, `OPTIONS`, `POST`, etc) Note: "*" is permitted in the list of
+ * methods, and means "any method".
+ *
+ *
+ * repeated string method = 2;
+ *
+ * @return A list containing the method.
+ */
+ java.util.List
+ * The list of HTTP methods on which to include CORS response headers,
+ * (`GET`, `OPTIONS`, `POST`, etc) Note: "*" is permitted in the list of
+ * methods, and means "any method".
+ *
+ *
+ * repeated string method = 2;
+ *
+ * @return The count of method.
+ */
+ int getMethodCount();
+ /**
+ *
+ *
+ *
+ * The list of HTTP methods on which to include CORS response headers,
+ * (`GET`, `OPTIONS`, `POST`, etc) Note: "*" is permitted in the list of
+ * methods, and means "any method".
+ *
+ *
+ * repeated string method = 2;
+ *
+ * @param index The index of the element to return.
+ * @return The method at the given index.
+ */
+ java.lang.String getMethod(int index);
+ /**
+ *
+ *
+ *
+ * The list of HTTP methods on which to include CORS response headers,
+ * (`GET`, `OPTIONS`, `POST`, etc) Note: "*" is permitted in the list of
+ * methods, and means "any method".
+ *
+ *
+ * repeated string method = 2;
+ *
+ * @param index The index of the value to return.
+ * @return The bytes of the method at the given index.
+ */
+ com.google.protobuf.ByteString getMethodBytes(int index);
+
+ /**
+ *
+ *
+ *
+ * The list of HTTP headers other than the
+ * [https://www.w3.org/TR/cors/#simple-response-header][simple response
+ * headers] to give permission for the user-agent to share across domains.
+ *
+ *
+ * repeated string response_header = 3;
+ *
+ * @return A list containing the responseHeader.
+ */
+ java.util.List
+ * The list of HTTP headers other than the
+ * [https://www.w3.org/TR/cors/#simple-response-header][simple response
+ * headers] to give permission for the user-agent to share across domains.
+ *
+ *
+ * repeated string response_header = 3;
+ *
+ * @return The count of responseHeader.
+ */
+ int getResponseHeaderCount();
+ /**
+ *
+ *
+ *
+ * The list of HTTP headers other than the
+ * [https://www.w3.org/TR/cors/#simple-response-header][simple response
+ * headers] to give permission for the user-agent to share across domains.
+ *
+ *
+ * repeated string response_header = 3;
+ *
+ * @param index The index of the element to return.
+ * @return The responseHeader at the given index.
+ */
+ java.lang.String getResponseHeader(int index);
+ /**
+ *
+ *
+ *
+ * The list of HTTP headers other than the
+ * [https://www.w3.org/TR/cors/#simple-response-header][simple response
+ * headers] to give permission for the user-agent to share across domains.
+ *
+ *
+ * repeated string response_header = 3;
+ *
+ * @param index The index of the value to return.
+ * @return The bytes of the responseHeader at the given index.
+ */
+ com.google.protobuf.ByteString getResponseHeaderBytes(int index);
+
+ /**
+ *
+ *
+ *
+ * The value, in seconds, to return in the
+ * [https://www.w3.org/TR/cors/#access-control-max-age-response-header][Access-Control-Max-Age
+ * header] used in preflight responses.
+ *
+ *
+ * int32 max_age_seconds = 4;
+ *
+ * @return The maxAgeSeconds.
+ */
+ int getMaxAgeSeconds();
+ }
+ /**
+ *
+ *
+ *
+ * Cross-Origin Response sharing (CORS) properties for a bucket.
+ * For more on Cloud Storage and CORS, see
+ * https://cloud.google.com/storage/docs/cross-origin.
+ * For more on CORS in general, see https://tools.ietf.org/html/rfc6454.
+ *
+ *
+ * Protobuf type {@code google.storage.v2.Bucket.Cors}
+ */
+ public static final class Cors extends com.google.protobuf.GeneratedMessageV3
+ implements
+ // @@protoc_insertion_point(message_implements:google.storage.v2.Bucket.Cors)
+ CorsOrBuilder {
+ private static final long serialVersionUID = 0L;
+ // Use Cors.newBuilder() to construct.
+ private Cors(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ super(builder);
+ }
+
+ private Cors() {
+ origin_ = com.google.protobuf.LazyStringArrayList.EMPTY;
+ method_ = com.google.protobuf.LazyStringArrayList.EMPTY;
+ responseHeader_ = com.google.protobuf.LazyStringArrayList.EMPTY;
+ }
+
+ @java.lang.Override
+ @SuppressWarnings({"unused"})
+ protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
+ return new Cors();
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
+ return this.unknownFields;
+ }
+
+ private Cors(
+ 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();
+ if (!((mutable_bitField0_ & 0x00000001) != 0)) {
+ origin_ = new com.google.protobuf.LazyStringArrayList();
+ mutable_bitField0_ |= 0x00000001;
+ }
+ origin_.add(s);
+ break;
+ }
+ case 18:
+ {
+ java.lang.String s = input.readStringRequireUtf8();
+ if (!((mutable_bitField0_ & 0x00000002) != 0)) {
+ method_ = new com.google.protobuf.LazyStringArrayList();
+ mutable_bitField0_ |= 0x00000002;
+ }
+ method_.add(s);
+ break;
+ }
+ case 26:
+ {
+ java.lang.String s = input.readStringRequireUtf8();
+ if (!((mutable_bitField0_ & 0x00000004) != 0)) {
+ responseHeader_ = new com.google.protobuf.LazyStringArrayList();
+ mutable_bitField0_ |= 0x00000004;
+ }
+ responseHeader_.add(s);
+ break;
+ }
+ case 32:
+ {
+ maxAgeSeconds_ = input.readInt32();
+ break;
+ }
+ default:
+ {
+ if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
+ } finally {
+ if (((mutable_bitField0_ & 0x00000001) != 0)) {
+ origin_ = origin_.getUnmodifiableView();
+ }
+ if (((mutable_bitField0_ & 0x00000002) != 0)) {
+ method_ = method_.getUnmodifiableView();
+ }
+ if (((mutable_bitField0_ & 0x00000004) != 0)) {
+ responseHeader_ = responseHeader_.getUnmodifiableView();
+ }
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+
+ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
+ return com.google.storage.v2.StorageProto
+ .internal_static_google_storage_v2_Bucket_Cors_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.storage.v2.StorageProto
+ .internal_static_google_storage_v2_Bucket_Cors_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.storage.v2.Bucket.Cors.class,
+ com.google.storage.v2.Bucket.Cors.Builder.class);
+ }
+
+ public static final int ORIGIN_FIELD_NUMBER = 1;
+ private com.google.protobuf.LazyStringList origin_;
+ /**
+ *
+ *
+ *
+ * The list of Origins eligible to receive CORS response headers. See
+ * [https://tools.ietf.org/html/rfc6454][RFC 6454] for more on origins.
+ * Note: "*" is permitted in the list of origins, and means "any Origin".
+ *
+ *
+ * repeated string origin = 1;
+ *
+ * @return A list containing the origin.
+ */
+ public com.google.protobuf.ProtocolStringList getOriginList() {
+ return origin_;
+ }
+ /**
+ *
+ *
+ *
+ * The list of Origins eligible to receive CORS response headers. See
+ * [https://tools.ietf.org/html/rfc6454][RFC 6454] for more on origins.
+ * Note: "*" is permitted in the list of origins, and means "any Origin".
+ *
+ *
+ * repeated string origin = 1;
+ *
+ * @return The count of origin.
+ */
+ public int getOriginCount() {
+ return origin_.size();
+ }
+ /**
+ *
+ *
+ *
+ * The list of Origins eligible to receive CORS response headers. See
+ * [https://tools.ietf.org/html/rfc6454][RFC 6454] for more on origins.
+ * Note: "*" is permitted in the list of origins, and means "any Origin".
+ *
+ *
+ * repeated string origin = 1;
+ *
+ * @param index The index of the element to return.
+ * @return The origin at the given index.
+ */
+ public java.lang.String getOrigin(int index) {
+ return origin_.get(index);
+ }
+ /**
+ *
+ *
+ *
+ * The list of Origins eligible to receive CORS response headers. See
+ * [https://tools.ietf.org/html/rfc6454][RFC 6454] for more on origins.
+ * Note: "*" is permitted in the list of origins, and means "any Origin".
+ *
+ *
+ * repeated string origin = 1;
+ *
+ * @param index The index of the value to return.
+ * @return The bytes of the origin at the given index.
+ */
+ public com.google.protobuf.ByteString getOriginBytes(int index) {
+ return origin_.getByteString(index);
+ }
+
+ public static final int METHOD_FIELD_NUMBER = 2;
+ private com.google.protobuf.LazyStringList method_;
+ /**
+ *
+ *
+ *
+ * The list of HTTP methods on which to include CORS response headers,
+ * (`GET`, `OPTIONS`, `POST`, etc) Note: "*" is permitted in the list of
+ * methods, and means "any method".
+ *
+ *
+ * repeated string method = 2;
+ *
+ * @return A list containing the method.
+ */
+ public com.google.protobuf.ProtocolStringList getMethodList() {
+ return method_;
+ }
+ /**
+ *
+ *
+ *
+ * The list of HTTP methods on which to include CORS response headers,
+ * (`GET`, `OPTIONS`, `POST`, etc) Note: "*" is permitted in the list of
+ * methods, and means "any method".
+ *
+ *
+ * repeated string method = 2;
+ *
+ * @return The count of method.
+ */
+ public int getMethodCount() {
+ return method_.size();
+ }
+ /**
+ *
+ *
+ *
+ * The list of HTTP methods on which to include CORS response headers,
+ * (`GET`, `OPTIONS`, `POST`, etc) Note: "*" is permitted in the list of
+ * methods, and means "any method".
+ *
+ *
+ * repeated string method = 2;
+ *
+ * @param index The index of the element to return.
+ * @return The method at the given index.
+ */
+ public java.lang.String getMethod(int index) {
+ return method_.get(index);
+ }
+ /**
+ *
+ *
+ *
+ * The list of HTTP methods on which to include CORS response headers,
+ * (`GET`, `OPTIONS`, `POST`, etc) Note: "*" is permitted in the list of
+ * methods, and means "any method".
+ *
+ *
+ * repeated string method = 2;
+ *
+ * @param index The index of the value to return.
+ * @return The bytes of the method at the given index.
+ */
+ public com.google.protobuf.ByteString getMethodBytes(int index) {
+ return method_.getByteString(index);
+ }
+
+ public static final int RESPONSE_HEADER_FIELD_NUMBER = 3;
+ private com.google.protobuf.LazyStringList responseHeader_;
+ /**
+ *
+ *
+ *
+ * The list of HTTP headers other than the
+ * [https://www.w3.org/TR/cors/#simple-response-header][simple response
+ * headers] to give permission for the user-agent to share across domains.
+ *
+ *
+ * repeated string response_header = 3;
+ *
+ * @return A list containing the responseHeader.
+ */
+ public com.google.protobuf.ProtocolStringList getResponseHeaderList() {
+ return responseHeader_;
+ }
+ /**
+ *
+ *
+ *
+ * The list of HTTP headers other than the
+ * [https://www.w3.org/TR/cors/#simple-response-header][simple response
+ * headers] to give permission for the user-agent to share across domains.
+ *
+ *
+ * repeated string response_header = 3;
+ *
+ * @return The count of responseHeader.
+ */
+ public int getResponseHeaderCount() {
+ return responseHeader_.size();
+ }
+ /**
+ *
+ *
+ *
+ * The list of HTTP headers other than the
+ * [https://www.w3.org/TR/cors/#simple-response-header][simple response
+ * headers] to give permission for the user-agent to share across domains.
+ *
+ *
+ * repeated string response_header = 3;
+ *
+ * @param index The index of the element to return.
+ * @return The responseHeader at the given index.
+ */
+ public java.lang.String getResponseHeader(int index) {
+ return responseHeader_.get(index);
+ }
+ /**
+ *
+ *
+ *
+ * The list of HTTP headers other than the
+ * [https://www.w3.org/TR/cors/#simple-response-header][simple response
+ * headers] to give permission for the user-agent to share across domains.
+ *
+ *
+ * repeated string response_header = 3;
+ *
+ * @param index The index of the value to return.
+ * @return The bytes of the responseHeader at the given index.
+ */
+ public com.google.protobuf.ByteString getResponseHeaderBytes(int index) {
+ return responseHeader_.getByteString(index);
+ }
+
+ public static final int MAX_AGE_SECONDS_FIELD_NUMBER = 4;
+ private int maxAgeSeconds_;
+ /**
+ *
+ *
+ *
+ * The value, in seconds, to return in the
+ * [https://www.w3.org/TR/cors/#access-control-max-age-response-header][Access-Control-Max-Age
+ * header] used in preflight responses.
+ *
+ *
+ * int32 max_age_seconds = 4;
+ *
+ * @return The maxAgeSeconds.
+ */
+ @java.lang.Override
+ public int getMaxAgeSeconds() {
+ return maxAgeSeconds_;
+ }
+
+ 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 < origin_.size(); i++) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 1, origin_.getRaw(i));
+ }
+ for (int i = 0; i < method_.size(); i++) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 2, method_.getRaw(i));
+ }
+ for (int i = 0; i < responseHeader_.size(); i++) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 3, responseHeader_.getRaw(i));
+ }
+ if (maxAgeSeconds_ != 0) {
+ output.writeInt32(4, maxAgeSeconds_);
+ }
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ {
+ int dataSize = 0;
+ for (int i = 0; i < origin_.size(); i++) {
+ dataSize += computeStringSizeNoTag(origin_.getRaw(i));
+ }
+ size += dataSize;
+ size += 1 * getOriginList().size();
+ }
+ {
+ int dataSize = 0;
+ for (int i = 0; i < method_.size(); i++) {
+ dataSize += computeStringSizeNoTag(method_.getRaw(i));
+ }
+ size += dataSize;
+ size += 1 * getMethodList().size();
+ }
+ {
+ int dataSize = 0;
+ for (int i = 0; i < responseHeader_.size(); i++) {
+ dataSize += computeStringSizeNoTag(responseHeader_.getRaw(i));
+ }
+ size += dataSize;
+ size += 1 * getResponseHeaderList().size();
+ }
+ if (maxAgeSeconds_ != 0) {
+ size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, maxAgeSeconds_);
+ }
+ 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.storage.v2.Bucket.Cors)) {
+ return super.equals(obj);
+ }
+ com.google.storage.v2.Bucket.Cors other = (com.google.storage.v2.Bucket.Cors) obj;
+
+ if (!getOriginList().equals(other.getOriginList())) return false;
+ if (!getMethodList().equals(other.getMethodList())) return false;
+ if (!getResponseHeaderList().equals(other.getResponseHeaderList())) return false;
+ if (getMaxAgeSeconds() != other.getMaxAgeSeconds()) 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 (getOriginCount() > 0) {
+ hash = (37 * hash) + ORIGIN_FIELD_NUMBER;
+ hash = (53 * hash) + getOriginList().hashCode();
+ }
+ if (getMethodCount() > 0) {
+ hash = (37 * hash) + METHOD_FIELD_NUMBER;
+ hash = (53 * hash) + getMethodList().hashCode();
+ }
+ if (getResponseHeaderCount() > 0) {
+ hash = (37 * hash) + RESPONSE_HEADER_FIELD_NUMBER;
+ hash = (53 * hash) + getResponseHeaderList().hashCode();
+ }
+ hash = (37 * hash) + MAX_AGE_SECONDS_FIELD_NUMBER;
+ hash = (53 * hash) + getMaxAgeSeconds();
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.storage.v2.Bucket.Cors parseFrom(java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.storage.v2.Bucket.Cors parseFrom(
+ java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.storage.v2.Bucket.Cors parseFrom(com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.storage.v2.Bucket.Cors 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.storage.v2.Bucket.Cors parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.storage.v2.Bucket.Cors parseFrom(
+ byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.storage.v2.Bucket.Cors parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.storage.v2.Bucket.Cors 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.storage.v2.Bucket.Cors parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
+ }
+
+ public static com.google.storage.v2.Bucket.Cors 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.storage.v2.Bucket.Cors parseFrom(
+ com.google.protobuf.CodedInputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.storage.v2.Bucket.Cors 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.storage.v2.Bucket.Cors 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;
+ }
+ /**
+ *
+ *
+ *
+ * Cross-Origin Response sharing (CORS) properties for a bucket.
+ * For more on Cloud Storage and CORS, see
+ * https://cloud.google.com/storage/docs/cross-origin.
+ * For more on CORS in general, see https://tools.ietf.org/html/rfc6454.
+ *
+ *
+ * Protobuf type {@code google.storage.v2.Bucket.Cors}
+ */
+ public static final class Builder
+ extends com.google.protobuf.GeneratedMessageV3.Builder
+ * The list of Origins eligible to receive CORS response headers. See
+ * [https://tools.ietf.org/html/rfc6454][RFC 6454] for more on origins.
+ * Note: "*" is permitted in the list of origins, and means "any Origin".
+ *
+ *
+ * repeated string origin = 1;
+ *
+ * @return A list containing the origin.
+ */
+ public com.google.protobuf.ProtocolStringList getOriginList() {
+ return origin_.getUnmodifiableView();
+ }
+ /**
+ *
+ *
+ *
+ * The list of Origins eligible to receive CORS response headers. See
+ * [https://tools.ietf.org/html/rfc6454][RFC 6454] for more on origins.
+ * Note: "*" is permitted in the list of origins, and means "any Origin".
+ *
+ *
+ * repeated string origin = 1;
+ *
+ * @return The count of origin.
+ */
+ public int getOriginCount() {
+ return origin_.size();
+ }
+ /**
+ *
+ *
+ *
+ * The list of Origins eligible to receive CORS response headers. See
+ * [https://tools.ietf.org/html/rfc6454][RFC 6454] for more on origins.
+ * Note: "*" is permitted in the list of origins, and means "any Origin".
+ *
+ *
+ * repeated string origin = 1;
+ *
+ * @param index The index of the element to return.
+ * @return The origin at the given index.
+ */
+ public java.lang.String getOrigin(int index) {
+ return origin_.get(index);
+ }
+ /**
+ *
+ *
+ *
+ * The list of Origins eligible to receive CORS response headers. See
+ * [https://tools.ietf.org/html/rfc6454][RFC 6454] for more on origins.
+ * Note: "*" is permitted in the list of origins, and means "any Origin".
+ *
+ *
+ * repeated string origin = 1;
+ *
+ * @param index The index of the value to return.
+ * @return The bytes of the origin at the given index.
+ */
+ public com.google.protobuf.ByteString getOriginBytes(int index) {
+ return origin_.getByteString(index);
+ }
+ /**
+ *
+ *
+ *
+ * The list of Origins eligible to receive CORS response headers. See
+ * [https://tools.ietf.org/html/rfc6454][RFC 6454] for more on origins.
+ * Note: "*" is permitted in the list of origins, and means "any Origin".
+ *
+ *
+ * repeated string origin = 1;
+ *
+ * @param index The index to set the value at.
+ * @param value The origin to set.
+ * @return This builder for chaining.
+ */
+ public Builder setOrigin(int index, java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureOriginIsMutable();
+ origin_.set(index, value);
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * The list of Origins eligible to receive CORS response headers. See
+ * [https://tools.ietf.org/html/rfc6454][RFC 6454] for more on origins.
+ * Note: "*" is permitted in the list of origins, and means "any Origin".
+ *
+ *
+ * repeated string origin = 1;
+ *
+ * @param value The origin to add.
+ * @return This builder for chaining.
+ */
+ public Builder addOrigin(java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureOriginIsMutable();
+ origin_.add(value);
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * The list of Origins eligible to receive CORS response headers. See
+ * [https://tools.ietf.org/html/rfc6454][RFC 6454] for more on origins.
+ * Note: "*" is permitted in the list of origins, and means "any Origin".
+ *
+ *
+ * repeated string origin = 1;
+ *
+ * @param values The origin to add.
+ * @return This builder for chaining.
+ */
+ public Builder addAllOrigin(java.lang.Iterable
+ * The list of Origins eligible to receive CORS response headers. See
+ * [https://tools.ietf.org/html/rfc6454][RFC 6454] for more on origins.
+ * Note: "*" is permitted in the list of origins, and means "any Origin".
+ *
+ *
+ * repeated string origin = 1;
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearOrigin() {
+ origin_ = com.google.protobuf.LazyStringArrayList.EMPTY;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * The list of Origins eligible to receive CORS response headers. See
+ * [https://tools.ietf.org/html/rfc6454][RFC 6454] for more on origins.
+ * Note: "*" is permitted in the list of origins, and means "any Origin".
+ *
+ *
+ * repeated string origin = 1;
+ *
+ * @param value The bytes of the origin to add.
+ * @return This builder for chaining.
+ */
+ public Builder addOriginBytes(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+ ensureOriginIsMutable();
+ origin_.add(value);
+ onChanged();
+ return this;
+ }
+
+ private com.google.protobuf.LazyStringList method_ =
+ com.google.protobuf.LazyStringArrayList.EMPTY;
+
+ private void ensureMethodIsMutable() {
+ if (!((bitField0_ & 0x00000002) != 0)) {
+ method_ = new com.google.protobuf.LazyStringArrayList(method_);
+ bitField0_ |= 0x00000002;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * The list of HTTP methods on which to include CORS response headers,
+ * (`GET`, `OPTIONS`, `POST`, etc) Note: "*" is permitted in the list of
+ * methods, and means "any method".
+ *
+ *
+ * repeated string method = 2;
+ *
+ * @return A list containing the method.
+ */
+ public com.google.protobuf.ProtocolStringList getMethodList() {
+ return method_.getUnmodifiableView();
+ }
+ /**
+ *
+ *
+ *
+ * The list of HTTP methods on which to include CORS response headers,
+ * (`GET`, `OPTIONS`, `POST`, etc) Note: "*" is permitted in the list of
+ * methods, and means "any method".
+ *
+ *
+ * repeated string method = 2;
+ *
+ * @return The count of method.
+ */
+ public int getMethodCount() {
+ return method_.size();
+ }
+ /**
+ *
+ *
+ *
+ * The list of HTTP methods on which to include CORS response headers,
+ * (`GET`, `OPTIONS`, `POST`, etc) Note: "*" is permitted in the list of
+ * methods, and means "any method".
+ *
+ *
+ * repeated string method = 2;
+ *
+ * @param index The index of the element to return.
+ * @return The method at the given index.
+ */
+ public java.lang.String getMethod(int index) {
+ return method_.get(index);
+ }
+ /**
+ *
+ *
+ *
+ * The list of HTTP methods on which to include CORS response headers,
+ * (`GET`, `OPTIONS`, `POST`, etc) Note: "*" is permitted in the list of
+ * methods, and means "any method".
+ *
+ *
+ * repeated string method = 2;
+ *
+ * @param index The index of the value to return.
+ * @return The bytes of the method at the given index.
+ */
+ public com.google.protobuf.ByteString getMethodBytes(int index) {
+ return method_.getByteString(index);
+ }
+ /**
+ *
+ *
+ *
+ * The list of HTTP methods on which to include CORS response headers,
+ * (`GET`, `OPTIONS`, `POST`, etc) Note: "*" is permitted in the list of
+ * methods, and means "any method".
+ *
+ *
+ * repeated string method = 2;
+ *
+ * @param index The index to set the value at.
+ * @param value The method to set.
+ * @return This builder for chaining.
+ */
+ public Builder setMethod(int index, java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureMethodIsMutable();
+ method_.set(index, value);
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * The list of HTTP methods on which to include CORS response headers,
+ * (`GET`, `OPTIONS`, `POST`, etc) Note: "*" is permitted in the list of
+ * methods, and means "any method".
+ *
+ *
+ * repeated string method = 2;
+ *
+ * @param value The method to add.
+ * @return This builder for chaining.
+ */
+ public Builder addMethod(java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureMethodIsMutable();
+ method_.add(value);
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * The list of HTTP methods on which to include CORS response headers,
+ * (`GET`, `OPTIONS`, `POST`, etc) Note: "*" is permitted in the list of
+ * methods, and means "any method".
+ *
+ *
+ * repeated string method = 2;
+ *
+ * @param values The method to add.
+ * @return This builder for chaining.
+ */
+ public Builder addAllMethod(java.lang.Iterable
+ * The list of HTTP methods on which to include CORS response headers,
+ * (`GET`, `OPTIONS`, `POST`, etc) Note: "*" is permitted in the list of
+ * methods, and means "any method".
+ *
+ *
+ * repeated string method = 2;
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearMethod() {
+ method_ = com.google.protobuf.LazyStringArrayList.EMPTY;
+ bitField0_ = (bitField0_ & ~0x00000002);
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * The list of HTTP methods on which to include CORS response headers,
+ * (`GET`, `OPTIONS`, `POST`, etc) Note: "*" is permitted in the list of
+ * methods, and means "any method".
+ *
+ *
+ * repeated string method = 2;
+ *
+ * @param value The bytes of the method to add.
+ * @return This builder for chaining.
+ */
+ public Builder addMethodBytes(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+ ensureMethodIsMutable();
+ method_.add(value);
+ onChanged();
+ return this;
+ }
+
+ private com.google.protobuf.LazyStringList responseHeader_ =
+ com.google.protobuf.LazyStringArrayList.EMPTY;
+
+ private void ensureResponseHeaderIsMutable() {
+ if (!((bitField0_ & 0x00000004) != 0)) {
+ responseHeader_ = new com.google.protobuf.LazyStringArrayList(responseHeader_);
+ bitField0_ |= 0x00000004;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * The list of HTTP headers other than the
+ * [https://www.w3.org/TR/cors/#simple-response-header][simple response
+ * headers] to give permission for the user-agent to share across domains.
+ *
+ *
+ * repeated string response_header = 3;
+ *
+ * @return A list containing the responseHeader.
+ */
+ public com.google.protobuf.ProtocolStringList getResponseHeaderList() {
+ return responseHeader_.getUnmodifiableView();
+ }
+ /**
+ *
+ *
+ *
+ * The list of HTTP headers other than the
+ * [https://www.w3.org/TR/cors/#simple-response-header][simple response
+ * headers] to give permission for the user-agent to share across domains.
+ *
+ *
+ * repeated string response_header = 3;
+ *
+ * @return The count of responseHeader.
+ */
+ public int getResponseHeaderCount() {
+ return responseHeader_.size();
+ }
+ /**
+ *
+ *
+ *
+ * The list of HTTP headers other than the
+ * [https://www.w3.org/TR/cors/#simple-response-header][simple response
+ * headers] to give permission for the user-agent to share across domains.
+ *
+ *
+ * repeated string response_header = 3;
+ *
+ * @param index The index of the element to return.
+ * @return The responseHeader at the given index.
+ */
+ public java.lang.String getResponseHeader(int index) {
+ return responseHeader_.get(index);
+ }
+ /**
+ *
+ *
+ *
+ * The list of HTTP headers other than the
+ * [https://www.w3.org/TR/cors/#simple-response-header][simple response
+ * headers] to give permission for the user-agent to share across domains.
+ *
+ *
+ * repeated string response_header = 3;
+ *
+ * @param index The index of the value to return.
+ * @return The bytes of the responseHeader at the given index.
+ */
+ public com.google.protobuf.ByteString getResponseHeaderBytes(int index) {
+ return responseHeader_.getByteString(index);
+ }
+ /**
+ *
+ *
+ *
+ * The list of HTTP headers other than the
+ * [https://www.w3.org/TR/cors/#simple-response-header][simple response
+ * headers] to give permission for the user-agent to share across domains.
+ *
+ *
+ * repeated string response_header = 3;
+ *
+ * @param index The index to set the value at.
+ * @param value The responseHeader to set.
+ * @return This builder for chaining.
+ */
+ public Builder setResponseHeader(int index, java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureResponseHeaderIsMutable();
+ responseHeader_.set(index, value);
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * The list of HTTP headers other than the
+ * [https://www.w3.org/TR/cors/#simple-response-header][simple response
+ * headers] to give permission for the user-agent to share across domains.
+ *
+ *
+ * repeated string response_header = 3;
+ *
+ * @param value The responseHeader to add.
+ * @return This builder for chaining.
+ */
+ public Builder addResponseHeader(java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureResponseHeaderIsMutable();
+ responseHeader_.add(value);
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * The list of HTTP headers other than the
+ * [https://www.w3.org/TR/cors/#simple-response-header][simple response
+ * headers] to give permission for the user-agent to share across domains.
+ *
+ *
+ * repeated string response_header = 3;
+ *
+ * @param values The responseHeader to add.
+ * @return This builder for chaining.
+ */
+ public Builder addAllResponseHeader(java.lang.Iterable
+ * The list of HTTP headers other than the
+ * [https://www.w3.org/TR/cors/#simple-response-header][simple response
+ * headers] to give permission for the user-agent to share across domains.
+ *
+ *
+ * repeated string response_header = 3;
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearResponseHeader() {
+ responseHeader_ = com.google.protobuf.LazyStringArrayList.EMPTY;
+ bitField0_ = (bitField0_ & ~0x00000004);
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * The list of HTTP headers other than the
+ * [https://www.w3.org/TR/cors/#simple-response-header][simple response
+ * headers] to give permission for the user-agent to share across domains.
+ *
+ *
+ * repeated string response_header = 3;
+ *
+ * @param value The bytes of the responseHeader to add.
+ * @return This builder for chaining.
+ */
+ public Builder addResponseHeaderBytes(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+ ensureResponseHeaderIsMutable();
+ responseHeader_.add(value);
+ onChanged();
+ return this;
+ }
+
+ private int maxAgeSeconds_;
+ /**
+ *
+ *
+ *
+ * The value, in seconds, to return in the
+ * [https://www.w3.org/TR/cors/#access-control-max-age-response-header][Access-Control-Max-Age
+ * header] used in preflight responses.
+ *
+ *
+ * int32 max_age_seconds = 4;
+ *
+ * @return The maxAgeSeconds.
+ */
+ @java.lang.Override
+ public int getMaxAgeSeconds() {
+ return maxAgeSeconds_;
+ }
+ /**
+ *
+ *
+ *
+ * The value, in seconds, to return in the
+ * [https://www.w3.org/TR/cors/#access-control-max-age-response-header][Access-Control-Max-Age
+ * header] used in preflight responses.
+ *
+ *
+ * int32 max_age_seconds = 4;
+ *
+ * @param value The maxAgeSeconds to set.
+ * @return This builder for chaining.
+ */
+ public Builder setMaxAgeSeconds(int value) {
+
+ maxAgeSeconds_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * The value, in seconds, to return in the
+ * [https://www.w3.org/TR/cors/#access-control-max-age-response-header][Access-Control-Max-Age
+ * header] used in preflight responses.
+ *
+ *
+ * int32 max_age_seconds = 4;
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearMaxAgeSeconds() {
+
+ maxAgeSeconds_ = 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.storage.v2.Bucket.Cors)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.storage.v2.Bucket.Cors)
+ private static final com.google.storage.v2.Bucket.Cors DEFAULT_INSTANCE;
+
+ static {
+ DEFAULT_INSTANCE = new com.google.storage.v2.Bucket.Cors();
+ }
+
+ public static com.google.storage.v2.Bucket.Cors getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser
+ * A Cloud KMS key that will be used to encrypt objects inserted into this
+ * bucket, if no encryption method is specified.
+ *
+ *
+ * string default_kms_key = 1 [(.google.api.resource_reference) = { ... }
+ *
+ * @return The defaultKmsKey.
+ */
+ java.lang.String getDefaultKmsKey();
+ /**
+ *
+ *
+ *
+ * A Cloud KMS key that will be used to encrypt objects inserted into this
+ * bucket, if no encryption method is specified.
+ *
+ *
+ * string default_kms_key = 1 [(.google.api.resource_reference) = { ... }
+ *
+ * @return The bytes for defaultKmsKey.
+ */
+ com.google.protobuf.ByteString getDefaultKmsKeyBytes();
+ }
+ /**
+ *
+ *
+ *
+ * Encryption properties of a bucket.
+ *
+ *
+ * Protobuf type {@code google.storage.v2.Bucket.Encryption}
+ */
+ public static final class Encryption extends com.google.protobuf.GeneratedMessageV3
+ implements
+ // @@protoc_insertion_point(message_implements:google.storage.v2.Bucket.Encryption)
+ EncryptionOrBuilder {
+ private static final long serialVersionUID = 0L;
+ // Use Encryption.newBuilder() to construct.
+ private Encryption(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ super(builder);
+ }
+
+ private Encryption() {
+ defaultKmsKey_ = "";
+ }
+
+ @java.lang.Override
+ @SuppressWarnings({"unused"})
+ protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
+ return new Encryption();
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
+ return this.unknownFields;
+ }
+
+ private Encryption(
+ 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();
+
+ defaultKmsKey_ = s;
+ break;
+ }
+ default:
+ {
+ if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+
+ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
+ return com.google.storage.v2.StorageProto
+ .internal_static_google_storage_v2_Bucket_Encryption_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.storage.v2.StorageProto
+ .internal_static_google_storage_v2_Bucket_Encryption_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.storage.v2.Bucket.Encryption.class,
+ com.google.storage.v2.Bucket.Encryption.Builder.class);
+ }
+
+ public static final int DEFAULT_KMS_KEY_FIELD_NUMBER = 1;
+ private volatile java.lang.Object defaultKmsKey_;
+ /**
+ *
+ *
+ *
+ * A Cloud KMS key that will be used to encrypt objects inserted into this
+ * bucket, if no encryption method is specified.
+ *
+ *
+ * string default_kms_key = 1 [(.google.api.resource_reference) = { ... }
+ *
+ * @return The defaultKmsKey.
+ */
+ @java.lang.Override
+ public java.lang.String getDefaultKmsKey() {
+ java.lang.Object ref = defaultKmsKey_;
+ 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();
+ defaultKmsKey_ = s;
+ return s;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * A Cloud KMS key that will be used to encrypt objects inserted into this
+ * bucket, if no encryption method is specified.
+ *
+ *
+ * string default_kms_key = 1 [(.google.api.resource_reference) = { ... }
+ *
+ * @return The bytes for defaultKmsKey.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString getDefaultKmsKeyBytes() {
+ java.lang.Object ref = defaultKmsKey_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ defaultKmsKey_ = 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 (!getDefaultKmsKeyBytes().isEmpty()) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 1, defaultKmsKey_);
+ }
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (!getDefaultKmsKeyBytes().isEmpty()) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, defaultKmsKey_);
+ }
+ 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.storage.v2.Bucket.Encryption)) {
+ return super.equals(obj);
+ }
+ com.google.storage.v2.Bucket.Encryption other = (com.google.storage.v2.Bucket.Encryption) obj;
+
+ if (!getDefaultKmsKey().equals(other.getDefaultKmsKey())) 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) + DEFAULT_KMS_KEY_FIELD_NUMBER;
+ hash = (53 * hash) + getDefaultKmsKey().hashCode();
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.storage.v2.Bucket.Encryption parseFrom(java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.storage.v2.Bucket.Encryption parseFrom(
+ java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.storage.v2.Bucket.Encryption parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.storage.v2.Bucket.Encryption 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.storage.v2.Bucket.Encryption parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.storage.v2.Bucket.Encryption parseFrom(
+ byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.storage.v2.Bucket.Encryption parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.storage.v2.Bucket.Encryption 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.storage.v2.Bucket.Encryption parseDelimitedFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
+ }
+
+ public static com.google.storage.v2.Bucket.Encryption 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.storage.v2.Bucket.Encryption parseFrom(
+ com.google.protobuf.CodedInputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.storage.v2.Bucket.Encryption 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.storage.v2.Bucket.Encryption 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;
+ }
+ /**
+ *
+ *
+ *
+ * Encryption properties of a bucket.
+ *
+ *
+ * Protobuf type {@code google.storage.v2.Bucket.Encryption}
+ */
+ public static final class Builder
+ extends com.google.protobuf.GeneratedMessageV3.Builder
+ * A Cloud KMS key that will be used to encrypt objects inserted into this
+ * bucket, if no encryption method is specified.
+ *
+ *
+ * string default_kms_key = 1 [(.google.api.resource_reference) = { ... }
+ *
+ * @return The defaultKmsKey.
+ */
+ public java.lang.String getDefaultKmsKey() {
+ java.lang.Object ref = defaultKmsKey_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ defaultKmsKey_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * A Cloud KMS key that will be used to encrypt objects inserted into this
+ * bucket, if no encryption method is specified.
+ *
+ *
+ * string default_kms_key = 1 [(.google.api.resource_reference) = { ... }
+ *
+ * @return The bytes for defaultKmsKey.
+ */
+ public com.google.protobuf.ByteString getDefaultKmsKeyBytes() {
+ java.lang.Object ref = defaultKmsKey_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ defaultKmsKey_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * A Cloud KMS key that will be used to encrypt objects inserted into this
+ * bucket, if no encryption method is specified.
+ *
+ *
+ * string default_kms_key = 1 [(.google.api.resource_reference) = { ... }
+ *
+ * @param value The defaultKmsKey to set.
+ * @return This builder for chaining.
+ */
+ public Builder setDefaultKmsKey(java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ defaultKmsKey_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * A Cloud KMS key that will be used to encrypt objects inserted into this
+ * bucket, if no encryption method is specified.
+ *
+ *
+ * string default_kms_key = 1 [(.google.api.resource_reference) = { ... }
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearDefaultKmsKey() {
+
+ defaultKmsKey_ = getDefaultInstance().getDefaultKmsKey();
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * A Cloud KMS key that will be used to encrypt objects inserted into this
+ * bucket, if no encryption method is specified.
+ *
+ *
+ * string default_kms_key = 1 [(.google.api.resource_reference) = { ... }
+ *
+ * @param value The bytes for defaultKmsKey to set.
+ * @return This builder for chaining.
+ */
+ public Builder setDefaultKmsKeyBytes(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+
+ defaultKmsKey_ = 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.storage.v2.Bucket.Encryption)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.storage.v2.Bucket.Encryption)
+ private static final com.google.storage.v2.Bucket.Encryption DEFAULT_INSTANCE;
+
+ static {
+ DEFAULT_INSTANCE = new com.google.storage.v2.Bucket.Encryption();
+ }
+
+ public static com.google.storage.v2.Bucket.Encryption getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser
+ * Bucket restriction options currently enforced on the bucket.
+ *
+ *
+ *
+ * .google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess uniform_bucket_level_access = 1;
+ *
+ *
+ * @return Whether the uniformBucketLevelAccess field is set.
+ */
+ boolean hasUniformBucketLevelAccess();
+ /**
+ *
+ *
+ *
+ * Bucket restriction options currently enforced on the bucket.
+ *
+ *
+ *
+ * .google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess uniform_bucket_level_access = 1;
+ *
+ *
+ * @return The uniformBucketLevelAccess.
+ */
+ com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess getUniformBucketLevelAccess();
+ /**
+ *
+ *
+ *
+ * Bucket restriction options currently enforced on the bucket.
+ *
+ *
+ *
+ * .google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess uniform_bucket_level_access = 1;
+ *
+ */
+ com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccessOrBuilder
+ getUniformBucketLevelAccessOrBuilder();
+
+ /**
+ *
+ *
+ *
+ * Whether IAM will enforce public access prevention.
+ *
+ *
+ *
+ * .google.storage.v2.Bucket.IamConfig.PublicAccessPrevention public_access_prevention = 2;
+ *
+ *
+ * @return The enum numeric value on the wire for publicAccessPrevention.
+ */
+ int getPublicAccessPreventionValue();
+ /**
+ *
+ *
+ *
+ * Whether IAM will enforce public access prevention.
+ *
+ *
+ *
+ * .google.storage.v2.Bucket.IamConfig.PublicAccessPrevention public_access_prevention = 2;
+ *
+ *
+ * @return The publicAccessPrevention.
+ */
+ com.google.storage.v2.Bucket.IamConfig.PublicAccessPrevention getPublicAccessPrevention();
+ }
+ /**
+ *
+ *
+ *
+ * Bucket restriction options.
+ *
+ *
+ * Protobuf type {@code google.storage.v2.Bucket.IamConfig}
+ */
+ public static final class IamConfig extends com.google.protobuf.GeneratedMessageV3
+ implements
+ // @@protoc_insertion_point(message_implements:google.storage.v2.Bucket.IamConfig)
+ IamConfigOrBuilder {
+ private static final long serialVersionUID = 0L;
+ // Use IamConfig.newBuilder() to construct.
+ private IamConfig(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ super(builder);
+ }
+
+ private IamConfig() {
+ publicAccessPrevention_ = 0;
+ }
+
+ @java.lang.Override
+ @SuppressWarnings({"unused"})
+ protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
+ return new IamConfig();
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
+ return this.unknownFields;
+ }
+
+ private IamConfig(
+ 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.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.Builder subBuilder =
+ null;
+ if (uniformBucketLevelAccess_ != null) {
+ subBuilder = uniformBucketLevelAccess_.toBuilder();
+ }
+ uniformBucketLevelAccess_ =
+ input.readMessage(
+ com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.parser(),
+ extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(uniformBucketLevelAccess_);
+ uniformBucketLevelAccess_ = subBuilder.buildPartial();
+ }
+
+ break;
+ }
+ case 16:
+ {
+ int rawValue = input.readEnum();
+
+ publicAccessPrevention_ = rawValue;
+ break;
+ }
+ default:
+ {
+ if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+
+ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
+ return com.google.storage.v2.StorageProto
+ .internal_static_google_storage_v2_Bucket_IamConfig_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.storage.v2.StorageProto
+ .internal_static_google_storage_v2_Bucket_IamConfig_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.storage.v2.Bucket.IamConfig.class,
+ com.google.storage.v2.Bucket.IamConfig.Builder.class);
+ }
+
+ /**
+ *
+ *
+ *
+ * Public Access Prevention config values.
+ *
+ *
+ * Protobuf enum {@code google.storage.v2.Bucket.IamConfig.PublicAccessPrevention}
+ */
+ public enum PublicAccessPrevention implements com.google.protobuf.ProtocolMessageEnum {
+ /**
+ *
+ *
+ *
+ * Does not prevent access from being granted to public members 'allUsers'
+ * or 'allAuthenticatedUsers'. This setting may be enforced by Org Policy
+ * at the project/folder/organization level.
+ *
+ *
+ * PUBLIC_ACCESS_PREVENTION_UNSPECIFIED = 0;
+ */
+ PUBLIC_ACCESS_PREVENTION_UNSPECIFIED(0),
+ /**
+ *
+ *
+ *
+ * Prevents access from being granted to public members 'allUsers' and
+ * 'allAuthenticatedUsers'. Prevents attempts to grant new access to
+ * public members.
+ *
+ *
+ * ENFORCED = 1;
+ */
+ ENFORCED(1),
+ UNRECOGNIZED(-1),
+ ;
+
+ /**
+ *
+ *
+ *
+ * Does not prevent access from being granted to public members 'allUsers'
+ * or 'allAuthenticatedUsers'. This setting may be enforced by Org Policy
+ * at the project/folder/organization level.
+ *
+ *
+ * PUBLIC_ACCESS_PREVENTION_UNSPECIFIED = 0;
+ */
+ public static final int PUBLIC_ACCESS_PREVENTION_UNSPECIFIED_VALUE = 0;
+ /**
+ *
+ *
+ *
+ * Prevents access from being granted to public members 'allUsers' and
+ * 'allAuthenticatedUsers'. Prevents attempts to grant new access to
+ * public members.
+ *
+ *
+ * ENFORCED = 1;
+ */
+ public static final int ENFORCED_VALUE = 1;
+
+ 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 PublicAccessPrevention 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 PublicAccessPrevention forNumber(int value) {
+ switch (value) {
+ case 0:
+ return PUBLIC_ACCESS_PREVENTION_UNSPECIFIED;
+ case 1:
+ return ENFORCED;
+ default:
+ return null;
+ }
+ }
+
+ public static com.google.protobuf.Internal.EnumLiteMap
+ * If set, access checks only use bucket-level IAM policies or above.
+ *
+ *
+ * bool enabled = 1;
+ *
+ * @return The enabled.
+ */
+ boolean getEnabled();
+
+ /**
+ *
+ *
+ *
+ * The deadline time for changing
+ * `iamConfig.uniformBucketLevelAccess.enabled` from
+ * true to false in [RFC 3339](https://tools.ietf.org/html/rfc3339).
+ * Mutable until the specified deadline is reached, but not afterward.
+ *
+ *
+ * .google.protobuf.Timestamp lock_time = 2;
+ *
+ * @return Whether the lockTime field is set.
+ */
+ boolean hasLockTime();
+ /**
+ *
+ *
+ *
+ * The deadline time for changing
+ * `iamConfig.uniformBucketLevelAccess.enabled` from
+ * true to false in [RFC 3339](https://tools.ietf.org/html/rfc3339).
+ * Mutable until the specified deadline is reached, but not afterward.
+ *
+ *
+ * .google.protobuf.Timestamp lock_time = 2;
+ *
+ * @return The lockTime.
+ */
+ com.google.protobuf.Timestamp getLockTime();
+ /**
+ *
+ *
+ *
+ * The deadline time for changing
+ * `iamConfig.uniformBucketLevelAccess.enabled` from
+ * true to false in [RFC 3339](https://tools.ietf.org/html/rfc3339).
+ * Mutable until the specified deadline is reached, but not afterward.
+ *
+ *
+ * .google.protobuf.Timestamp lock_time = 2;
+ */
+ com.google.protobuf.TimestampOrBuilder getLockTimeOrBuilder();
+ }
+ /**
+ *
+ *
+ *
+ * Settings for Uniform Bucket level access.
+ * See https://cloud.google.com/storage/docs/uniform-bucket-level-access.
+ *
+ *
+ * Protobuf type {@code google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess}
+ */
+ public static final class UniformBucketLevelAccess
+ extends com.google.protobuf.GeneratedMessageV3
+ implements
+ // @@protoc_insertion_point(message_implements:google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess)
+ UniformBucketLevelAccessOrBuilder {
+ private static final long serialVersionUID = 0L;
+ // Use UniformBucketLevelAccess.newBuilder() to construct.
+ private UniformBucketLevelAccess(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ super(builder);
+ }
+
+ private UniformBucketLevelAccess() {}
+
+ @java.lang.Override
+ @SuppressWarnings({"unused"})
+ protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
+ return new UniformBucketLevelAccess();
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
+ return this.unknownFields;
+ }
+
+ private UniformBucketLevelAccess(
+ 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:
+ {
+ enabled_ = input.readBool();
+ break;
+ }
+ case 18:
+ {
+ com.google.protobuf.Timestamp.Builder subBuilder = null;
+ if (lockTime_ != null) {
+ subBuilder = lockTime_.toBuilder();
+ }
+ lockTime_ =
+ input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(lockTime_);
+ lockTime_ = subBuilder.buildPartial();
+ }
+
+ break;
+ }
+ default:
+ {
+ if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(e)
+ .setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+
+ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
+ return com.google.storage.v2.StorageProto
+ .internal_static_google_storage_v2_Bucket_IamConfig_UniformBucketLevelAccess_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.storage.v2.StorageProto
+ .internal_static_google_storage_v2_Bucket_IamConfig_UniformBucketLevelAccess_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.class,
+ com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.Builder.class);
+ }
+
+ public static final int ENABLED_FIELD_NUMBER = 1;
+ private boolean enabled_;
+ /**
+ *
+ *
+ *
+ * If set, access checks only use bucket-level IAM policies or above.
+ *
+ *
+ * bool enabled = 1;
+ *
+ * @return The enabled.
+ */
+ @java.lang.Override
+ public boolean getEnabled() {
+ return enabled_;
+ }
+
+ public static final int LOCK_TIME_FIELD_NUMBER = 2;
+ private com.google.protobuf.Timestamp lockTime_;
+ /**
+ *
+ *
+ *
+ * The deadline time for changing
+ * `iamConfig.uniformBucketLevelAccess.enabled` from
+ * true to false in [RFC 3339](https://tools.ietf.org/html/rfc3339).
+ * Mutable until the specified deadline is reached, but not afterward.
+ *
+ *
+ * .google.protobuf.Timestamp lock_time = 2;
+ *
+ * @return Whether the lockTime field is set.
+ */
+ @java.lang.Override
+ public boolean hasLockTime() {
+ return lockTime_ != null;
+ }
+ /**
+ *
+ *
+ *
+ * The deadline time for changing
+ * `iamConfig.uniformBucketLevelAccess.enabled` from
+ * true to false in [RFC 3339](https://tools.ietf.org/html/rfc3339).
+ * Mutable until the specified deadline is reached, but not afterward.
+ *
+ *
+ * .google.protobuf.Timestamp lock_time = 2;
+ *
+ * @return The lockTime.
+ */
+ @java.lang.Override
+ public com.google.protobuf.Timestamp getLockTime() {
+ return lockTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : lockTime_;
+ }
+ /**
+ *
+ *
+ *
+ * The deadline time for changing
+ * `iamConfig.uniformBucketLevelAccess.enabled` from
+ * true to false in [RFC 3339](https://tools.ietf.org/html/rfc3339).
+ * Mutable until the specified deadline is reached, but not afterward.
+ *
+ *
+ * .google.protobuf.Timestamp lock_time = 2;
+ */
+ @java.lang.Override
+ public com.google.protobuf.TimestampOrBuilder getLockTimeOrBuilder() {
+ return getLockTime();
+ }
+
+ 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 (enabled_ != false) {
+ output.writeBool(1, enabled_);
+ }
+ if (lockTime_ != null) {
+ output.writeMessage(2, getLockTime());
+ }
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (enabled_ != false) {
+ size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, enabled_);
+ }
+ if (lockTime_ != null) {
+ size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getLockTime());
+ }
+ 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.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess)) {
+ return super.equals(obj);
+ }
+ com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess other =
+ (com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess) obj;
+
+ if (getEnabled() != other.getEnabled()) return false;
+ if (hasLockTime() != other.hasLockTime()) return false;
+ if (hasLockTime()) {
+ if (!getLockTime().equals(other.getLockTime())) 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) + ENABLED_FIELD_NUMBER;
+ hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnabled());
+ if (hasLockTime()) {
+ hash = (37 * hash) + LOCK_TIME_FIELD_NUMBER;
+ hash = (53 * hash) + getLockTime().hashCode();
+ }
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess parseFrom(
+ java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess parseFrom(
+ java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess 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.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess parseFrom(
+ byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess parseFrom(
+ byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess parseFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess 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.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess
+ parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
+ }
+
+ public static com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess
+ 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.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess parseFrom(
+ com.google.protobuf.CodedInputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess 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.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess 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;
+ }
+ /**
+ *
+ *
+ *
+ * Settings for Uniform Bucket level access.
+ * See https://cloud.google.com/storage/docs/uniform-bucket-level-access.
+ *
+ *
+ * Protobuf type {@code google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess}
+ */
+ public static final class Builder
+ extends com.google.protobuf.GeneratedMessageV3.Builder
+ * If set, access checks only use bucket-level IAM policies or above.
+ *
+ *
+ * bool enabled = 1;
+ *
+ * @return The enabled.
+ */
+ @java.lang.Override
+ public boolean getEnabled() {
+ return enabled_;
+ }
+ /**
+ *
+ *
+ *
+ * If set, access checks only use bucket-level IAM policies or above.
+ *
+ *
+ * bool enabled = 1;
+ *
+ * @param value The enabled to set.
+ * @return This builder for chaining.
+ */
+ public Builder setEnabled(boolean value) {
+
+ enabled_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * If set, access checks only use bucket-level IAM policies or above.
+ *
+ *
+ * bool enabled = 1;
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearEnabled() {
+
+ enabled_ = false;
+ onChanged();
+ return this;
+ }
+
+ private com.google.protobuf.Timestamp lockTime_;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.protobuf.Timestamp,
+ com.google.protobuf.Timestamp.Builder,
+ com.google.protobuf.TimestampOrBuilder>
+ lockTimeBuilder_;
+ /**
+ *
+ *
+ *
+ * The deadline time for changing
+ * `iamConfig.uniformBucketLevelAccess.enabled` from
+ * true to false in [RFC 3339](https://tools.ietf.org/html/rfc3339).
+ * Mutable until the specified deadline is reached, but not afterward.
+ *
+ *
+ * .google.protobuf.Timestamp lock_time = 2;
+ *
+ * @return Whether the lockTime field is set.
+ */
+ public boolean hasLockTime() {
+ return lockTimeBuilder_ != null || lockTime_ != null;
+ }
+ /**
+ *
+ *
+ *
+ * The deadline time for changing
+ * `iamConfig.uniformBucketLevelAccess.enabled` from
+ * true to false in [RFC 3339](https://tools.ietf.org/html/rfc3339).
+ * Mutable until the specified deadline is reached, but not afterward.
+ *
+ *
+ * .google.protobuf.Timestamp lock_time = 2;
+ *
+ * @return The lockTime.
+ */
+ public com.google.protobuf.Timestamp getLockTime() {
+ if (lockTimeBuilder_ == null) {
+ return lockTime_ == null
+ ? com.google.protobuf.Timestamp.getDefaultInstance()
+ : lockTime_;
+ } else {
+ return lockTimeBuilder_.getMessage();
+ }
+ }
+ /**
+ *
+ *
+ *
+ * The deadline time for changing
+ * `iamConfig.uniformBucketLevelAccess.enabled` from
+ * true to false in [RFC 3339](https://tools.ietf.org/html/rfc3339).
+ * Mutable until the specified deadline is reached, but not afterward.
+ *
+ *
+ * .google.protobuf.Timestamp lock_time = 2;
+ */
+ public Builder setLockTime(com.google.protobuf.Timestamp value) {
+ if (lockTimeBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ lockTime_ = value;
+ onChanged();
+ } else {
+ lockTimeBuilder_.setMessage(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * The deadline time for changing
+ * `iamConfig.uniformBucketLevelAccess.enabled` from
+ * true to false in [RFC 3339](https://tools.ietf.org/html/rfc3339).
+ * Mutable until the specified deadline is reached, but not afterward.
+ *
+ *
+ * .google.protobuf.Timestamp lock_time = 2;
+ */
+ public Builder setLockTime(com.google.protobuf.Timestamp.Builder builderForValue) {
+ if (lockTimeBuilder_ == null) {
+ lockTime_ = builderForValue.build();
+ onChanged();
+ } else {
+ lockTimeBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * The deadline time for changing
+ * `iamConfig.uniformBucketLevelAccess.enabled` from
+ * true to false in [RFC 3339](https://tools.ietf.org/html/rfc3339).
+ * Mutable until the specified deadline is reached, but not afterward.
+ *
+ *
+ * .google.protobuf.Timestamp lock_time = 2;
+ */
+ public Builder mergeLockTime(com.google.protobuf.Timestamp value) {
+ if (lockTimeBuilder_ == null) {
+ if (lockTime_ != null) {
+ lockTime_ =
+ com.google.protobuf.Timestamp.newBuilder(lockTime_)
+ .mergeFrom(value)
+ .buildPartial();
+ } else {
+ lockTime_ = value;
+ }
+ onChanged();
+ } else {
+ lockTimeBuilder_.mergeFrom(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * The deadline time for changing
+ * `iamConfig.uniformBucketLevelAccess.enabled` from
+ * true to false in [RFC 3339](https://tools.ietf.org/html/rfc3339).
+ * Mutable until the specified deadline is reached, but not afterward.
+ *
+ *
+ * .google.protobuf.Timestamp lock_time = 2;
+ */
+ public Builder clearLockTime() {
+ if (lockTimeBuilder_ == null) {
+ lockTime_ = null;
+ onChanged();
+ } else {
+ lockTime_ = null;
+ lockTimeBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * The deadline time for changing
+ * `iamConfig.uniformBucketLevelAccess.enabled` from
+ * true to false in [RFC 3339](https://tools.ietf.org/html/rfc3339).
+ * Mutable until the specified deadline is reached, but not afterward.
+ *
+ *
+ * .google.protobuf.Timestamp lock_time = 2;
+ */
+ public com.google.protobuf.Timestamp.Builder getLockTimeBuilder() {
+
+ onChanged();
+ return getLockTimeFieldBuilder().getBuilder();
+ }
+ /**
+ *
+ *
+ *
+ * The deadline time for changing
+ * `iamConfig.uniformBucketLevelAccess.enabled` from
+ * true to false in [RFC 3339](https://tools.ietf.org/html/rfc3339).
+ * Mutable until the specified deadline is reached, but not afterward.
+ *
+ *
+ * .google.protobuf.Timestamp lock_time = 2;
+ */
+ public com.google.protobuf.TimestampOrBuilder getLockTimeOrBuilder() {
+ if (lockTimeBuilder_ != null) {
+ return lockTimeBuilder_.getMessageOrBuilder();
+ } else {
+ return lockTime_ == null
+ ? com.google.protobuf.Timestamp.getDefaultInstance()
+ : lockTime_;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * The deadline time for changing
+ * `iamConfig.uniformBucketLevelAccess.enabled` from
+ * true to false in [RFC 3339](https://tools.ietf.org/html/rfc3339).
+ * Mutable until the specified deadline is reached, but not afterward.
+ *
+ *
+ * .google.protobuf.Timestamp lock_time = 2;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.protobuf.Timestamp,
+ com.google.protobuf.Timestamp.Builder,
+ com.google.protobuf.TimestampOrBuilder>
+ getLockTimeFieldBuilder() {
+ if (lockTimeBuilder_ == null) {
+ lockTimeBuilder_ =
+ new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.protobuf.Timestamp,
+ com.google.protobuf.Timestamp.Builder,
+ com.google.protobuf.TimestampOrBuilder>(
+ getLockTime(), getParentForChildren(), isClean());
+ lockTime_ = null;
+ }
+ return lockTimeBuilder_;
+ }
+
+ @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.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess)
+ private static final com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess
+ DEFAULT_INSTANCE;
+
+ static {
+ DEFAULT_INSTANCE = new com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess();
+ }
+
+ public static com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess
+ getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser
+ * Bucket restriction options currently enforced on the bucket.
+ *
+ *
+ *
+ * .google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess uniform_bucket_level_access = 1;
+ *
+ *
+ * @return Whether the uniformBucketLevelAccess field is set.
+ */
+ @java.lang.Override
+ public boolean hasUniformBucketLevelAccess() {
+ return uniformBucketLevelAccess_ != null;
+ }
+ /**
+ *
+ *
+ *
+ * Bucket restriction options currently enforced on the bucket.
+ *
+ *
+ *
+ * .google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess uniform_bucket_level_access = 1;
+ *
+ *
+ * @return The uniformBucketLevelAccess.
+ */
+ @java.lang.Override
+ public com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess
+ getUniformBucketLevelAccess() {
+ return uniformBucketLevelAccess_ == null
+ ? com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.getDefaultInstance()
+ : uniformBucketLevelAccess_;
+ }
+ /**
+ *
+ *
+ *
+ * Bucket restriction options currently enforced on the bucket.
+ *
+ *
+ *
+ * .google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess uniform_bucket_level_access = 1;
+ *
+ */
+ @java.lang.Override
+ public com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccessOrBuilder
+ getUniformBucketLevelAccessOrBuilder() {
+ return getUniformBucketLevelAccess();
+ }
+
+ public static final int PUBLIC_ACCESS_PREVENTION_FIELD_NUMBER = 2;
+ private int publicAccessPrevention_;
+ /**
+ *
+ *
+ *
+ * Whether IAM will enforce public access prevention.
+ *
+ *
+ *
+ * .google.storage.v2.Bucket.IamConfig.PublicAccessPrevention public_access_prevention = 2;
+ *
+ *
+ * @return The enum numeric value on the wire for publicAccessPrevention.
+ */
+ @java.lang.Override
+ public int getPublicAccessPreventionValue() {
+ return publicAccessPrevention_;
+ }
+ /**
+ *
+ *
+ *
+ * Whether IAM will enforce public access prevention.
+ *
+ *
+ *
+ * .google.storage.v2.Bucket.IamConfig.PublicAccessPrevention public_access_prevention = 2;
+ *
+ *
+ * @return The publicAccessPrevention.
+ */
+ @java.lang.Override
+ public com.google.storage.v2.Bucket.IamConfig.PublicAccessPrevention
+ getPublicAccessPrevention() {
+ @SuppressWarnings("deprecation")
+ com.google.storage.v2.Bucket.IamConfig.PublicAccessPrevention result =
+ com.google.storage.v2.Bucket.IamConfig.PublicAccessPrevention.valueOf(
+ publicAccessPrevention_);
+ return result == null
+ ? com.google.storage.v2.Bucket.IamConfig.PublicAccessPrevention.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 (uniformBucketLevelAccess_ != null) {
+ output.writeMessage(1, getUniformBucketLevelAccess());
+ }
+ if (publicAccessPrevention_
+ != com.google.storage.v2.Bucket.IamConfig.PublicAccessPrevention
+ .PUBLIC_ACCESS_PREVENTION_UNSPECIFIED
+ .getNumber()) {
+ output.writeEnum(2, publicAccessPrevention_);
+ }
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (uniformBucketLevelAccess_ != null) {
+ size +=
+ com.google.protobuf.CodedOutputStream.computeMessageSize(
+ 1, getUniformBucketLevelAccess());
+ }
+ if (publicAccessPrevention_
+ != com.google.storage.v2.Bucket.IamConfig.PublicAccessPrevention
+ .PUBLIC_ACCESS_PREVENTION_UNSPECIFIED
+ .getNumber()) {
+ size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, publicAccessPrevention_);
+ }
+ 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.storage.v2.Bucket.IamConfig)) {
+ return super.equals(obj);
+ }
+ com.google.storage.v2.Bucket.IamConfig other = (com.google.storage.v2.Bucket.IamConfig) obj;
+
+ if (hasUniformBucketLevelAccess() != other.hasUniformBucketLevelAccess()) return false;
+ if (hasUniformBucketLevelAccess()) {
+ if (!getUniformBucketLevelAccess().equals(other.getUniformBucketLevelAccess()))
+ return false;
+ }
+ if (publicAccessPrevention_ != other.publicAccessPrevention_) 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 (hasUniformBucketLevelAccess()) {
+ hash = (37 * hash) + UNIFORM_BUCKET_LEVEL_ACCESS_FIELD_NUMBER;
+ hash = (53 * hash) + getUniformBucketLevelAccess().hashCode();
+ }
+ hash = (37 * hash) + PUBLIC_ACCESS_PREVENTION_FIELD_NUMBER;
+ hash = (53 * hash) + publicAccessPrevention_;
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.storage.v2.Bucket.IamConfig parseFrom(java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.storage.v2.Bucket.IamConfig parseFrom(
+ java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.storage.v2.Bucket.IamConfig parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.storage.v2.Bucket.IamConfig 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.storage.v2.Bucket.IamConfig parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.storage.v2.Bucket.IamConfig parseFrom(
+ byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.storage.v2.Bucket.IamConfig parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.storage.v2.Bucket.IamConfig 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.storage.v2.Bucket.IamConfig parseDelimitedFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
+ }
+
+ public static com.google.storage.v2.Bucket.IamConfig 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.storage.v2.Bucket.IamConfig parseFrom(
+ com.google.protobuf.CodedInputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.storage.v2.Bucket.IamConfig 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.storage.v2.Bucket.IamConfig 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;
+ }
+ /**
+ *
+ *
+ *
+ * Bucket restriction options.
+ *
+ *
+ * Protobuf type {@code google.storage.v2.Bucket.IamConfig}
+ */
+ public static final class Builder
+ extends com.google.protobuf.GeneratedMessageV3.Builder
+ * Bucket restriction options currently enforced on the bucket.
+ *
+ *
+ *
+ * .google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess uniform_bucket_level_access = 1;
+ *
+ *
+ * @return Whether the uniformBucketLevelAccess field is set.
+ */
+ public boolean hasUniformBucketLevelAccess() {
+ return uniformBucketLevelAccessBuilder_ != null || uniformBucketLevelAccess_ != null;
+ }
+ /**
+ *
+ *
+ *
+ * Bucket restriction options currently enforced on the bucket.
+ *
+ *
+ *
+ * .google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess uniform_bucket_level_access = 1;
+ *
+ *
+ * @return The uniformBucketLevelAccess.
+ */
+ public com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess
+ getUniformBucketLevelAccess() {
+ if (uniformBucketLevelAccessBuilder_ == null) {
+ return uniformBucketLevelAccess_ == null
+ ? com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.getDefaultInstance()
+ : uniformBucketLevelAccess_;
+ } else {
+ return uniformBucketLevelAccessBuilder_.getMessage();
+ }
+ }
+ /**
+ *
+ *
+ *
+ * Bucket restriction options currently enforced on the bucket.
+ *
+ *
+ *
+ * .google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess uniform_bucket_level_access = 1;
+ *
+ */
+ public Builder setUniformBucketLevelAccess(
+ com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess value) {
+ if (uniformBucketLevelAccessBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ uniformBucketLevelAccess_ = value;
+ onChanged();
+ } else {
+ uniformBucketLevelAccessBuilder_.setMessage(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * Bucket restriction options currently enforced on the bucket.
+ *
+ *
+ *
+ * .google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess uniform_bucket_level_access = 1;
+ *
+ */
+ public Builder setUniformBucketLevelAccess(
+ com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.Builder builderForValue) {
+ if (uniformBucketLevelAccessBuilder_ == null) {
+ uniformBucketLevelAccess_ = builderForValue.build();
+ onChanged();
+ } else {
+ uniformBucketLevelAccessBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * Bucket restriction options currently enforced on the bucket.
+ *
+ *
+ *
+ * .google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess uniform_bucket_level_access = 1;
+ *
+ */
+ public Builder mergeUniformBucketLevelAccess(
+ com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess value) {
+ if (uniformBucketLevelAccessBuilder_ == null) {
+ if (uniformBucketLevelAccess_ != null) {
+ uniformBucketLevelAccess_ =
+ com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.newBuilder(
+ uniformBucketLevelAccess_)
+ .mergeFrom(value)
+ .buildPartial();
+ } else {
+ uniformBucketLevelAccess_ = value;
+ }
+ onChanged();
+ } else {
+ uniformBucketLevelAccessBuilder_.mergeFrom(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * Bucket restriction options currently enforced on the bucket.
+ *
+ *
+ *
+ * .google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess uniform_bucket_level_access = 1;
+ *
+ */
+ public Builder clearUniformBucketLevelAccess() {
+ if (uniformBucketLevelAccessBuilder_ == null) {
+ uniformBucketLevelAccess_ = null;
+ onChanged();
+ } else {
+ uniformBucketLevelAccess_ = null;
+ uniformBucketLevelAccessBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * Bucket restriction options currently enforced on the bucket.
+ *
+ *
+ *
+ * .google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess uniform_bucket_level_access = 1;
+ *
+ */
+ public com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.Builder
+ getUniformBucketLevelAccessBuilder() {
+
+ onChanged();
+ return getUniformBucketLevelAccessFieldBuilder().getBuilder();
+ }
+ /**
+ *
+ *
+ *
+ * Bucket restriction options currently enforced on the bucket.
+ *
+ *
+ *
+ * .google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess uniform_bucket_level_access = 1;
+ *
+ */
+ public com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccessOrBuilder
+ getUniformBucketLevelAccessOrBuilder() {
+ if (uniformBucketLevelAccessBuilder_ != null) {
+ return uniformBucketLevelAccessBuilder_.getMessageOrBuilder();
+ } else {
+ return uniformBucketLevelAccess_ == null
+ ? com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.getDefaultInstance()
+ : uniformBucketLevelAccess_;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * Bucket restriction options currently enforced on the bucket.
+ *
+ *
+ *
+ * .google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess uniform_bucket_level_access = 1;
+ *
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess,
+ com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.Builder,
+ com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccessOrBuilder>
+ getUniformBucketLevelAccessFieldBuilder() {
+ if (uniformBucketLevelAccessBuilder_ == null) {
+ uniformBucketLevelAccessBuilder_ =
+ new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess,
+ com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.Builder,
+ com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccessOrBuilder>(
+ getUniformBucketLevelAccess(), getParentForChildren(), isClean());
+ uniformBucketLevelAccess_ = null;
+ }
+ return uniformBucketLevelAccessBuilder_;
+ }
+
+ private int publicAccessPrevention_ = 0;
+ /**
+ *
+ *
+ *
+ * Whether IAM will enforce public access prevention.
+ *
+ *
+ *
+ * .google.storage.v2.Bucket.IamConfig.PublicAccessPrevention public_access_prevention = 2;
+ *
+ *
+ * @return The enum numeric value on the wire for publicAccessPrevention.
+ */
+ @java.lang.Override
+ public int getPublicAccessPreventionValue() {
+ return publicAccessPrevention_;
+ }
+ /**
+ *
+ *
+ *
+ * Whether IAM will enforce public access prevention.
+ *
+ *
+ *
+ * .google.storage.v2.Bucket.IamConfig.PublicAccessPrevention public_access_prevention = 2;
+ *
+ *
+ * @param value The enum numeric value on the wire for publicAccessPrevention to set.
+ * @return This builder for chaining.
+ */
+ public Builder setPublicAccessPreventionValue(int value) {
+
+ publicAccessPrevention_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * Whether IAM will enforce public access prevention.
+ *
+ *
+ *
+ * .google.storage.v2.Bucket.IamConfig.PublicAccessPrevention public_access_prevention = 2;
+ *
+ *
+ * @return The publicAccessPrevention.
+ */
+ @java.lang.Override
+ public com.google.storage.v2.Bucket.IamConfig.PublicAccessPrevention
+ getPublicAccessPrevention() {
+ @SuppressWarnings("deprecation")
+ com.google.storage.v2.Bucket.IamConfig.PublicAccessPrevention result =
+ com.google.storage.v2.Bucket.IamConfig.PublicAccessPrevention.valueOf(
+ publicAccessPrevention_);
+ return result == null
+ ? com.google.storage.v2.Bucket.IamConfig.PublicAccessPrevention.UNRECOGNIZED
+ : result;
+ }
+ /**
+ *
+ *
+ *
+ * Whether IAM will enforce public access prevention.
+ *
+ *
+ *
+ * .google.storage.v2.Bucket.IamConfig.PublicAccessPrevention public_access_prevention = 2;
+ *
+ *
+ * @param value The publicAccessPrevention to set.
+ * @return This builder for chaining.
+ */
+ public Builder setPublicAccessPrevention(
+ com.google.storage.v2.Bucket.IamConfig.PublicAccessPrevention value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ publicAccessPrevention_ = value.getNumber();
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * Whether IAM will enforce public access prevention.
+ *
+ *
+ *
+ * .google.storage.v2.Bucket.IamConfig.PublicAccessPrevention public_access_prevention = 2;
+ *
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearPublicAccessPrevention() {
+
+ publicAccessPrevention_ = 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.storage.v2.Bucket.IamConfig)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.storage.v2.Bucket.IamConfig)
+ private static final com.google.storage.v2.Bucket.IamConfig DEFAULT_INSTANCE;
+
+ static {
+ DEFAULT_INSTANCE = new com.google.storage.v2.Bucket.IamConfig();
+ }
+
+ public static com.google.storage.v2.Bucket.IamConfig getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser
+ * A lifecycle management rule, which is made of an action to take and the
+ * condition(s) under which the action will be taken.
+ *
+ *
+ * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1;
+ */
+ java.util.List
+ * A lifecycle management rule, which is made of an action to take and the
+ * condition(s) under which the action will be taken.
+ *
+ *
+ * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1;
+ */
+ com.google.storage.v2.Bucket.Lifecycle.Rule getRule(int index);
+ /**
+ *
+ *
+ *
+ * A lifecycle management rule, which is made of an action to take and the
+ * condition(s) under which the action will be taken.
+ *
+ *
+ * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1;
+ */
+ int getRuleCount();
+ /**
+ *
+ *
+ *
+ * A lifecycle management rule, which is made of an action to take and the
+ * condition(s) under which the action will be taken.
+ *
+ *
+ * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1;
+ */
+ java.util.List extends com.google.storage.v2.Bucket.Lifecycle.RuleOrBuilder>
+ getRuleOrBuilderList();
+ /**
+ *
+ *
+ *
+ * A lifecycle management rule, which is made of an action to take and the
+ * condition(s) under which the action will be taken.
+ *
+ *
+ * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1;
+ */
+ com.google.storage.v2.Bucket.Lifecycle.RuleOrBuilder getRuleOrBuilder(int index);
+ }
+ /**
+ *
+ *
+ *
+ * Lifecycle properties of a bucket.
+ * For more information, see https://cloud.google.com/storage/docs/lifecycle.
+ *
+ *
+ * Protobuf type {@code google.storage.v2.Bucket.Lifecycle}
+ */
+ public static final class Lifecycle extends com.google.protobuf.GeneratedMessageV3
+ implements
+ // @@protoc_insertion_point(message_implements:google.storage.v2.Bucket.Lifecycle)
+ LifecycleOrBuilder {
+ private static final long serialVersionUID = 0L;
+ // Use Lifecycle.newBuilder() to construct.
+ private Lifecycle(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ super(builder);
+ }
+
+ private Lifecycle() {
+ rule_ = java.util.Collections.emptyList();
+ }
+
+ @java.lang.Override
+ @SuppressWarnings({"unused"})
+ protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
+ return new Lifecycle();
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
+ return this.unknownFields;
+ }
+
+ private Lifecycle(
+ 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)) {
+ rule_ = new java.util.ArrayList
+ * The action to take.
+ *
+ *
+ * .google.storage.v2.Bucket.Lifecycle.Rule.Action action = 1;
+ *
+ * @return Whether the action field is set.
+ */
+ boolean hasAction();
+ /**
+ *
+ *
+ *
+ * The action to take.
+ *
+ *
+ * .google.storage.v2.Bucket.Lifecycle.Rule.Action action = 1;
+ *
+ * @return The action.
+ */
+ com.google.storage.v2.Bucket.Lifecycle.Rule.Action getAction();
+ /**
+ *
+ *
+ *
+ * The action to take.
+ *
+ *
+ * .google.storage.v2.Bucket.Lifecycle.Rule.Action action = 1;
+ */
+ com.google.storage.v2.Bucket.Lifecycle.Rule.ActionOrBuilder getActionOrBuilder();
+
+ /**
+ *
+ *
+ *
+ * The condition(s) under which the action will be taken.
+ *
+ *
+ * .google.storage.v2.Bucket.Lifecycle.Rule.Condition condition = 2;
+ *
+ * @return Whether the condition field is set.
+ */
+ boolean hasCondition();
+ /**
+ *
+ *
+ *
+ * The condition(s) under which the action will be taken.
+ *
+ *
+ * .google.storage.v2.Bucket.Lifecycle.Rule.Condition condition = 2;
+ *
+ * @return The condition.
+ */
+ com.google.storage.v2.Bucket.Lifecycle.Rule.Condition getCondition();
+ /**
+ *
+ *
+ *
+ * The condition(s) under which the action will be taken.
+ *
+ *
+ * .google.storage.v2.Bucket.Lifecycle.Rule.Condition condition = 2;
+ */
+ com.google.storage.v2.Bucket.Lifecycle.Rule.ConditionOrBuilder getConditionOrBuilder();
+ }
+ /**
+ *
+ *
+ *
+ * A lifecycle Rule, combining an action to take on an object and a
+ * condition which will trigger that action.
+ *
+ *
+ * Protobuf type {@code google.storage.v2.Bucket.Lifecycle.Rule}
+ */
+ public static final class Rule extends com.google.protobuf.GeneratedMessageV3
+ implements
+ // @@protoc_insertion_point(message_implements:google.storage.v2.Bucket.Lifecycle.Rule)
+ RuleOrBuilder {
+ private static final long serialVersionUID = 0L;
+ // Use Rule.newBuilder() to construct.
+ private Rule(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ super(builder);
+ }
+
+ private Rule() {}
+
+ @java.lang.Override
+ @SuppressWarnings({"unused"})
+ protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
+ return new Rule();
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
+ return this.unknownFields;
+ }
+
+ private Rule(
+ 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.storage.v2.Bucket.Lifecycle.Rule.Action.Builder subBuilder = null;
+ if (action_ != null) {
+ subBuilder = action_.toBuilder();
+ }
+ action_ =
+ input.readMessage(
+ com.google.storage.v2.Bucket.Lifecycle.Rule.Action.parser(),
+ extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(action_);
+ action_ = subBuilder.buildPartial();
+ }
+
+ break;
+ }
+ case 18:
+ {
+ com.google.storage.v2.Bucket.Lifecycle.Rule.Condition.Builder subBuilder = null;
+ if (condition_ != null) {
+ subBuilder = condition_.toBuilder();
+ }
+ condition_ =
+ input.readMessage(
+ com.google.storage.v2.Bucket.Lifecycle.Rule.Condition.parser(),
+ extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(condition_);
+ condition_ = subBuilder.buildPartial();
+ }
+
+ break;
+ }
+ default:
+ {
+ if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(e)
+ .setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+
+ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
+ return com.google.storage.v2.StorageProto
+ .internal_static_google_storage_v2_Bucket_Lifecycle_Rule_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.storage.v2.StorageProto
+ .internal_static_google_storage_v2_Bucket_Lifecycle_Rule_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.storage.v2.Bucket.Lifecycle.Rule.class,
+ com.google.storage.v2.Bucket.Lifecycle.Rule.Builder.class);
+ }
+
+ public interface ActionOrBuilder
+ extends
+ // @@protoc_insertion_point(interface_extends:google.storage.v2.Bucket.Lifecycle.Rule.Action)
+ com.google.protobuf.MessageOrBuilder {
+
+ /**
+ *
+ *
+ *
+ * Type of the action. Currently, only `Delete` and
+ * `SetStorageClass` are supported.
+ *
+ *
+ * string type = 1;
+ *
+ * @return The type.
+ */
+ java.lang.String getType();
+ /**
+ *
+ *
+ *
+ * Type of the action. Currently, only `Delete` and
+ * `SetStorageClass` are supported.
+ *
+ *
+ * string type = 1;
+ *
+ * @return The bytes for type.
+ */
+ com.google.protobuf.ByteString getTypeBytes();
+
+ /**
+ *
+ *
+ *
+ * Target storage class. Required iff the type of the action is
+ * SetStorageClass.
+ *
+ *
+ * string storage_class = 2;
+ *
+ * @return The storageClass.
+ */
+ java.lang.String getStorageClass();
+ /**
+ *
+ *
+ *
+ * Target storage class. Required iff the type of the action is
+ * SetStorageClass.
+ *
+ *
+ * string storage_class = 2;
+ *
+ * @return The bytes for storageClass.
+ */
+ com.google.protobuf.ByteString getStorageClassBytes();
+ }
+ /**
+ *
+ *
+ *
+ * An action to take on an object.
+ *
+ *
+ * Protobuf type {@code google.storage.v2.Bucket.Lifecycle.Rule.Action}
+ */
+ public static final class Action extends com.google.protobuf.GeneratedMessageV3
+ implements
+ // @@protoc_insertion_point(message_implements:google.storage.v2.Bucket.Lifecycle.Rule.Action)
+ ActionOrBuilder {
+ private static final long serialVersionUID = 0L;
+ // Use Action.newBuilder() to construct.
+ private Action(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ super(builder);
+ }
+
+ private Action() {
+ type_ = "";
+ storageClass_ = "";
+ }
+
+ @java.lang.Override
+ @SuppressWarnings({"unused"})
+ protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
+ return new Action();
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
+ return this.unknownFields;
+ }
+
+ private Action(
+ 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();
+
+ type_ = s;
+ break;
+ }
+ case 18:
+ {
+ java.lang.String s = input.readStringRequireUtf8();
+
+ storageClass_ = s;
+ break;
+ }
+ default:
+ {
+ if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(e)
+ .setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+
+ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
+ return com.google.storage.v2.StorageProto
+ .internal_static_google_storage_v2_Bucket_Lifecycle_Rule_Action_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.storage.v2.StorageProto
+ .internal_static_google_storage_v2_Bucket_Lifecycle_Rule_Action_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.storage.v2.Bucket.Lifecycle.Rule.Action.class,
+ com.google.storage.v2.Bucket.Lifecycle.Rule.Action.Builder.class);
+ }
+
+ public static final int TYPE_FIELD_NUMBER = 1;
+ private volatile java.lang.Object type_;
+ /**
+ *
+ *
+ *
+ * Type of the action. Currently, only `Delete` and
+ * `SetStorageClass` are supported.
+ *
+ *
+ * string type = 1;
+ *
+ * @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;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * Type of the action. Currently, only `Delete` and
+ * `SetStorageClass` are supported.
+ *
+ *
+ * string type = 1;
+ *
+ * @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 STORAGE_CLASS_FIELD_NUMBER = 2;
+ private volatile java.lang.Object storageClass_;
+ /**
+ *
+ *
+ *
+ * Target storage class. Required iff the type of the action is
+ * SetStorageClass.
+ *
+ *
+ * string storage_class = 2;
+ *
+ * @return The storageClass.
+ */
+ @java.lang.Override
+ public java.lang.String getStorageClass() {
+ java.lang.Object ref = storageClass_;
+ 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();
+ storageClass_ = s;
+ return s;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * Target storage class. Required iff the type of the action is
+ * SetStorageClass.
+ *
+ *
+ * string storage_class = 2;
+ *
+ * @return The bytes for storageClass.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString getStorageClassBytes() {
+ java.lang.Object ref = storageClass_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ storageClass_ = 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 (!getTypeBytes().isEmpty()) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 1, type_);
+ }
+ if (!getStorageClassBytes().isEmpty()) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 2, storageClass_);
+ }
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (!getTypeBytes().isEmpty()) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, type_);
+ }
+ if (!getStorageClassBytes().isEmpty()) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, storageClass_);
+ }
+ 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.storage.v2.Bucket.Lifecycle.Rule.Action)) {
+ return super.equals(obj);
+ }
+ com.google.storage.v2.Bucket.Lifecycle.Rule.Action other =
+ (com.google.storage.v2.Bucket.Lifecycle.Rule.Action) obj;
+
+ if (!getType().equals(other.getType())) return false;
+ if (!getStorageClass().equals(other.getStorageClass())) 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) + TYPE_FIELD_NUMBER;
+ hash = (53 * hash) + getType().hashCode();
+ hash = (37 * hash) + STORAGE_CLASS_FIELD_NUMBER;
+ hash = (53 * hash) + getStorageClass().hashCode();
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.storage.v2.Bucket.Lifecycle.Rule.Action parseFrom(
+ java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.storage.v2.Bucket.Lifecycle.Rule.Action parseFrom(
+ java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.storage.v2.Bucket.Lifecycle.Rule.Action parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.storage.v2.Bucket.Lifecycle.Rule.Action 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.storage.v2.Bucket.Lifecycle.Rule.Action parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.storage.v2.Bucket.Lifecycle.Rule.Action parseFrom(
+ byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.storage.v2.Bucket.Lifecycle.Rule.Action parseFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.storage.v2.Bucket.Lifecycle.Rule.Action 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.storage.v2.Bucket.Lifecycle.Rule.Action parseDelimitedFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
+ PARSER, input);
+ }
+
+ public static com.google.storage.v2.Bucket.Lifecycle.Rule.Action 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.storage.v2.Bucket.Lifecycle.Rule.Action parseFrom(
+ com.google.protobuf.CodedInputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.storage.v2.Bucket.Lifecycle.Rule.Action 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.storage.v2.Bucket.Lifecycle.Rule.Action 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;
+ }
+ /**
+ *
+ *
+ *
+ * An action to take on an object.
+ *
+ *
+ * Protobuf type {@code google.storage.v2.Bucket.Lifecycle.Rule.Action}
+ */
+ public static final class Builder
+ extends com.google.protobuf.GeneratedMessageV3.Builder
+ * Type of the action. Currently, only `Delete` and
+ * `SetStorageClass` are supported.
+ *
+ *
+ * string type = 1;
+ *
+ * @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;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * Type of the action. Currently, only `Delete` and
+ * `SetStorageClass` are supported.
+ *
+ *
+ * string type = 1;
+ *
+ * @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;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * Type of the action. Currently, only `Delete` and
+ * `SetStorageClass` are supported.
+ *
+ *
+ * string type = 1;
+ *
+ * @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;
+ }
+ /**
+ *
+ *
+ *
+ * Type of the action. Currently, only `Delete` and
+ * `SetStorageClass` are supported.
+ *
+ *
+ * string type = 1;
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearType() {
+
+ type_ = getDefaultInstance().getType();
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * Type of the action. Currently, only `Delete` and
+ * `SetStorageClass` are supported.
+ *
+ *
+ * string type = 1;
+ *
+ * @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 storageClass_ = "";
+ /**
+ *
+ *
+ *
+ * Target storage class. Required iff the type of the action is
+ * SetStorageClass.
+ *
+ *
+ * string storage_class = 2;
+ *
+ * @return The storageClass.
+ */
+ public java.lang.String getStorageClass() {
+ java.lang.Object ref = storageClass_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ storageClass_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * Target storage class. Required iff the type of the action is
+ * SetStorageClass.
+ *
+ *
+ * string storage_class = 2;
+ *
+ * @return The bytes for storageClass.
+ */
+ public com.google.protobuf.ByteString getStorageClassBytes() {
+ java.lang.Object ref = storageClass_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ storageClass_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * Target storage class. Required iff the type of the action is
+ * SetStorageClass.
+ *
+ *
+ * string storage_class = 2;
+ *
+ * @param value The storageClass to set.
+ * @return This builder for chaining.
+ */
+ public Builder setStorageClass(java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ storageClass_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * Target storage class. Required iff the type of the action is
+ * SetStorageClass.
+ *
+ *
+ * string storage_class = 2;
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearStorageClass() {
+
+ storageClass_ = getDefaultInstance().getStorageClass();
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * Target storage class. Required iff the type of the action is
+ * SetStorageClass.
+ *
+ *
+ * string storage_class = 2;
+ *
+ * @param value The bytes for storageClass to set.
+ * @return This builder for chaining.
+ */
+ public Builder setStorageClassBytes(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+
+ storageClass_ = 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.storage.v2.Bucket.Lifecycle.Rule.Action)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.storage.v2.Bucket.Lifecycle.Rule.Action)
+ private static final com.google.storage.v2.Bucket.Lifecycle.Rule.Action DEFAULT_INSTANCE;
+
+ static {
+ DEFAULT_INSTANCE = new com.google.storage.v2.Bucket.Lifecycle.Rule.Action();
+ }
+
+ public static com.google.storage.v2.Bucket.Lifecycle.Rule.Action getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser
+ * Age of an object (in days). This condition is satisfied when an
+ * object reaches the specified age.
+ * A value of 0 indicates that all objects immediately match this
+ * condition.
+ *
+ *
+ * int32 age_days = 1;
+ *
+ * @return Whether the ageDays field is set.
+ */
+ boolean hasAgeDays();
+ /**
+ *
+ *
+ *
+ * Age of an object (in days). This condition is satisfied when an
+ * object reaches the specified age.
+ * A value of 0 indicates that all objects immediately match this
+ * condition.
+ *
+ *
+ * int32 age_days = 1;
+ *
+ * @return The ageDays.
+ */
+ int getAgeDays();
+
+ /**
+ *
+ *
+ *
+ * This condition is satisfied when an object is created before midnight
+ * of the specified date in UTC.
+ *
+ *
+ * .google.type.Date created_before = 2;
+ *
+ * @return Whether the createdBefore field is set.
+ */
+ boolean hasCreatedBefore();
+ /**
+ *
+ *
+ *
+ * This condition is satisfied when an object is created before midnight
+ * of the specified date in UTC.
+ *
+ *
+ * .google.type.Date created_before = 2;
+ *
+ * @return The createdBefore.
+ */
+ com.google.type.Date getCreatedBefore();
+ /**
+ *
+ *
+ *
+ * This condition is satisfied when an object is created before midnight
+ * of the specified date in UTC.
+ *
+ *
+ * .google.type.Date created_before = 2;
+ */
+ com.google.type.DateOrBuilder getCreatedBeforeOrBuilder();
+
+ /**
+ *
+ *
+ *
+ * Relevant only for versioned objects. If the value is
+ * `true`, this condition matches live objects; if the value
+ * is `false`, it matches archived objects.
+ *
+ *
+ * bool is_live = 3;
+ *
+ * @return Whether the isLive field is set.
+ */
+ boolean hasIsLive();
+ /**
+ *
+ *
+ *
+ * Relevant only for versioned objects. If the value is
+ * `true`, this condition matches live objects; if the value
+ * is `false`, it matches archived objects.
+ *
+ *
+ * bool is_live = 3;
+ *
+ * @return The isLive.
+ */
+ boolean getIsLive();
+
+ /**
+ *
+ *
+ *
+ * Relevant only for versioned objects. If the value is N, this
+ * condition is satisfied when there are at least N versions (including
+ * the live version) newer than this version of the object.
+ *
+ *
+ * int32 num_newer_versions = 4;
+ *
+ * @return Whether the numNewerVersions field is set.
+ */
+ boolean hasNumNewerVersions();
+ /**
+ *
+ *
+ *
+ * Relevant only for versioned objects. If the value is N, this
+ * condition is satisfied when there are at least N versions (including
+ * the live version) newer than this version of the object.
+ *
+ *
+ * int32 num_newer_versions = 4;
+ *
+ * @return The numNewerVersions.
+ */
+ int getNumNewerVersions();
+
+ /**
+ *
+ *
+ *
+ * Objects having any of the storage classes specified by this condition
+ * will be matched. Values include `MULTI_REGIONAL`, `REGIONAL`,
+ * `NEARLINE`, `COLDLINE`, `STANDARD`, and
+ * `DURABLE_REDUCED_AVAILABILITY`.
+ *
+ *
+ * repeated string matches_storage_class = 5;
+ *
+ * @return A list containing the matchesStorageClass.
+ */
+ java.util.List
+ * Objects having any of the storage classes specified by this condition
+ * will be matched. Values include `MULTI_REGIONAL`, `REGIONAL`,
+ * `NEARLINE`, `COLDLINE`, `STANDARD`, and
+ * `DURABLE_REDUCED_AVAILABILITY`.
+ *
+ *
+ * repeated string matches_storage_class = 5;
+ *
+ * @return The count of matchesStorageClass.
+ */
+ int getMatchesStorageClassCount();
+ /**
+ *
+ *
+ *
+ * Objects having any of the storage classes specified by this condition
+ * will be matched. Values include `MULTI_REGIONAL`, `REGIONAL`,
+ * `NEARLINE`, `COLDLINE`, `STANDARD`, and
+ * `DURABLE_REDUCED_AVAILABILITY`.
+ *
+ *
+ * repeated string matches_storage_class = 5;
+ *
+ * @param index The index of the element to return.
+ * @return The matchesStorageClass at the given index.
+ */
+ java.lang.String getMatchesStorageClass(int index);
+ /**
+ *
+ *
+ *
+ * Objects having any of the storage classes specified by this condition
+ * will be matched. Values include `MULTI_REGIONAL`, `REGIONAL`,
+ * `NEARLINE`, `COLDLINE`, `STANDARD`, and
+ * `DURABLE_REDUCED_AVAILABILITY`.
+ *
+ *
+ * repeated string matches_storage_class = 5;
+ *
+ * @param index The index of the value to return.
+ * @return The bytes of the matchesStorageClass at the given index.
+ */
+ com.google.protobuf.ByteString getMatchesStorageClassBytes(int index);
+
+ /**
+ *
+ *
+ *
+ * Number of days that have elapsed since the custom timestamp set on an
+ * object.
+ * The value of the field must be a nonnegative integer.
+ *
+ *
+ * int32 days_since_custom_time = 7;
+ *
+ * @return Whether the daysSinceCustomTime field is set.
+ */
+ boolean hasDaysSinceCustomTime();
+ /**
+ *
+ *
+ *
+ * Number of days that have elapsed since the custom timestamp set on an
+ * object.
+ * The value of the field must be a nonnegative integer.
+ *
+ *
+ * int32 days_since_custom_time = 7;
+ *
+ * @return The daysSinceCustomTime.
+ */
+ int getDaysSinceCustomTime();
+
+ /**
+ *
+ *
+ *
+ * An object matches this condition if the custom timestamp set on the
+ * object is before the specified date in UTC.
+ *
+ *
+ * .google.type.Date custom_time_before = 8;
+ *
+ * @return Whether the customTimeBefore field is set.
+ */
+ boolean hasCustomTimeBefore();
+ /**
+ *
+ *
+ *
+ * An object matches this condition if the custom timestamp set on the
+ * object is before the specified date in UTC.
+ *
+ *
+ * .google.type.Date custom_time_before = 8;
+ *
+ * @return The customTimeBefore.
+ */
+ com.google.type.Date getCustomTimeBefore();
+ /**
+ *
+ *
+ *
+ * An object matches this condition if the custom timestamp set on the
+ * object is before the specified date in UTC.
+ *
+ *
+ * .google.type.Date custom_time_before = 8;
+ */
+ com.google.type.DateOrBuilder getCustomTimeBeforeOrBuilder();
+
+ /**
+ *
+ *
+ *
+ * This condition is relevant only for versioned objects. An object
+ * version satisfies this condition only if these many days have been
+ * passed since it became noncurrent. The value of the field must be a
+ * nonnegative integer. If it's zero, the object version will become
+ * eligible for Lifecycle action as soon as it becomes noncurrent.
+ *
+ *
+ * int32 days_since_noncurrent_time = 9;
+ *
+ * @return Whether the daysSinceNoncurrentTime field is set.
+ */
+ boolean hasDaysSinceNoncurrentTime();
+ /**
+ *
+ *
+ *
+ * This condition is relevant only for versioned objects. An object
+ * version satisfies this condition only if these many days have been
+ * passed since it became noncurrent. The value of the field must be a
+ * nonnegative integer. If it's zero, the object version will become
+ * eligible for Lifecycle action as soon as it becomes noncurrent.
+ *
+ *
+ * int32 days_since_noncurrent_time = 9;
+ *
+ * @return The daysSinceNoncurrentTime.
+ */
+ int getDaysSinceNoncurrentTime();
+
+ /**
+ *
+ *
+ *
+ * This condition is relevant only for versioned objects. An object
+ * version satisfies this condition only if it became noncurrent before
+ * the specified date in UTC.
+ *
+ *
+ * .google.type.Date noncurrent_time_before = 10;
+ *
+ * @return Whether the noncurrentTimeBefore field is set.
+ */
+ boolean hasNoncurrentTimeBefore();
+ /**
+ *
+ *
+ *
+ * This condition is relevant only for versioned objects. An object
+ * version satisfies this condition only if it became noncurrent before
+ * the specified date in UTC.
+ *
+ *
+ * .google.type.Date noncurrent_time_before = 10;
+ *
+ * @return The noncurrentTimeBefore.
+ */
+ com.google.type.Date getNoncurrentTimeBefore();
+ /**
+ *
+ *
+ *
+ * This condition is relevant only for versioned objects. An object
+ * version satisfies this condition only if it became noncurrent before
+ * the specified date in UTC.
+ *
+ *
+ * .google.type.Date noncurrent_time_before = 10;
+ */
+ com.google.type.DateOrBuilder getNoncurrentTimeBeforeOrBuilder();
+ }
+ /**
+ *
+ *
+ *
+ * A condition of an object which triggers some action.
+ *
+ *
+ * Protobuf type {@code google.storage.v2.Bucket.Lifecycle.Rule.Condition}
+ */
+ public static final class Condition extends com.google.protobuf.GeneratedMessageV3
+ implements
+ // @@protoc_insertion_point(message_implements:google.storage.v2.Bucket.Lifecycle.Rule.Condition)
+ ConditionOrBuilder {
+ private static final long serialVersionUID = 0L;
+ // Use Condition.newBuilder() to construct.
+ private Condition(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ super(builder);
+ }
+
+ private Condition() {
+ matchesStorageClass_ = com.google.protobuf.LazyStringArrayList.EMPTY;
+ }
+
+ @java.lang.Override
+ @SuppressWarnings({"unused"})
+ protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
+ return new Condition();
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
+ return this.unknownFields;
+ }
+
+ private Condition(
+ 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:
+ {
+ bitField0_ |= 0x00000001;
+ ageDays_ = input.readInt32();
+ break;
+ }
+ case 18:
+ {
+ com.google.type.Date.Builder subBuilder = null;
+ if (createdBefore_ != null) {
+ subBuilder = createdBefore_.toBuilder();
+ }
+ createdBefore_ =
+ input.readMessage(com.google.type.Date.parser(), extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(createdBefore_);
+ createdBefore_ = subBuilder.buildPartial();
+ }
+
+ break;
+ }
+ case 24:
+ {
+ bitField0_ |= 0x00000002;
+ isLive_ = input.readBool();
+ break;
+ }
+ case 32:
+ {
+ bitField0_ |= 0x00000004;
+ numNewerVersions_ = input.readInt32();
+ break;
+ }
+ case 42:
+ {
+ java.lang.String s = input.readStringRequireUtf8();
+ if (!((mutable_bitField0_ & 0x00000008) != 0)) {
+ matchesStorageClass_ = new com.google.protobuf.LazyStringArrayList();
+ mutable_bitField0_ |= 0x00000008;
+ }
+ matchesStorageClass_.add(s);
+ break;
+ }
+ case 56:
+ {
+ bitField0_ |= 0x00000008;
+ daysSinceCustomTime_ = input.readInt32();
+ break;
+ }
+ case 66:
+ {
+ com.google.type.Date.Builder subBuilder = null;
+ if (customTimeBefore_ != null) {
+ subBuilder = customTimeBefore_.toBuilder();
+ }
+ customTimeBefore_ =
+ input.readMessage(com.google.type.Date.parser(), extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(customTimeBefore_);
+ customTimeBefore_ = subBuilder.buildPartial();
+ }
+
+ break;
+ }
+ case 72:
+ {
+ bitField0_ |= 0x00000010;
+ daysSinceNoncurrentTime_ = input.readInt32();
+ break;
+ }
+ case 82:
+ {
+ com.google.type.Date.Builder subBuilder = null;
+ if (noncurrentTimeBefore_ != null) {
+ subBuilder = noncurrentTimeBefore_.toBuilder();
+ }
+ noncurrentTimeBefore_ =
+ input.readMessage(com.google.type.Date.parser(), extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(noncurrentTimeBefore_);
+ noncurrentTimeBefore_ = subBuilder.buildPartial();
+ }
+
+ break;
+ }
+ default:
+ {
+ if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(e)
+ .setUnfinishedMessage(this);
+ } finally {
+ if (((mutable_bitField0_ & 0x00000008) != 0)) {
+ matchesStorageClass_ = matchesStorageClass_.getUnmodifiableView();
+ }
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+
+ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
+ return com.google.storage.v2.StorageProto
+ .internal_static_google_storage_v2_Bucket_Lifecycle_Rule_Condition_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.storage.v2.StorageProto
+ .internal_static_google_storage_v2_Bucket_Lifecycle_Rule_Condition_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.storage.v2.Bucket.Lifecycle.Rule.Condition.class,
+ com.google.storage.v2.Bucket.Lifecycle.Rule.Condition.Builder.class);
+ }
+
+ private int bitField0_;
+ public static final int AGE_DAYS_FIELD_NUMBER = 1;
+ private int ageDays_;
+ /**
+ *
+ *
+ *
+ * Age of an object (in days). This condition is satisfied when an
+ * object reaches the specified age.
+ * A value of 0 indicates that all objects immediately match this
+ * condition.
+ *
+ *
+ * int32 age_days = 1;
+ *
+ * @return Whether the ageDays field is set.
+ */
+ @java.lang.Override
+ public boolean hasAgeDays() {
+ return ((bitField0_ & 0x00000001) != 0);
+ }
+ /**
+ *
+ *
+ *
+ * Age of an object (in days). This condition is satisfied when an
+ * object reaches the specified age.
+ * A value of 0 indicates that all objects immediately match this
+ * condition.
+ *
+ *
+ * int32 age_days = 1;
+ *
+ * @return The ageDays.
+ */
+ @java.lang.Override
+ public int getAgeDays() {
+ return ageDays_;
+ }
+
+ public static final int CREATED_BEFORE_FIELD_NUMBER = 2;
+ private com.google.type.Date createdBefore_;
+ /**
+ *
+ *
+ *
+ * This condition is satisfied when an object is created before midnight
+ * of the specified date in UTC.
+ *
+ *
+ * .google.type.Date created_before = 2;
+ *
+ * @return Whether the createdBefore field is set.
+ */
+ @java.lang.Override
+ public boolean hasCreatedBefore() {
+ return createdBefore_ != null;
+ }
+ /**
+ *
+ *
+ *
+ * This condition is satisfied when an object is created before midnight
+ * of the specified date in UTC.
+ *
+ *
+ * .google.type.Date created_before = 2;
+ *
+ * @return The createdBefore.
+ */
+ @java.lang.Override
+ public com.google.type.Date getCreatedBefore() {
+ return createdBefore_ == null
+ ? com.google.type.Date.getDefaultInstance()
+ : createdBefore_;
+ }
+ /**
+ *
+ *
+ *
+ * This condition is satisfied when an object is created before midnight
+ * of the specified date in UTC.
+ *
+ *
+ * .google.type.Date created_before = 2;
+ */
+ @java.lang.Override
+ public com.google.type.DateOrBuilder getCreatedBeforeOrBuilder() {
+ return getCreatedBefore();
+ }
+
+ public static final int IS_LIVE_FIELD_NUMBER = 3;
+ private boolean isLive_;
+ /**
+ *
+ *
+ *
+ * Relevant only for versioned objects. If the value is
+ * `true`, this condition matches live objects; if the value
+ * is `false`, it matches archived objects.
+ *
+ *
+ * bool is_live = 3;
+ *
+ * @return Whether the isLive field is set.
+ */
+ @java.lang.Override
+ public boolean hasIsLive() {
+ return ((bitField0_ & 0x00000002) != 0);
+ }
+ /**
+ *
+ *
+ *
+ * Relevant only for versioned objects. If the value is
+ * `true`, this condition matches live objects; if the value
+ * is `false`, it matches archived objects.
+ *
+ *
+ * bool is_live = 3;
+ *
+ * @return The isLive.
+ */
+ @java.lang.Override
+ public boolean getIsLive() {
+ return isLive_;
+ }
+
+ public static final int NUM_NEWER_VERSIONS_FIELD_NUMBER = 4;
+ private int numNewerVersions_;
+ /**
+ *
+ *
+ *
+ * Relevant only for versioned objects. If the value is N, this
+ * condition is satisfied when there are at least N versions (including
+ * the live version) newer than this version of the object.
+ *
+ *
+ * int32 num_newer_versions = 4;
+ *
+ * @return Whether the numNewerVersions field is set.
+ */
+ @java.lang.Override
+ public boolean hasNumNewerVersions() {
+ return ((bitField0_ & 0x00000004) != 0);
+ }
+ /**
+ *
+ *
+ *
+ * Relevant only for versioned objects. If the value is N, this
+ * condition is satisfied when there are at least N versions (including
+ * the live version) newer than this version of the object.
+ *
+ *
+ * int32 num_newer_versions = 4;
+ *
+ * @return The numNewerVersions.
+ */
+ @java.lang.Override
+ public int getNumNewerVersions() {
+ return numNewerVersions_;
+ }
+
+ public static final int MATCHES_STORAGE_CLASS_FIELD_NUMBER = 5;
+ private com.google.protobuf.LazyStringList matchesStorageClass_;
+ /**
+ *
+ *
+ *
+ * Objects having any of the storage classes specified by this condition
+ * will be matched. Values include `MULTI_REGIONAL`, `REGIONAL`,
+ * `NEARLINE`, `COLDLINE`, `STANDARD`, and
+ * `DURABLE_REDUCED_AVAILABILITY`.
+ *
+ *
+ * repeated string matches_storage_class = 5;
+ *
+ * @return A list containing the matchesStorageClass.
+ */
+ public com.google.protobuf.ProtocolStringList getMatchesStorageClassList() {
+ return matchesStorageClass_;
+ }
+ /**
+ *
+ *
+ *
+ * Objects having any of the storage classes specified by this condition
+ * will be matched. Values include `MULTI_REGIONAL`, `REGIONAL`,
+ * `NEARLINE`, `COLDLINE`, `STANDARD`, and
+ * `DURABLE_REDUCED_AVAILABILITY`.
+ *
+ *
+ * repeated string matches_storage_class = 5;
+ *
+ * @return The count of matchesStorageClass.
+ */
+ public int getMatchesStorageClassCount() {
+ return matchesStorageClass_.size();
+ }
+ /**
+ *
+ *
+ *
+ * Objects having any of the storage classes specified by this condition
+ * will be matched. Values include `MULTI_REGIONAL`, `REGIONAL`,
+ * `NEARLINE`, `COLDLINE`, `STANDARD`, and
+ * `DURABLE_REDUCED_AVAILABILITY`.
+ *
+ *
+ * repeated string matches_storage_class = 5;
+ *
+ * @param index The index of the element to return.
+ * @return The matchesStorageClass at the given index.
+ */
+ public java.lang.String getMatchesStorageClass(int index) {
+ return matchesStorageClass_.get(index);
+ }
+ /**
+ *
+ *
+ *
+ * Objects having any of the storage classes specified by this condition
+ * will be matched. Values include `MULTI_REGIONAL`, `REGIONAL`,
+ * `NEARLINE`, `COLDLINE`, `STANDARD`, and
+ * `DURABLE_REDUCED_AVAILABILITY`.
+ *
+ *
+ * repeated string matches_storage_class = 5;
+ *
+ * @param index The index of the value to return.
+ * @return The bytes of the matchesStorageClass at the given index.
+ */
+ public com.google.protobuf.ByteString getMatchesStorageClassBytes(int index) {
+ return matchesStorageClass_.getByteString(index);
+ }
+
+ public static final int DAYS_SINCE_CUSTOM_TIME_FIELD_NUMBER = 7;
+ private int daysSinceCustomTime_;
+ /**
+ *
+ *
+ *
+ * Number of days that have elapsed since the custom timestamp set on an
+ * object.
+ * The value of the field must be a nonnegative integer.
+ *
+ *
+ * int32 days_since_custom_time = 7;
+ *
+ * @return Whether the daysSinceCustomTime field is set.
+ */
+ @java.lang.Override
+ public boolean hasDaysSinceCustomTime() {
+ return ((bitField0_ & 0x00000008) != 0);
+ }
+ /**
+ *
+ *
+ *
+ * Number of days that have elapsed since the custom timestamp set on an
+ * object.
+ * The value of the field must be a nonnegative integer.
+ *
+ *
+ * int32 days_since_custom_time = 7;
+ *
+ * @return The daysSinceCustomTime.
+ */
+ @java.lang.Override
+ public int getDaysSinceCustomTime() {
+ return daysSinceCustomTime_;
+ }
+
+ public static final int CUSTOM_TIME_BEFORE_FIELD_NUMBER = 8;
+ private com.google.type.Date customTimeBefore_;
+ /**
+ *
+ *
+ *
+ * An object matches this condition if the custom timestamp set on the
+ * object is before the specified date in UTC.
+ *
+ *
+ * .google.type.Date custom_time_before = 8;
+ *
+ * @return Whether the customTimeBefore field is set.
+ */
+ @java.lang.Override
+ public boolean hasCustomTimeBefore() {
+ return customTimeBefore_ != null;
+ }
+ /**
+ *
+ *
+ *
+ * An object matches this condition if the custom timestamp set on the
+ * object is before the specified date in UTC.
+ *
+ *
+ * .google.type.Date custom_time_before = 8;
+ *
+ * @return The customTimeBefore.
+ */
+ @java.lang.Override
+ public com.google.type.Date getCustomTimeBefore() {
+ return customTimeBefore_ == null
+ ? com.google.type.Date.getDefaultInstance()
+ : customTimeBefore_;
+ }
+ /**
+ *
+ *
+ *
+ * An object matches this condition if the custom timestamp set on the
+ * object is before the specified date in UTC.
+ *
+ *
+ * .google.type.Date custom_time_before = 8;
+ */
+ @java.lang.Override
+ public com.google.type.DateOrBuilder getCustomTimeBeforeOrBuilder() {
+ return getCustomTimeBefore();
+ }
+
+ public static final int DAYS_SINCE_NONCURRENT_TIME_FIELD_NUMBER = 9;
+ private int daysSinceNoncurrentTime_;
+ /**
+ *
+ *
+ *
+ * This condition is relevant only for versioned objects. An object
+ * version satisfies this condition only if these many days have been
+ * passed since it became noncurrent. The value of the field must be a
+ * nonnegative integer. If it's zero, the object version will become
+ * eligible for Lifecycle action as soon as it becomes noncurrent.
+ *
+ *
+ * int32 days_since_noncurrent_time = 9;
+ *
+ * @return Whether the daysSinceNoncurrentTime field is set.
+ */
+ @java.lang.Override
+ public boolean hasDaysSinceNoncurrentTime() {
+ return ((bitField0_ & 0x00000010) != 0);
+ }
+ /**
+ *
+ *
+ *
+ * This condition is relevant only for versioned objects. An object
+ * version satisfies this condition only if these many days have been
+ * passed since it became noncurrent. The value of the field must be a
+ * nonnegative integer. If it's zero, the object version will become
+ * eligible for Lifecycle action as soon as it becomes noncurrent.
+ *
+ *
+ * int32 days_since_noncurrent_time = 9;
+ *
+ * @return The daysSinceNoncurrentTime.
+ */
+ @java.lang.Override
+ public int getDaysSinceNoncurrentTime() {
+ return daysSinceNoncurrentTime_;
+ }
+
+ public static final int NONCURRENT_TIME_BEFORE_FIELD_NUMBER = 10;
+ private com.google.type.Date noncurrentTimeBefore_;
+ /**
+ *
+ *
+ *
+ * This condition is relevant only for versioned objects. An object
+ * version satisfies this condition only if it became noncurrent before
+ * the specified date in UTC.
+ *
+ *
+ * .google.type.Date noncurrent_time_before = 10;
+ *
+ * @return Whether the noncurrentTimeBefore field is set.
+ */
+ @java.lang.Override
+ public boolean hasNoncurrentTimeBefore() {
+ return noncurrentTimeBefore_ != null;
+ }
+ /**
+ *
+ *
+ *
+ * This condition is relevant only for versioned objects. An object
+ * version satisfies this condition only if it became noncurrent before
+ * the specified date in UTC.
+ *
+ *
+ * .google.type.Date noncurrent_time_before = 10;
+ *
+ * @return The noncurrentTimeBefore.
+ */
+ @java.lang.Override
+ public com.google.type.Date getNoncurrentTimeBefore() {
+ return noncurrentTimeBefore_ == null
+ ? com.google.type.Date.getDefaultInstance()
+ : noncurrentTimeBefore_;
+ }
+ /**
+ *
+ *
+ *
+ * This condition is relevant only for versioned objects. An object
+ * version satisfies this condition only if it became noncurrent before
+ * the specified date in UTC.
+ *
+ *
+ * .google.type.Date noncurrent_time_before = 10;
+ */
+ @java.lang.Override
+ public com.google.type.DateOrBuilder getNoncurrentTimeBeforeOrBuilder() {
+ return getNoncurrentTimeBefore();
+ }
+
+ 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 (((bitField0_ & 0x00000001) != 0)) {
+ output.writeInt32(1, ageDays_);
+ }
+ if (createdBefore_ != null) {
+ output.writeMessage(2, getCreatedBefore());
+ }
+ if (((bitField0_ & 0x00000002) != 0)) {
+ output.writeBool(3, isLive_);
+ }
+ if (((bitField0_ & 0x00000004) != 0)) {
+ output.writeInt32(4, numNewerVersions_);
+ }
+ for (int i = 0; i < matchesStorageClass_.size(); i++) {
+ com.google.protobuf.GeneratedMessageV3.writeString(
+ output, 5, matchesStorageClass_.getRaw(i));
+ }
+ if (((bitField0_ & 0x00000008) != 0)) {
+ output.writeInt32(7, daysSinceCustomTime_);
+ }
+ if (customTimeBefore_ != null) {
+ output.writeMessage(8, getCustomTimeBefore());
+ }
+ if (((bitField0_ & 0x00000010) != 0)) {
+ output.writeInt32(9, daysSinceNoncurrentTime_);
+ }
+ if (noncurrentTimeBefore_ != null) {
+ output.writeMessage(10, getNoncurrentTimeBefore());
+ }
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (((bitField0_ & 0x00000001) != 0)) {
+ size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, ageDays_);
+ }
+ if (createdBefore_ != null) {
+ size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCreatedBefore());
+ }
+ if (((bitField0_ & 0x00000002) != 0)) {
+ size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, isLive_);
+ }
+ if (((bitField0_ & 0x00000004) != 0)) {
+ size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, numNewerVersions_);
+ }
+ {
+ int dataSize = 0;
+ for (int i = 0; i < matchesStorageClass_.size(); i++) {
+ dataSize += computeStringSizeNoTag(matchesStorageClass_.getRaw(i));
+ }
+ size += dataSize;
+ size += 1 * getMatchesStorageClassList().size();
+ }
+ if (((bitField0_ & 0x00000008) != 0)) {
+ size += com.google.protobuf.CodedOutputStream.computeInt32Size(7, daysSinceCustomTime_);
+ }
+ if (customTimeBefore_ != null) {
+ size +=
+ com.google.protobuf.CodedOutputStream.computeMessageSize(8, getCustomTimeBefore());
+ }
+ if (((bitField0_ & 0x00000010) != 0)) {
+ size +=
+ com.google.protobuf.CodedOutputStream.computeInt32Size(9, daysSinceNoncurrentTime_);
+ }
+ if (noncurrentTimeBefore_ != null) {
+ size +=
+ com.google.protobuf.CodedOutputStream.computeMessageSize(
+ 10, getNoncurrentTimeBefore());
+ }
+ 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.storage.v2.Bucket.Lifecycle.Rule.Condition)) {
+ return super.equals(obj);
+ }
+ com.google.storage.v2.Bucket.Lifecycle.Rule.Condition other =
+ (com.google.storage.v2.Bucket.Lifecycle.Rule.Condition) obj;
+
+ if (hasAgeDays() != other.hasAgeDays()) return false;
+ if (hasAgeDays()) {
+ if (getAgeDays() != other.getAgeDays()) return false;
+ }
+ if (hasCreatedBefore() != other.hasCreatedBefore()) return false;
+ if (hasCreatedBefore()) {
+ if (!getCreatedBefore().equals(other.getCreatedBefore())) return false;
+ }
+ if (hasIsLive() != other.hasIsLive()) return false;
+ if (hasIsLive()) {
+ if (getIsLive() != other.getIsLive()) return false;
+ }
+ if (hasNumNewerVersions() != other.hasNumNewerVersions()) return false;
+ if (hasNumNewerVersions()) {
+ if (getNumNewerVersions() != other.getNumNewerVersions()) return false;
+ }
+ if (!getMatchesStorageClassList().equals(other.getMatchesStorageClassList()))
+ return false;
+ if (hasDaysSinceCustomTime() != other.hasDaysSinceCustomTime()) return false;
+ if (hasDaysSinceCustomTime()) {
+ if (getDaysSinceCustomTime() != other.getDaysSinceCustomTime()) return false;
+ }
+ if (hasCustomTimeBefore() != other.hasCustomTimeBefore()) return false;
+ if (hasCustomTimeBefore()) {
+ if (!getCustomTimeBefore().equals(other.getCustomTimeBefore())) return false;
+ }
+ if (hasDaysSinceNoncurrentTime() != other.hasDaysSinceNoncurrentTime()) return false;
+ if (hasDaysSinceNoncurrentTime()) {
+ if (getDaysSinceNoncurrentTime() != other.getDaysSinceNoncurrentTime()) return false;
+ }
+ if (hasNoncurrentTimeBefore() != other.hasNoncurrentTimeBefore()) return false;
+ if (hasNoncurrentTimeBefore()) {
+ if (!getNoncurrentTimeBefore().equals(other.getNoncurrentTimeBefore())) 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 (hasAgeDays()) {
+ hash = (37 * hash) + AGE_DAYS_FIELD_NUMBER;
+ hash = (53 * hash) + getAgeDays();
+ }
+ if (hasCreatedBefore()) {
+ hash = (37 * hash) + CREATED_BEFORE_FIELD_NUMBER;
+ hash = (53 * hash) + getCreatedBefore().hashCode();
+ }
+ if (hasIsLive()) {
+ hash = (37 * hash) + IS_LIVE_FIELD_NUMBER;
+ hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIsLive());
+ }
+ if (hasNumNewerVersions()) {
+ hash = (37 * hash) + NUM_NEWER_VERSIONS_FIELD_NUMBER;
+ hash = (53 * hash) + getNumNewerVersions();
+ }
+ if (getMatchesStorageClassCount() > 0) {
+ hash = (37 * hash) + MATCHES_STORAGE_CLASS_FIELD_NUMBER;
+ hash = (53 * hash) + getMatchesStorageClassList().hashCode();
+ }
+ if (hasDaysSinceCustomTime()) {
+ hash = (37 * hash) + DAYS_SINCE_CUSTOM_TIME_FIELD_NUMBER;
+ hash = (53 * hash) + getDaysSinceCustomTime();
+ }
+ if (hasCustomTimeBefore()) {
+ hash = (37 * hash) + CUSTOM_TIME_BEFORE_FIELD_NUMBER;
+ hash = (53 * hash) + getCustomTimeBefore().hashCode();
+ }
+ if (hasDaysSinceNoncurrentTime()) {
+ hash = (37 * hash) + DAYS_SINCE_NONCURRENT_TIME_FIELD_NUMBER;
+ hash = (53 * hash) + getDaysSinceNoncurrentTime();
+ }
+ if (hasNoncurrentTimeBefore()) {
+ hash = (37 * hash) + NONCURRENT_TIME_BEFORE_FIELD_NUMBER;
+ hash = (53 * hash) + getNoncurrentTimeBefore().hashCode();
+ }
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.storage.v2.Bucket.Lifecycle.Rule.Condition parseFrom(
+ java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.storage.v2.Bucket.Lifecycle.Rule.Condition parseFrom(
+ java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.storage.v2.Bucket.Lifecycle.Rule.Condition parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.storage.v2.Bucket.Lifecycle.Rule.Condition 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.storage.v2.Bucket.Lifecycle.Rule.Condition parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.storage.v2.Bucket.Lifecycle.Rule.Condition parseFrom(
+ byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.storage.v2.Bucket.Lifecycle.Rule.Condition parseFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.storage.v2.Bucket.Lifecycle.Rule.Condition 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.storage.v2.Bucket.Lifecycle.Rule.Condition parseDelimitedFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
+ PARSER, input);
+ }
+
+ public static com.google.storage.v2.Bucket.Lifecycle.Rule.Condition 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.storage.v2.Bucket.Lifecycle.Rule.Condition parseFrom(
+ com.google.protobuf.CodedInputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.storage.v2.Bucket.Lifecycle.Rule.Condition 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.storage.v2.Bucket.Lifecycle.Rule.Condition 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;
+ }
+ /**
+ *
+ *
+ *
+ * A condition of an object which triggers some action.
+ *
+ *
+ * Protobuf type {@code google.storage.v2.Bucket.Lifecycle.Rule.Condition}
+ */
+ public static final class Builder
+ extends com.google.protobuf.GeneratedMessageV3.Builder
+ * Age of an object (in days). This condition is satisfied when an
+ * object reaches the specified age.
+ * A value of 0 indicates that all objects immediately match this
+ * condition.
+ *
+ *
+ * int32 age_days = 1;
+ *
+ * @return Whether the ageDays field is set.
+ */
+ @java.lang.Override
+ public boolean hasAgeDays() {
+ return ((bitField0_ & 0x00000001) != 0);
+ }
+ /**
+ *
+ *
+ *
+ * Age of an object (in days). This condition is satisfied when an
+ * object reaches the specified age.
+ * A value of 0 indicates that all objects immediately match this
+ * condition.
+ *
+ *
+ * int32 age_days = 1;
+ *
+ * @return The ageDays.
+ */
+ @java.lang.Override
+ public int getAgeDays() {
+ return ageDays_;
+ }
+ /**
+ *
+ *
+ *
+ * Age of an object (in days). This condition is satisfied when an
+ * object reaches the specified age.
+ * A value of 0 indicates that all objects immediately match this
+ * condition.
+ *
+ *
+ * int32 age_days = 1;
+ *
+ * @param value The ageDays to set.
+ * @return This builder for chaining.
+ */
+ public Builder setAgeDays(int value) {
+ bitField0_ |= 0x00000001;
+ ageDays_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * Age of an object (in days). This condition is satisfied when an
+ * object reaches the specified age.
+ * A value of 0 indicates that all objects immediately match this
+ * condition.
+ *
+ *
+ * int32 age_days = 1;
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearAgeDays() {
+ bitField0_ = (bitField0_ & ~0x00000001);
+ ageDays_ = 0;
+ onChanged();
+ return this;
+ }
+
+ private com.google.type.Date createdBefore_;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.type.Date, com.google.type.Date.Builder, com.google.type.DateOrBuilder>
+ createdBeforeBuilder_;
+ /**
+ *
+ *
+ *
+ * This condition is satisfied when an object is created before midnight
+ * of the specified date in UTC.
+ *
+ *
+ * .google.type.Date created_before = 2;
+ *
+ * @return Whether the createdBefore field is set.
+ */
+ public boolean hasCreatedBefore() {
+ return createdBeforeBuilder_ != null || createdBefore_ != null;
+ }
+ /**
+ *
+ *
+ *
+ * This condition is satisfied when an object is created before midnight
+ * of the specified date in UTC.
+ *
+ *
+ * .google.type.Date created_before = 2;
+ *
+ * @return The createdBefore.
+ */
+ public com.google.type.Date getCreatedBefore() {
+ if (createdBeforeBuilder_ == null) {
+ return createdBefore_ == null
+ ? com.google.type.Date.getDefaultInstance()
+ : createdBefore_;
+ } else {
+ return createdBeforeBuilder_.getMessage();
+ }
+ }
+ /**
+ *
+ *
+ *
+ * This condition is satisfied when an object is created before midnight
+ * of the specified date in UTC.
+ *
+ *
+ * .google.type.Date created_before = 2;
+ */
+ public Builder setCreatedBefore(com.google.type.Date value) {
+ if (createdBeforeBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ createdBefore_ = value;
+ onChanged();
+ } else {
+ createdBeforeBuilder_.setMessage(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * This condition is satisfied when an object is created before midnight
+ * of the specified date in UTC.
+ *
+ *
+ * .google.type.Date created_before = 2;
+ */
+ public Builder setCreatedBefore(com.google.type.Date.Builder builderForValue) {
+ if (createdBeforeBuilder_ == null) {
+ createdBefore_ = builderForValue.build();
+ onChanged();
+ } else {
+ createdBeforeBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * This condition is satisfied when an object is created before midnight
+ * of the specified date in UTC.
+ *
+ *
+ * .google.type.Date created_before = 2;
+ */
+ public Builder mergeCreatedBefore(com.google.type.Date value) {
+ if (createdBeforeBuilder_ == null) {
+ if (createdBefore_ != null) {
+ createdBefore_ =
+ com.google.type.Date.newBuilder(createdBefore_).mergeFrom(value).buildPartial();
+ } else {
+ createdBefore_ = value;
+ }
+ onChanged();
+ } else {
+ createdBeforeBuilder_.mergeFrom(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * This condition is satisfied when an object is created before midnight
+ * of the specified date in UTC.
+ *
+ *
+ * .google.type.Date created_before = 2;
+ */
+ public Builder clearCreatedBefore() {
+ if (createdBeforeBuilder_ == null) {
+ createdBefore_ = null;
+ onChanged();
+ } else {
+ createdBefore_ = null;
+ createdBeforeBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * This condition is satisfied when an object is created before midnight
+ * of the specified date in UTC.
+ *
+ *
+ * .google.type.Date created_before = 2;
+ */
+ public com.google.type.Date.Builder getCreatedBeforeBuilder() {
+
+ onChanged();
+ return getCreatedBeforeFieldBuilder().getBuilder();
+ }
+ /**
+ *
+ *
+ *
+ * This condition is satisfied when an object is created before midnight
+ * of the specified date in UTC.
+ *
+ *
+ * .google.type.Date created_before = 2;
+ */
+ public com.google.type.DateOrBuilder getCreatedBeforeOrBuilder() {
+ if (createdBeforeBuilder_ != null) {
+ return createdBeforeBuilder_.getMessageOrBuilder();
+ } else {
+ return createdBefore_ == null
+ ? com.google.type.Date.getDefaultInstance()
+ : createdBefore_;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * This condition is satisfied when an object is created before midnight
+ * of the specified date in UTC.
+ *
+ *
+ * .google.type.Date created_before = 2;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.type.Date, com.google.type.Date.Builder, com.google.type.DateOrBuilder>
+ getCreatedBeforeFieldBuilder() {
+ if (createdBeforeBuilder_ == null) {
+ createdBeforeBuilder_ =
+ new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.type.Date,
+ com.google.type.Date.Builder,
+ com.google.type.DateOrBuilder>(
+ getCreatedBefore(), getParentForChildren(), isClean());
+ createdBefore_ = null;
+ }
+ return createdBeforeBuilder_;
+ }
+
+ private boolean isLive_;
+ /**
+ *
+ *
+ *
+ * Relevant only for versioned objects. If the value is
+ * `true`, this condition matches live objects; if the value
+ * is `false`, it matches archived objects.
+ *
+ *
+ * bool is_live = 3;
+ *
+ * @return Whether the isLive field is set.
+ */
+ @java.lang.Override
+ public boolean hasIsLive() {
+ return ((bitField0_ & 0x00000002) != 0);
+ }
+ /**
+ *
+ *
+ *
+ * Relevant only for versioned objects. If the value is
+ * `true`, this condition matches live objects; if the value
+ * is `false`, it matches archived objects.
+ *
+ *
+ * bool is_live = 3;
+ *
+ * @return The isLive.
+ */
+ @java.lang.Override
+ public boolean getIsLive() {
+ return isLive_;
+ }
+ /**
+ *
+ *
+ *
+ * Relevant only for versioned objects. If the value is
+ * `true`, this condition matches live objects; if the value
+ * is `false`, it matches archived objects.
+ *
+ *
+ * bool is_live = 3;
+ *
+ * @param value The isLive to set.
+ * @return This builder for chaining.
+ */
+ public Builder setIsLive(boolean value) {
+ bitField0_ |= 0x00000002;
+ isLive_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * Relevant only for versioned objects. If the value is
+ * `true`, this condition matches live objects; if the value
+ * is `false`, it matches archived objects.
+ *
+ *
+ * bool is_live = 3;
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearIsLive() {
+ bitField0_ = (bitField0_ & ~0x00000002);
+ isLive_ = false;
+ onChanged();
+ return this;
+ }
+
+ private int numNewerVersions_;
+ /**
+ *
+ *
+ *
+ * Relevant only for versioned objects. If the value is N, this
+ * condition is satisfied when there are at least N versions (including
+ * the live version) newer than this version of the object.
+ *
+ *
+ * int32 num_newer_versions = 4;
+ *
+ * @return Whether the numNewerVersions field is set.
+ */
+ @java.lang.Override
+ public boolean hasNumNewerVersions() {
+ return ((bitField0_ & 0x00000004) != 0);
+ }
+ /**
+ *
+ *
+ *
+ * Relevant only for versioned objects. If the value is N, this
+ * condition is satisfied when there are at least N versions (including
+ * the live version) newer than this version of the object.
+ *
+ *
+ * int32 num_newer_versions = 4;
+ *
+ * @return The numNewerVersions.
+ */
+ @java.lang.Override
+ public int getNumNewerVersions() {
+ return numNewerVersions_;
+ }
+ /**
+ *
+ *
+ *
+ * Relevant only for versioned objects. If the value is N, this
+ * condition is satisfied when there are at least N versions (including
+ * the live version) newer than this version of the object.
+ *
+ *
+ * int32 num_newer_versions = 4;
+ *
+ * @param value The numNewerVersions to set.
+ * @return This builder for chaining.
+ */
+ public Builder setNumNewerVersions(int value) {
+ bitField0_ |= 0x00000004;
+ numNewerVersions_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * Relevant only for versioned objects. If the value is N, this
+ * condition is satisfied when there are at least N versions (including
+ * the live version) newer than this version of the object.
+ *
+ *
+ * int32 num_newer_versions = 4;
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearNumNewerVersions() {
+ bitField0_ = (bitField0_ & ~0x00000004);
+ numNewerVersions_ = 0;
+ onChanged();
+ return this;
+ }
+
+ private com.google.protobuf.LazyStringList matchesStorageClass_ =
+ com.google.protobuf.LazyStringArrayList.EMPTY;
+
+ private void ensureMatchesStorageClassIsMutable() {
+ if (!((bitField0_ & 0x00000008) != 0)) {
+ matchesStorageClass_ =
+ new com.google.protobuf.LazyStringArrayList(matchesStorageClass_);
+ bitField0_ |= 0x00000008;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * Objects having any of the storage classes specified by this condition
+ * will be matched. Values include `MULTI_REGIONAL`, `REGIONAL`,
+ * `NEARLINE`, `COLDLINE`, `STANDARD`, and
+ * `DURABLE_REDUCED_AVAILABILITY`.
+ *
+ *
+ * repeated string matches_storage_class = 5;
+ *
+ * @return A list containing the matchesStorageClass.
+ */
+ public com.google.protobuf.ProtocolStringList getMatchesStorageClassList() {
+ return matchesStorageClass_.getUnmodifiableView();
+ }
+ /**
+ *
+ *
+ *
+ * Objects having any of the storage classes specified by this condition
+ * will be matched. Values include `MULTI_REGIONAL`, `REGIONAL`,
+ * `NEARLINE`, `COLDLINE`, `STANDARD`, and
+ * `DURABLE_REDUCED_AVAILABILITY`.
+ *
+ *
+ * repeated string matches_storage_class = 5;
+ *
+ * @return The count of matchesStorageClass.
+ */
+ public int getMatchesStorageClassCount() {
+ return matchesStorageClass_.size();
+ }
+ /**
+ *
+ *
+ *
+ * Objects having any of the storage classes specified by this condition
+ * will be matched. Values include `MULTI_REGIONAL`, `REGIONAL`,
+ * `NEARLINE`, `COLDLINE`, `STANDARD`, and
+ * `DURABLE_REDUCED_AVAILABILITY`.
+ *
+ *
+ * repeated string matches_storage_class = 5;
+ *
+ * @param index The index of the element to return.
+ * @return The matchesStorageClass at the given index.
+ */
+ public java.lang.String getMatchesStorageClass(int index) {
+ return matchesStorageClass_.get(index);
+ }
+ /**
+ *
+ *
+ *
+ * Objects having any of the storage classes specified by this condition
+ * will be matched. Values include `MULTI_REGIONAL`, `REGIONAL`,
+ * `NEARLINE`, `COLDLINE`, `STANDARD`, and
+ * `DURABLE_REDUCED_AVAILABILITY`.
+ *
+ *
+ * repeated string matches_storage_class = 5;
+ *
+ * @param index The index of the value to return.
+ * @return The bytes of the matchesStorageClass at the given index.
+ */
+ public com.google.protobuf.ByteString getMatchesStorageClassBytes(int index) {
+ return matchesStorageClass_.getByteString(index);
+ }
+ /**
+ *
+ *
+ *
+ * Objects having any of the storage classes specified by this condition
+ * will be matched. Values include `MULTI_REGIONAL`, `REGIONAL`,
+ * `NEARLINE`, `COLDLINE`, `STANDARD`, and
+ * `DURABLE_REDUCED_AVAILABILITY`.
+ *
+ *
+ * repeated string matches_storage_class = 5;
+ *
+ * @param index The index to set the value at.
+ * @param value The matchesStorageClass to set.
+ * @return This builder for chaining.
+ */
+ public Builder setMatchesStorageClass(int index, java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureMatchesStorageClassIsMutable();
+ matchesStorageClass_.set(index, value);
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * Objects having any of the storage classes specified by this condition
+ * will be matched. Values include `MULTI_REGIONAL`, `REGIONAL`,
+ * `NEARLINE`, `COLDLINE`, `STANDARD`, and
+ * `DURABLE_REDUCED_AVAILABILITY`.
+ *
+ *
+ * repeated string matches_storage_class = 5;
+ *
+ * @param value The matchesStorageClass to add.
+ * @return This builder for chaining.
+ */
+ public Builder addMatchesStorageClass(java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureMatchesStorageClassIsMutable();
+ matchesStorageClass_.add(value);
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * Objects having any of the storage classes specified by this condition
+ * will be matched. Values include `MULTI_REGIONAL`, `REGIONAL`,
+ * `NEARLINE`, `COLDLINE`, `STANDARD`, and
+ * `DURABLE_REDUCED_AVAILABILITY`.
+ *
+ *
+ * repeated string matches_storage_class = 5;
+ *
+ * @param values The matchesStorageClass to add.
+ * @return This builder for chaining.
+ */
+ public Builder addAllMatchesStorageClass(java.lang.Iterable
+ * Objects having any of the storage classes specified by this condition
+ * will be matched. Values include `MULTI_REGIONAL`, `REGIONAL`,
+ * `NEARLINE`, `COLDLINE`, `STANDARD`, and
+ * `DURABLE_REDUCED_AVAILABILITY`.
+ *
+ *
+ * repeated string matches_storage_class = 5;
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearMatchesStorageClass() {
+ matchesStorageClass_ = com.google.protobuf.LazyStringArrayList.EMPTY;
+ bitField0_ = (bitField0_ & ~0x00000008);
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * Objects having any of the storage classes specified by this condition
+ * will be matched. Values include `MULTI_REGIONAL`, `REGIONAL`,
+ * `NEARLINE`, `COLDLINE`, `STANDARD`, and
+ * `DURABLE_REDUCED_AVAILABILITY`.
+ *
+ *
+ * repeated string matches_storage_class = 5;
+ *
+ * @param value The bytes of the matchesStorageClass to add.
+ * @return This builder for chaining.
+ */
+ public Builder addMatchesStorageClassBytes(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+ ensureMatchesStorageClassIsMutable();
+ matchesStorageClass_.add(value);
+ onChanged();
+ return this;
+ }
+
+ private int daysSinceCustomTime_;
+ /**
+ *
+ *
+ *
+ * Number of days that have elapsed since the custom timestamp set on an
+ * object.
+ * The value of the field must be a nonnegative integer.
+ *
+ *
+ * int32 days_since_custom_time = 7;
+ *
+ * @return Whether the daysSinceCustomTime field is set.
+ */
+ @java.lang.Override
+ public boolean hasDaysSinceCustomTime() {
+ return ((bitField0_ & 0x00000010) != 0);
+ }
+ /**
+ *
+ *
+ *
+ * Number of days that have elapsed since the custom timestamp set on an
+ * object.
+ * The value of the field must be a nonnegative integer.
+ *
+ *
+ * int32 days_since_custom_time = 7;
+ *
+ * @return The daysSinceCustomTime.
+ */
+ @java.lang.Override
+ public int getDaysSinceCustomTime() {
+ return daysSinceCustomTime_;
+ }
+ /**
+ *
+ *
+ *
+ * Number of days that have elapsed since the custom timestamp set on an
+ * object.
+ * The value of the field must be a nonnegative integer.
+ *
+ *
+ * int32 days_since_custom_time = 7;
+ *
+ * @param value The daysSinceCustomTime to set.
+ * @return This builder for chaining.
+ */
+ public Builder setDaysSinceCustomTime(int value) {
+ bitField0_ |= 0x00000010;
+ daysSinceCustomTime_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * Number of days that have elapsed since the custom timestamp set on an
+ * object.
+ * The value of the field must be a nonnegative integer.
+ *
+ *
+ * int32 days_since_custom_time = 7;
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearDaysSinceCustomTime() {
+ bitField0_ = (bitField0_ & ~0x00000010);
+ daysSinceCustomTime_ = 0;
+ onChanged();
+ return this;
+ }
+
+ private com.google.type.Date customTimeBefore_;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.type.Date, com.google.type.Date.Builder, com.google.type.DateOrBuilder>
+ customTimeBeforeBuilder_;
+ /**
+ *
+ *
+ *
+ * An object matches this condition if the custom timestamp set on the
+ * object is before the specified date in UTC.
+ *
+ *
+ * .google.type.Date custom_time_before = 8;
+ *
+ * @return Whether the customTimeBefore field is set.
+ */
+ public boolean hasCustomTimeBefore() {
+ return customTimeBeforeBuilder_ != null || customTimeBefore_ != null;
+ }
+ /**
+ *
+ *
+ *
+ * An object matches this condition if the custom timestamp set on the
+ * object is before the specified date in UTC.
+ *
+ *
+ * .google.type.Date custom_time_before = 8;
+ *
+ * @return The customTimeBefore.
+ */
+ public com.google.type.Date getCustomTimeBefore() {
+ if (customTimeBeforeBuilder_ == null) {
+ return customTimeBefore_ == null
+ ? com.google.type.Date.getDefaultInstance()
+ : customTimeBefore_;
+ } else {
+ return customTimeBeforeBuilder_.getMessage();
+ }
+ }
+ /**
+ *
+ *
+ *
+ * An object matches this condition if the custom timestamp set on the
+ * object is before the specified date in UTC.
+ *
+ *
+ * .google.type.Date custom_time_before = 8;
+ */
+ public Builder setCustomTimeBefore(com.google.type.Date value) {
+ if (customTimeBeforeBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ customTimeBefore_ = value;
+ onChanged();
+ } else {
+ customTimeBeforeBuilder_.setMessage(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * An object matches this condition if the custom timestamp set on the
+ * object is before the specified date in UTC.
+ *
+ *
+ * .google.type.Date custom_time_before = 8;
+ */
+ public Builder setCustomTimeBefore(com.google.type.Date.Builder builderForValue) {
+ if (customTimeBeforeBuilder_ == null) {
+ customTimeBefore_ = builderForValue.build();
+ onChanged();
+ } else {
+ customTimeBeforeBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * An object matches this condition if the custom timestamp set on the
+ * object is before the specified date in UTC.
+ *
+ *
+ * .google.type.Date custom_time_before = 8;
+ */
+ public Builder mergeCustomTimeBefore(com.google.type.Date value) {
+ if (customTimeBeforeBuilder_ == null) {
+ if (customTimeBefore_ != null) {
+ customTimeBefore_ =
+ com.google.type.Date.newBuilder(customTimeBefore_)
+ .mergeFrom(value)
+ .buildPartial();
+ } else {
+ customTimeBefore_ = value;
+ }
+ onChanged();
+ } else {
+ customTimeBeforeBuilder_.mergeFrom(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * An object matches this condition if the custom timestamp set on the
+ * object is before the specified date in UTC.
+ *
+ *
+ * .google.type.Date custom_time_before = 8;
+ */
+ public Builder clearCustomTimeBefore() {
+ if (customTimeBeforeBuilder_ == null) {
+ customTimeBefore_ = null;
+ onChanged();
+ } else {
+ customTimeBefore_ = null;
+ customTimeBeforeBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * An object matches this condition if the custom timestamp set on the
+ * object is before the specified date in UTC.
+ *
+ *
+ * .google.type.Date custom_time_before = 8;
+ */
+ public com.google.type.Date.Builder getCustomTimeBeforeBuilder() {
+
+ onChanged();
+ return getCustomTimeBeforeFieldBuilder().getBuilder();
+ }
+ /**
+ *
+ *
+ *
+ * An object matches this condition if the custom timestamp set on the
+ * object is before the specified date in UTC.
+ *
+ *
+ * .google.type.Date custom_time_before = 8;
+ */
+ public com.google.type.DateOrBuilder getCustomTimeBeforeOrBuilder() {
+ if (customTimeBeforeBuilder_ != null) {
+ return customTimeBeforeBuilder_.getMessageOrBuilder();
+ } else {
+ return customTimeBefore_ == null
+ ? com.google.type.Date.getDefaultInstance()
+ : customTimeBefore_;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * An object matches this condition if the custom timestamp set on the
+ * object is before the specified date in UTC.
+ *
+ *
+ * .google.type.Date custom_time_before = 8;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.type.Date, com.google.type.Date.Builder, com.google.type.DateOrBuilder>
+ getCustomTimeBeforeFieldBuilder() {
+ if (customTimeBeforeBuilder_ == null) {
+ customTimeBeforeBuilder_ =
+ new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.type.Date,
+ com.google.type.Date.Builder,
+ com.google.type.DateOrBuilder>(
+ getCustomTimeBefore(), getParentForChildren(), isClean());
+ customTimeBefore_ = null;
+ }
+ return customTimeBeforeBuilder_;
+ }
+
+ private int daysSinceNoncurrentTime_;
+ /**
+ *
+ *
+ *
+ * This condition is relevant only for versioned objects. An object
+ * version satisfies this condition only if these many days have been
+ * passed since it became noncurrent. The value of the field must be a
+ * nonnegative integer. If it's zero, the object version will become
+ * eligible for Lifecycle action as soon as it becomes noncurrent.
+ *
+ *
+ * int32 days_since_noncurrent_time = 9;
+ *
+ * @return Whether the daysSinceNoncurrentTime field is set.
+ */
+ @java.lang.Override
+ public boolean hasDaysSinceNoncurrentTime() {
+ return ((bitField0_ & 0x00000020) != 0);
+ }
+ /**
+ *
+ *
+ *
+ * This condition is relevant only for versioned objects. An object
+ * version satisfies this condition only if these many days have been
+ * passed since it became noncurrent. The value of the field must be a
+ * nonnegative integer. If it's zero, the object version will become
+ * eligible for Lifecycle action as soon as it becomes noncurrent.
+ *
+ *
+ * int32 days_since_noncurrent_time = 9;
+ *
+ * @return The daysSinceNoncurrentTime.
+ */
+ @java.lang.Override
+ public int getDaysSinceNoncurrentTime() {
+ return daysSinceNoncurrentTime_;
+ }
+ /**
+ *
+ *
+ *
+ * This condition is relevant only for versioned objects. An object
+ * version satisfies this condition only if these many days have been
+ * passed since it became noncurrent. The value of the field must be a
+ * nonnegative integer. If it's zero, the object version will become
+ * eligible for Lifecycle action as soon as it becomes noncurrent.
+ *
+ *
+ * int32 days_since_noncurrent_time = 9;
+ *
+ * @param value The daysSinceNoncurrentTime to set.
+ * @return This builder for chaining.
+ */
+ public Builder setDaysSinceNoncurrentTime(int value) {
+ bitField0_ |= 0x00000020;
+ daysSinceNoncurrentTime_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * This condition is relevant only for versioned objects. An object
+ * version satisfies this condition only if these many days have been
+ * passed since it became noncurrent. The value of the field must be a
+ * nonnegative integer. If it's zero, the object version will become
+ * eligible for Lifecycle action as soon as it becomes noncurrent.
+ *
+ *
+ * int32 days_since_noncurrent_time = 9;
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearDaysSinceNoncurrentTime() {
+ bitField0_ = (bitField0_ & ~0x00000020);
+ daysSinceNoncurrentTime_ = 0;
+ onChanged();
+ return this;
+ }
+
+ private com.google.type.Date noncurrentTimeBefore_;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.type.Date, com.google.type.Date.Builder, com.google.type.DateOrBuilder>
+ noncurrentTimeBeforeBuilder_;
+ /**
+ *
+ *
+ *
+ * This condition is relevant only for versioned objects. An object
+ * version satisfies this condition only if it became noncurrent before
+ * the specified date in UTC.
+ *
+ *
+ * .google.type.Date noncurrent_time_before = 10;
+ *
+ * @return Whether the noncurrentTimeBefore field is set.
+ */
+ public boolean hasNoncurrentTimeBefore() {
+ return noncurrentTimeBeforeBuilder_ != null || noncurrentTimeBefore_ != null;
+ }
+ /**
+ *
+ *
+ *
+ * This condition is relevant only for versioned objects. An object
+ * version satisfies this condition only if it became noncurrent before
+ * the specified date in UTC.
+ *
+ *
+ * .google.type.Date noncurrent_time_before = 10;
+ *
+ * @return The noncurrentTimeBefore.
+ */
+ public com.google.type.Date getNoncurrentTimeBefore() {
+ if (noncurrentTimeBeforeBuilder_ == null) {
+ return noncurrentTimeBefore_ == null
+ ? com.google.type.Date.getDefaultInstance()
+ : noncurrentTimeBefore_;
+ } else {
+ return noncurrentTimeBeforeBuilder_.getMessage();
+ }
+ }
+ /**
+ *
+ *
+ *
+ * This condition is relevant only for versioned objects. An object
+ * version satisfies this condition only if it became noncurrent before
+ * the specified date in UTC.
+ *
+ *
+ * .google.type.Date noncurrent_time_before = 10;
+ */
+ public Builder setNoncurrentTimeBefore(com.google.type.Date value) {
+ if (noncurrentTimeBeforeBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ noncurrentTimeBefore_ = value;
+ onChanged();
+ } else {
+ noncurrentTimeBeforeBuilder_.setMessage(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * This condition is relevant only for versioned objects. An object
+ * version satisfies this condition only if it became noncurrent before
+ * the specified date in UTC.
+ *
+ *
+ * .google.type.Date noncurrent_time_before = 10;
+ */
+ public Builder setNoncurrentTimeBefore(com.google.type.Date.Builder builderForValue) {
+ if (noncurrentTimeBeforeBuilder_ == null) {
+ noncurrentTimeBefore_ = builderForValue.build();
+ onChanged();
+ } else {
+ noncurrentTimeBeforeBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * This condition is relevant only for versioned objects. An object
+ * version satisfies this condition only if it became noncurrent before
+ * the specified date in UTC.
+ *
+ *
+ * .google.type.Date noncurrent_time_before = 10;
+ */
+ public Builder mergeNoncurrentTimeBefore(com.google.type.Date value) {
+ if (noncurrentTimeBeforeBuilder_ == null) {
+ if (noncurrentTimeBefore_ != null) {
+ noncurrentTimeBefore_ =
+ com.google.type.Date.newBuilder(noncurrentTimeBefore_)
+ .mergeFrom(value)
+ .buildPartial();
+ } else {
+ noncurrentTimeBefore_ = value;
+ }
+ onChanged();
+ } else {
+ noncurrentTimeBeforeBuilder_.mergeFrom(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * This condition is relevant only for versioned objects. An object
+ * version satisfies this condition only if it became noncurrent before
+ * the specified date in UTC.
+ *
+ *
+ * .google.type.Date noncurrent_time_before = 10;
+ */
+ public Builder clearNoncurrentTimeBefore() {
+ if (noncurrentTimeBeforeBuilder_ == null) {
+ noncurrentTimeBefore_ = null;
+ onChanged();
+ } else {
+ noncurrentTimeBefore_ = null;
+ noncurrentTimeBeforeBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * This condition is relevant only for versioned objects. An object
+ * version satisfies this condition only if it became noncurrent before
+ * the specified date in UTC.
+ *
+ *
+ * .google.type.Date noncurrent_time_before = 10;
+ */
+ public com.google.type.Date.Builder getNoncurrentTimeBeforeBuilder() {
+
+ onChanged();
+ return getNoncurrentTimeBeforeFieldBuilder().getBuilder();
+ }
+ /**
+ *
+ *
+ *
+ * This condition is relevant only for versioned objects. An object
+ * version satisfies this condition only if it became noncurrent before
+ * the specified date in UTC.
+ *
+ *
+ * .google.type.Date noncurrent_time_before = 10;
+ */
+ public com.google.type.DateOrBuilder getNoncurrentTimeBeforeOrBuilder() {
+ if (noncurrentTimeBeforeBuilder_ != null) {
+ return noncurrentTimeBeforeBuilder_.getMessageOrBuilder();
+ } else {
+ return noncurrentTimeBefore_ == null
+ ? com.google.type.Date.getDefaultInstance()
+ : noncurrentTimeBefore_;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * This condition is relevant only for versioned objects. An object
+ * version satisfies this condition only if it became noncurrent before
+ * the specified date in UTC.
+ *
+ *
+ * .google.type.Date noncurrent_time_before = 10;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.type.Date, com.google.type.Date.Builder, com.google.type.DateOrBuilder>
+ getNoncurrentTimeBeforeFieldBuilder() {
+ if (noncurrentTimeBeforeBuilder_ == null) {
+ noncurrentTimeBeforeBuilder_ =
+ new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.type.Date,
+ com.google.type.Date.Builder,
+ com.google.type.DateOrBuilder>(
+ getNoncurrentTimeBefore(), getParentForChildren(), isClean());
+ noncurrentTimeBefore_ = null;
+ }
+ return noncurrentTimeBeforeBuilder_;
+ }
+
+ @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.storage.v2.Bucket.Lifecycle.Rule.Condition)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.storage.v2.Bucket.Lifecycle.Rule.Condition)
+ private static final com.google.storage.v2.Bucket.Lifecycle.Rule.Condition DEFAULT_INSTANCE;
+
+ static {
+ DEFAULT_INSTANCE = new com.google.storage.v2.Bucket.Lifecycle.Rule.Condition();
+ }
+
+ public static com.google.storage.v2.Bucket.Lifecycle.Rule.Condition getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser
+ * The action to take.
+ *
+ *
+ * .google.storage.v2.Bucket.Lifecycle.Rule.Action action = 1;
+ *
+ * @return Whether the action field is set.
+ */
+ @java.lang.Override
+ public boolean hasAction() {
+ return action_ != null;
+ }
+ /**
+ *
+ *
+ *
+ * The action to take.
+ *
+ *
+ * .google.storage.v2.Bucket.Lifecycle.Rule.Action action = 1;
+ *
+ * @return The action.
+ */
+ @java.lang.Override
+ public com.google.storage.v2.Bucket.Lifecycle.Rule.Action getAction() {
+ return action_ == null
+ ? com.google.storage.v2.Bucket.Lifecycle.Rule.Action.getDefaultInstance()
+ : action_;
+ }
+ /**
+ *
+ *
+ *
+ * The action to take.
+ *
+ *
+ * .google.storage.v2.Bucket.Lifecycle.Rule.Action action = 1;
+ */
+ @java.lang.Override
+ public com.google.storage.v2.Bucket.Lifecycle.Rule.ActionOrBuilder getActionOrBuilder() {
+ return getAction();
+ }
+
+ public static final int CONDITION_FIELD_NUMBER = 2;
+ private com.google.storage.v2.Bucket.Lifecycle.Rule.Condition condition_;
+ /**
+ *
+ *
+ *
+ * The condition(s) under which the action will be taken.
+ *
+ *
+ * .google.storage.v2.Bucket.Lifecycle.Rule.Condition condition = 2;
+ *
+ * @return Whether the condition field is set.
+ */
+ @java.lang.Override
+ public boolean hasCondition() {
+ return condition_ != null;
+ }
+ /**
+ *
+ *
+ *
+ * The condition(s) under which the action will be taken.
+ *
+ *
+ * .google.storage.v2.Bucket.Lifecycle.Rule.Condition condition = 2;
+ *
+ * @return The condition.
+ */
+ @java.lang.Override
+ public com.google.storage.v2.Bucket.Lifecycle.Rule.Condition getCondition() {
+ return condition_ == null
+ ? com.google.storage.v2.Bucket.Lifecycle.Rule.Condition.getDefaultInstance()
+ : condition_;
+ }
+ /**
+ *
+ *
+ *
+ * The condition(s) under which the action will be taken.
+ *
+ *
+ * .google.storage.v2.Bucket.Lifecycle.Rule.Condition condition = 2;
+ */
+ @java.lang.Override
+ public com.google.storage.v2.Bucket.Lifecycle.Rule.ConditionOrBuilder
+ getConditionOrBuilder() {
+ return getCondition();
+ }
+
+ 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 (action_ != null) {
+ output.writeMessage(1, getAction());
+ }
+ if (condition_ != null) {
+ output.writeMessage(2, getCondition());
+ }
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (action_ != null) {
+ size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getAction());
+ }
+ if (condition_ != null) {
+ size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCondition());
+ }
+ 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.storage.v2.Bucket.Lifecycle.Rule)) {
+ return super.equals(obj);
+ }
+ com.google.storage.v2.Bucket.Lifecycle.Rule other =
+ (com.google.storage.v2.Bucket.Lifecycle.Rule) obj;
+
+ if (hasAction() != other.hasAction()) return false;
+ if (hasAction()) {
+ if (!getAction().equals(other.getAction())) return false;
+ }
+ if (hasCondition() != other.hasCondition()) return false;
+ if (hasCondition()) {
+ if (!getCondition().equals(other.getCondition())) 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 (hasAction()) {
+ hash = (37 * hash) + ACTION_FIELD_NUMBER;
+ hash = (53 * hash) + getAction().hashCode();
+ }
+ if (hasCondition()) {
+ hash = (37 * hash) + CONDITION_FIELD_NUMBER;
+ hash = (53 * hash) + getCondition().hashCode();
+ }
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.storage.v2.Bucket.Lifecycle.Rule parseFrom(java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.storage.v2.Bucket.Lifecycle.Rule parseFrom(
+ java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.storage.v2.Bucket.Lifecycle.Rule parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.storage.v2.Bucket.Lifecycle.Rule 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.storage.v2.Bucket.Lifecycle.Rule parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.storage.v2.Bucket.Lifecycle.Rule parseFrom(
+ byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.storage.v2.Bucket.Lifecycle.Rule parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.storage.v2.Bucket.Lifecycle.Rule 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.storage.v2.Bucket.Lifecycle.Rule parseDelimitedFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
+ }
+
+ public static com.google.storage.v2.Bucket.Lifecycle.Rule 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.storage.v2.Bucket.Lifecycle.Rule parseFrom(
+ com.google.protobuf.CodedInputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.storage.v2.Bucket.Lifecycle.Rule 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.storage.v2.Bucket.Lifecycle.Rule 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;
+ }
+ /**
+ *
+ *
+ *
+ * A lifecycle Rule, combining an action to take on an object and a
+ * condition which will trigger that action.
+ *
+ *
+ * Protobuf type {@code google.storage.v2.Bucket.Lifecycle.Rule}
+ */
+ public static final class Builder
+ extends com.google.protobuf.GeneratedMessageV3.Builder
+ * The action to take.
+ *
+ *
+ * .google.storage.v2.Bucket.Lifecycle.Rule.Action action = 1;
+ *
+ * @return Whether the action field is set.
+ */
+ public boolean hasAction() {
+ return actionBuilder_ != null || action_ != null;
+ }
+ /**
+ *
+ *
+ *
+ * The action to take.
+ *
+ *
+ * .google.storage.v2.Bucket.Lifecycle.Rule.Action action = 1;
+ *
+ * @return The action.
+ */
+ public com.google.storage.v2.Bucket.Lifecycle.Rule.Action getAction() {
+ if (actionBuilder_ == null) {
+ return action_ == null
+ ? com.google.storage.v2.Bucket.Lifecycle.Rule.Action.getDefaultInstance()
+ : action_;
+ } else {
+ return actionBuilder_.getMessage();
+ }
+ }
+ /**
+ *
+ *
+ *
+ * The action to take.
+ *
+ *
+ * .google.storage.v2.Bucket.Lifecycle.Rule.Action action = 1;
+ */
+ public Builder setAction(com.google.storage.v2.Bucket.Lifecycle.Rule.Action value) {
+ if (actionBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ action_ = value;
+ onChanged();
+ } else {
+ actionBuilder_.setMessage(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * The action to take.
+ *
+ *
+ * .google.storage.v2.Bucket.Lifecycle.Rule.Action action = 1;
+ */
+ public Builder setAction(
+ com.google.storage.v2.Bucket.Lifecycle.Rule.Action.Builder builderForValue) {
+ if (actionBuilder_ == null) {
+ action_ = builderForValue.build();
+ onChanged();
+ } else {
+ actionBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * The action to take.
+ *
+ *
+ * .google.storage.v2.Bucket.Lifecycle.Rule.Action action = 1;
+ */
+ public Builder mergeAction(com.google.storage.v2.Bucket.Lifecycle.Rule.Action value) {
+ if (actionBuilder_ == null) {
+ if (action_ != null) {
+ action_ =
+ com.google.storage.v2.Bucket.Lifecycle.Rule.Action.newBuilder(action_)
+ .mergeFrom(value)
+ .buildPartial();
+ } else {
+ action_ = value;
+ }
+ onChanged();
+ } else {
+ actionBuilder_.mergeFrom(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * The action to take.
+ *
+ *
+ * .google.storage.v2.Bucket.Lifecycle.Rule.Action action = 1;
+ */
+ public Builder clearAction() {
+ if (actionBuilder_ == null) {
+ action_ = null;
+ onChanged();
+ } else {
+ action_ = null;
+ actionBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * The action to take.
+ *
+ *
+ * .google.storage.v2.Bucket.Lifecycle.Rule.Action action = 1;
+ */
+ public com.google.storage.v2.Bucket.Lifecycle.Rule.Action.Builder getActionBuilder() {
+
+ onChanged();
+ return getActionFieldBuilder().getBuilder();
+ }
+ /**
+ *
+ *
+ *
+ * The action to take.
+ *
+ *
+ * .google.storage.v2.Bucket.Lifecycle.Rule.Action action = 1;
+ */
+ public com.google.storage.v2.Bucket.Lifecycle.Rule.ActionOrBuilder getActionOrBuilder() {
+ if (actionBuilder_ != null) {
+ return actionBuilder_.getMessageOrBuilder();
+ } else {
+ return action_ == null
+ ? com.google.storage.v2.Bucket.Lifecycle.Rule.Action.getDefaultInstance()
+ : action_;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * The action to take.
+ *
+ *
+ * .google.storage.v2.Bucket.Lifecycle.Rule.Action action = 1;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.storage.v2.Bucket.Lifecycle.Rule.Action,
+ com.google.storage.v2.Bucket.Lifecycle.Rule.Action.Builder,
+ com.google.storage.v2.Bucket.Lifecycle.Rule.ActionOrBuilder>
+ getActionFieldBuilder() {
+ if (actionBuilder_ == null) {
+ actionBuilder_ =
+ new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.storage.v2.Bucket.Lifecycle.Rule.Action,
+ com.google.storage.v2.Bucket.Lifecycle.Rule.Action.Builder,
+ com.google.storage.v2.Bucket.Lifecycle.Rule.ActionOrBuilder>(
+ getAction(), getParentForChildren(), isClean());
+ action_ = null;
+ }
+ return actionBuilder_;
+ }
+
+ private com.google.storage.v2.Bucket.Lifecycle.Rule.Condition condition_;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.storage.v2.Bucket.Lifecycle.Rule.Condition,
+ com.google.storage.v2.Bucket.Lifecycle.Rule.Condition.Builder,
+ com.google.storage.v2.Bucket.Lifecycle.Rule.ConditionOrBuilder>
+ conditionBuilder_;
+ /**
+ *
+ *
+ *
+ * The condition(s) under which the action will be taken.
+ *
+ *
+ * .google.storage.v2.Bucket.Lifecycle.Rule.Condition condition = 2;
+ *
+ * @return Whether the condition field is set.
+ */
+ public boolean hasCondition() {
+ return conditionBuilder_ != null || condition_ != null;
+ }
+ /**
+ *
+ *
+ *
+ * The condition(s) under which the action will be taken.
+ *
+ *
+ * .google.storage.v2.Bucket.Lifecycle.Rule.Condition condition = 2;
+ *
+ * @return The condition.
+ */
+ public com.google.storage.v2.Bucket.Lifecycle.Rule.Condition getCondition() {
+ if (conditionBuilder_ == null) {
+ return condition_ == null
+ ? com.google.storage.v2.Bucket.Lifecycle.Rule.Condition.getDefaultInstance()
+ : condition_;
+ } else {
+ return conditionBuilder_.getMessage();
+ }
+ }
+ /**
+ *
+ *
+ *
+ * The condition(s) under which the action will be taken.
+ *
+ *
+ * .google.storage.v2.Bucket.Lifecycle.Rule.Condition condition = 2;
+ */
+ public Builder setCondition(com.google.storage.v2.Bucket.Lifecycle.Rule.Condition value) {
+ if (conditionBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ condition_ = value;
+ onChanged();
+ } else {
+ conditionBuilder_.setMessage(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * The condition(s) under which the action will be taken.
+ *
+ *
+ * .google.storage.v2.Bucket.Lifecycle.Rule.Condition condition = 2;
+ */
+ public Builder setCondition(
+ com.google.storage.v2.Bucket.Lifecycle.Rule.Condition.Builder builderForValue) {
+ if (conditionBuilder_ == null) {
+ condition_ = builderForValue.build();
+ onChanged();
+ } else {
+ conditionBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * The condition(s) under which the action will be taken.
+ *
+ *
+ * .google.storage.v2.Bucket.Lifecycle.Rule.Condition condition = 2;
+ */
+ public Builder mergeCondition(com.google.storage.v2.Bucket.Lifecycle.Rule.Condition value) {
+ if (conditionBuilder_ == null) {
+ if (condition_ != null) {
+ condition_ =
+ com.google.storage.v2.Bucket.Lifecycle.Rule.Condition.newBuilder(condition_)
+ .mergeFrom(value)
+ .buildPartial();
+ } else {
+ condition_ = value;
+ }
+ onChanged();
+ } else {
+ conditionBuilder_.mergeFrom(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * The condition(s) under which the action will be taken.
+ *
+ *
+ * .google.storage.v2.Bucket.Lifecycle.Rule.Condition condition = 2;
+ */
+ public Builder clearCondition() {
+ if (conditionBuilder_ == null) {
+ condition_ = null;
+ onChanged();
+ } else {
+ condition_ = null;
+ conditionBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * The condition(s) under which the action will be taken.
+ *
+ *
+ * .google.storage.v2.Bucket.Lifecycle.Rule.Condition condition = 2;
+ */
+ public com.google.storage.v2.Bucket.Lifecycle.Rule.Condition.Builder getConditionBuilder() {
+
+ onChanged();
+ return getConditionFieldBuilder().getBuilder();
+ }
+ /**
+ *
+ *
+ *
+ * The condition(s) under which the action will be taken.
+ *
+ *
+ * .google.storage.v2.Bucket.Lifecycle.Rule.Condition condition = 2;
+ */
+ public com.google.storage.v2.Bucket.Lifecycle.Rule.ConditionOrBuilder
+ getConditionOrBuilder() {
+ if (conditionBuilder_ != null) {
+ return conditionBuilder_.getMessageOrBuilder();
+ } else {
+ return condition_ == null
+ ? com.google.storage.v2.Bucket.Lifecycle.Rule.Condition.getDefaultInstance()
+ : condition_;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * The condition(s) under which the action will be taken.
+ *
+ *
+ * .google.storage.v2.Bucket.Lifecycle.Rule.Condition condition = 2;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.storage.v2.Bucket.Lifecycle.Rule.Condition,
+ com.google.storage.v2.Bucket.Lifecycle.Rule.Condition.Builder,
+ com.google.storage.v2.Bucket.Lifecycle.Rule.ConditionOrBuilder>
+ getConditionFieldBuilder() {
+ if (conditionBuilder_ == null) {
+ conditionBuilder_ =
+ new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.storage.v2.Bucket.Lifecycle.Rule.Condition,
+ com.google.storage.v2.Bucket.Lifecycle.Rule.Condition.Builder,
+ com.google.storage.v2.Bucket.Lifecycle.Rule.ConditionOrBuilder>(
+ getCondition(), getParentForChildren(), isClean());
+ condition_ = null;
+ }
+ return conditionBuilder_;
+ }
+
+ @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.storage.v2.Bucket.Lifecycle.Rule)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.storage.v2.Bucket.Lifecycle.Rule)
+ private static final com.google.storage.v2.Bucket.Lifecycle.Rule DEFAULT_INSTANCE;
+
+ static {
+ DEFAULT_INSTANCE = new com.google.storage.v2.Bucket.Lifecycle.Rule();
+ }
+
+ public static com.google.storage.v2.Bucket.Lifecycle.Rule getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser
+ * A lifecycle management rule, which is made of an action to take and the
+ * condition(s) under which the action will be taken.
+ *
+ *
+ * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1;
+ */
+ @java.lang.Override
+ public java.util.List
+ * A lifecycle management rule, which is made of an action to take and the
+ * condition(s) under which the action will be taken.
+ *
+ *
+ * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1;
+ */
+ @java.lang.Override
+ public java.util.List extends com.google.storage.v2.Bucket.Lifecycle.RuleOrBuilder>
+ getRuleOrBuilderList() {
+ return rule_;
+ }
+ /**
+ *
+ *
+ *
+ * A lifecycle management rule, which is made of an action to take and the
+ * condition(s) under which the action will be taken.
+ *
+ *
+ * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1;
+ */
+ @java.lang.Override
+ public int getRuleCount() {
+ return rule_.size();
+ }
+ /**
+ *
+ *
+ *
+ * A lifecycle management rule, which is made of an action to take and the
+ * condition(s) under which the action will be taken.
+ *
+ *
+ * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1;
+ */
+ @java.lang.Override
+ public com.google.storage.v2.Bucket.Lifecycle.Rule getRule(int index) {
+ return rule_.get(index);
+ }
+ /**
+ *
+ *
+ *
+ * A lifecycle management rule, which is made of an action to take and the
+ * condition(s) under which the action will be taken.
+ *
+ *
+ * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1;
+ */
+ @java.lang.Override
+ public com.google.storage.v2.Bucket.Lifecycle.RuleOrBuilder getRuleOrBuilder(int index) {
+ return rule_.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 < rule_.size(); i++) {
+ output.writeMessage(1, rule_.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 < rule_.size(); i++) {
+ size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, rule_.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.storage.v2.Bucket.Lifecycle)) {
+ return super.equals(obj);
+ }
+ com.google.storage.v2.Bucket.Lifecycle other = (com.google.storage.v2.Bucket.Lifecycle) obj;
+
+ if (!getRuleList().equals(other.getRuleList())) 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 (getRuleCount() > 0) {
+ hash = (37 * hash) + RULE_FIELD_NUMBER;
+ hash = (53 * hash) + getRuleList().hashCode();
+ }
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.storage.v2.Bucket.Lifecycle parseFrom(java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.storage.v2.Bucket.Lifecycle parseFrom(
+ java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.storage.v2.Bucket.Lifecycle parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.storage.v2.Bucket.Lifecycle 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.storage.v2.Bucket.Lifecycle parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.storage.v2.Bucket.Lifecycle parseFrom(
+ byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.storage.v2.Bucket.Lifecycle parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.storage.v2.Bucket.Lifecycle 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.storage.v2.Bucket.Lifecycle parseDelimitedFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
+ }
+
+ public static com.google.storage.v2.Bucket.Lifecycle 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.storage.v2.Bucket.Lifecycle parseFrom(
+ com.google.protobuf.CodedInputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.storage.v2.Bucket.Lifecycle 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.storage.v2.Bucket.Lifecycle 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;
+ }
+ /**
+ *
+ *
+ *
+ * Lifecycle properties of a bucket.
+ * For more information, see https://cloud.google.com/storage/docs/lifecycle.
+ *
+ *
+ * Protobuf type {@code google.storage.v2.Bucket.Lifecycle}
+ */
+ public static final class Builder
+ extends com.google.protobuf.GeneratedMessageV3.Builder
+ * A lifecycle management rule, which is made of an action to take and the
+ * condition(s) under which the action will be taken.
+ *
+ *
+ * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1;
+ */
+ public java.util.List
+ * A lifecycle management rule, which is made of an action to take and the
+ * condition(s) under which the action will be taken.
+ *
+ *
+ * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1;
+ */
+ public int getRuleCount() {
+ if (ruleBuilder_ == null) {
+ return rule_.size();
+ } else {
+ return ruleBuilder_.getCount();
+ }
+ }
+ /**
+ *
+ *
+ *
+ * A lifecycle management rule, which is made of an action to take and the
+ * condition(s) under which the action will be taken.
+ *
+ *
+ * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1;
+ */
+ public com.google.storage.v2.Bucket.Lifecycle.Rule getRule(int index) {
+ if (ruleBuilder_ == null) {
+ return rule_.get(index);
+ } else {
+ return ruleBuilder_.getMessage(index);
+ }
+ }
+ /**
+ *
+ *
+ *
+ * A lifecycle management rule, which is made of an action to take and the
+ * condition(s) under which the action will be taken.
+ *
+ *
+ * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1;
+ */
+ public Builder setRule(int index, com.google.storage.v2.Bucket.Lifecycle.Rule value) {
+ if (ruleBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureRuleIsMutable();
+ rule_.set(index, value);
+ onChanged();
+ } else {
+ ruleBuilder_.setMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * A lifecycle management rule, which is made of an action to take and the
+ * condition(s) under which the action will be taken.
+ *
+ *
+ * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1;
+ */
+ public Builder setRule(
+ int index, com.google.storage.v2.Bucket.Lifecycle.Rule.Builder builderForValue) {
+ if (ruleBuilder_ == null) {
+ ensureRuleIsMutable();
+ rule_.set(index, builderForValue.build());
+ onChanged();
+ } else {
+ ruleBuilder_.setMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * A lifecycle management rule, which is made of an action to take and the
+ * condition(s) under which the action will be taken.
+ *
+ *
+ * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1;
+ */
+ public Builder addRule(com.google.storage.v2.Bucket.Lifecycle.Rule value) {
+ if (ruleBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureRuleIsMutable();
+ rule_.add(value);
+ onChanged();
+ } else {
+ ruleBuilder_.addMessage(value);
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * A lifecycle management rule, which is made of an action to take and the
+ * condition(s) under which the action will be taken.
+ *
+ *
+ * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1;
+ */
+ public Builder addRule(int index, com.google.storage.v2.Bucket.Lifecycle.Rule value) {
+ if (ruleBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureRuleIsMutable();
+ rule_.add(index, value);
+ onChanged();
+ } else {
+ ruleBuilder_.addMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * A lifecycle management rule, which is made of an action to take and the
+ * condition(s) under which the action will be taken.
+ *
+ *
+ * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1;
+ */
+ public Builder addRule(com.google.storage.v2.Bucket.Lifecycle.Rule.Builder builderForValue) {
+ if (ruleBuilder_ == null) {
+ ensureRuleIsMutable();
+ rule_.add(builderForValue.build());
+ onChanged();
+ } else {
+ ruleBuilder_.addMessage(builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * A lifecycle management rule, which is made of an action to take and the
+ * condition(s) under which the action will be taken.
+ *
+ *
+ * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1;
+ */
+ public Builder addRule(
+ int index, com.google.storage.v2.Bucket.Lifecycle.Rule.Builder builderForValue) {
+ if (ruleBuilder_ == null) {
+ ensureRuleIsMutable();
+ rule_.add(index, builderForValue.build());
+ onChanged();
+ } else {
+ ruleBuilder_.addMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * A lifecycle management rule, which is made of an action to take and the
+ * condition(s) under which the action will be taken.
+ *
+ *
+ * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1;
+ */
+ public Builder addAllRule(
+ java.lang.Iterable extends com.google.storage.v2.Bucket.Lifecycle.Rule> values) {
+ if (ruleBuilder_ == null) {
+ ensureRuleIsMutable();
+ com.google.protobuf.AbstractMessageLite.Builder.addAll(values, rule_);
+ onChanged();
+ } else {
+ ruleBuilder_.addAllMessages(values);
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * A lifecycle management rule, which is made of an action to take and the
+ * condition(s) under which the action will be taken.
+ *
+ *
+ * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1;
+ */
+ public Builder clearRule() {
+ if (ruleBuilder_ == null) {
+ rule_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000001);
+ onChanged();
+ } else {
+ ruleBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * A lifecycle management rule, which is made of an action to take and the
+ * condition(s) under which the action will be taken.
+ *
+ *
+ * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1;
+ */
+ public Builder removeRule(int index) {
+ if (ruleBuilder_ == null) {
+ ensureRuleIsMutable();
+ rule_.remove(index);
+ onChanged();
+ } else {
+ ruleBuilder_.remove(index);
+ }
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * A lifecycle management rule, which is made of an action to take and the
+ * condition(s) under which the action will be taken.
+ *
+ *
+ * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1;
+ */
+ public com.google.storage.v2.Bucket.Lifecycle.Rule.Builder getRuleBuilder(int index) {
+ return getRuleFieldBuilder().getBuilder(index);
+ }
+ /**
+ *
+ *
+ *
+ * A lifecycle management rule, which is made of an action to take and the
+ * condition(s) under which the action will be taken.
+ *
+ *
+ * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1;
+ */
+ public com.google.storage.v2.Bucket.Lifecycle.RuleOrBuilder getRuleOrBuilder(int index) {
+ if (ruleBuilder_ == null) {
+ return rule_.get(index);
+ } else {
+ return ruleBuilder_.getMessageOrBuilder(index);
+ }
+ }
+ /**
+ *
+ *
+ *
+ * A lifecycle management rule, which is made of an action to take and the
+ * condition(s) under which the action will be taken.
+ *
+ *
+ * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1;
+ */
+ public java.util.List extends com.google.storage.v2.Bucket.Lifecycle.RuleOrBuilder>
+ getRuleOrBuilderList() {
+ if (ruleBuilder_ != null) {
+ return ruleBuilder_.getMessageOrBuilderList();
+ } else {
+ return java.util.Collections.unmodifiableList(rule_);
+ }
+ }
+ /**
+ *
+ *
+ *
+ * A lifecycle management rule, which is made of an action to take and the
+ * condition(s) under which the action will be taken.
+ *
+ *
+ * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1;
+ */
+ public com.google.storage.v2.Bucket.Lifecycle.Rule.Builder addRuleBuilder() {
+ return getRuleFieldBuilder()
+ .addBuilder(com.google.storage.v2.Bucket.Lifecycle.Rule.getDefaultInstance());
+ }
+ /**
+ *
+ *
+ *
+ * A lifecycle management rule, which is made of an action to take and the
+ * condition(s) under which the action will be taken.
+ *
+ *
+ * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1;
+ */
+ public com.google.storage.v2.Bucket.Lifecycle.Rule.Builder addRuleBuilder(int index) {
+ return getRuleFieldBuilder()
+ .addBuilder(index, com.google.storage.v2.Bucket.Lifecycle.Rule.getDefaultInstance());
+ }
+ /**
+ *
+ *
+ *
+ * A lifecycle management rule, which is made of an action to take and the
+ * condition(s) under which the action will be taken.
+ *
+ *
+ * repeated .google.storage.v2.Bucket.Lifecycle.Rule rule = 1;
+ */
+ public java.util.List
+ * The destination bucket where the current bucket's logs should be placed.
+ *
+ *
+ * string log_bucket = 1;
+ *
+ * @return The logBucket.
+ */
+ java.lang.String getLogBucket();
+ /**
+ *
+ *
+ *
+ * The destination bucket where the current bucket's logs should be placed.
+ *
+ *
+ * string log_bucket = 1;
+ *
+ * @return The bytes for logBucket.
+ */
+ com.google.protobuf.ByteString getLogBucketBytes();
+
+ /**
+ *
+ *
+ *
+ * A prefix for log object names.
+ *
+ *
+ * string log_object_prefix = 2;
+ *
+ * @return The logObjectPrefix.
+ */
+ java.lang.String getLogObjectPrefix();
+ /**
+ *
+ *
+ *
+ * A prefix for log object names.
+ *
+ *
+ * string log_object_prefix = 2;
+ *
+ * @return The bytes for logObjectPrefix.
+ */
+ com.google.protobuf.ByteString getLogObjectPrefixBytes();
+ }
+ /**
+ *
+ *
+ *
+ * Logging-related properties of a bucket.
+ *
+ *
+ * Protobuf type {@code google.storage.v2.Bucket.Logging}
+ */
+ public static final class Logging extends com.google.protobuf.GeneratedMessageV3
+ implements
+ // @@protoc_insertion_point(message_implements:google.storage.v2.Bucket.Logging)
+ LoggingOrBuilder {
+ private static final long serialVersionUID = 0L;
+ // Use Logging.newBuilder() to construct.
+ private Logging(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ super(builder);
+ }
+
+ private Logging() {
+ logBucket_ = "";
+ logObjectPrefix_ = "";
+ }
+
+ @java.lang.Override
+ @SuppressWarnings({"unused"})
+ protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
+ return new Logging();
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
+ return this.unknownFields;
+ }
+
+ private Logging(
+ 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();
+
+ logBucket_ = s;
+ break;
+ }
+ case 18:
+ {
+ java.lang.String s = input.readStringRequireUtf8();
+
+ logObjectPrefix_ = s;
+ break;
+ }
+ default:
+ {
+ if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+
+ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
+ return com.google.storage.v2.StorageProto
+ .internal_static_google_storage_v2_Bucket_Logging_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.storage.v2.StorageProto
+ .internal_static_google_storage_v2_Bucket_Logging_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.storage.v2.Bucket.Logging.class,
+ com.google.storage.v2.Bucket.Logging.Builder.class);
+ }
+
+ public static final int LOG_BUCKET_FIELD_NUMBER = 1;
+ private volatile java.lang.Object logBucket_;
+ /**
+ *
+ *
+ *
+ * The destination bucket where the current bucket's logs should be placed.
+ *
+ *
+ * string log_bucket = 1;
+ *
+ * @return The logBucket.
+ */
+ @java.lang.Override
+ public java.lang.String getLogBucket() {
+ java.lang.Object ref = logBucket_;
+ 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();
+ logBucket_ = s;
+ return s;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * The destination bucket where the current bucket's logs should be placed.
+ *
+ *
+ * string log_bucket = 1;
+ *
+ * @return The bytes for logBucket.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString getLogBucketBytes() {
+ java.lang.Object ref = logBucket_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ logBucket_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int LOG_OBJECT_PREFIX_FIELD_NUMBER = 2;
+ private volatile java.lang.Object logObjectPrefix_;
+ /**
+ *
+ *
+ *
+ * A prefix for log object names.
+ *
+ *
+ * string log_object_prefix = 2;
+ *
+ * @return The logObjectPrefix.
+ */
+ @java.lang.Override
+ public java.lang.String getLogObjectPrefix() {
+ java.lang.Object ref = logObjectPrefix_;
+ 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();
+ logObjectPrefix_ = s;
+ return s;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * A prefix for log object names.
+ *
+ *
+ * string log_object_prefix = 2;
+ *
+ * @return The bytes for logObjectPrefix.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString getLogObjectPrefixBytes() {
+ java.lang.Object ref = logObjectPrefix_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ logObjectPrefix_ = 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 (!getLogBucketBytes().isEmpty()) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 1, logBucket_);
+ }
+ if (!getLogObjectPrefixBytes().isEmpty()) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 2, logObjectPrefix_);
+ }
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (!getLogBucketBytes().isEmpty()) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, logBucket_);
+ }
+ if (!getLogObjectPrefixBytes().isEmpty()) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, logObjectPrefix_);
+ }
+ 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.storage.v2.Bucket.Logging)) {
+ return super.equals(obj);
+ }
+ com.google.storage.v2.Bucket.Logging other = (com.google.storage.v2.Bucket.Logging) obj;
+
+ if (!getLogBucket().equals(other.getLogBucket())) return false;
+ if (!getLogObjectPrefix().equals(other.getLogObjectPrefix())) 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) + LOG_BUCKET_FIELD_NUMBER;
+ hash = (53 * hash) + getLogBucket().hashCode();
+ hash = (37 * hash) + LOG_OBJECT_PREFIX_FIELD_NUMBER;
+ hash = (53 * hash) + getLogObjectPrefix().hashCode();
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.storage.v2.Bucket.Logging parseFrom(java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.storage.v2.Bucket.Logging parseFrom(
+ java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.storage.v2.Bucket.Logging parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.storage.v2.Bucket.Logging 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.storage.v2.Bucket.Logging parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.storage.v2.Bucket.Logging parseFrom(
+ byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.storage.v2.Bucket.Logging parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.storage.v2.Bucket.Logging 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.storage.v2.Bucket.Logging parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
+ }
+
+ public static com.google.storage.v2.Bucket.Logging 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.storage.v2.Bucket.Logging parseFrom(
+ com.google.protobuf.CodedInputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.storage.v2.Bucket.Logging 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.storage.v2.Bucket.Logging 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;
+ }
+ /**
+ *
+ *
+ *
+ * Logging-related properties of a bucket.
+ *
+ *
+ * Protobuf type {@code google.storage.v2.Bucket.Logging}
+ */
+ public static final class Builder
+ extends com.google.protobuf.GeneratedMessageV3.Builder
+ * The destination bucket where the current bucket's logs should be placed.
+ *
+ *
+ * string log_bucket = 1;
+ *
+ * @return The logBucket.
+ */
+ public java.lang.String getLogBucket() {
+ java.lang.Object ref = logBucket_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ logBucket_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * The destination bucket where the current bucket's logs should be placed.
+ *
+ *
+ * string log_bucket = 1;
+ *
+ * @return The bytes for logBucket.
+ */
+ public com.google.protobuf.ByteString getLogBucketBytes() {
+ java.lang.Object ref = logBucket_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ logBucket_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * The destination bucket where the current bucket's logs should be placed.
+ *
+ *
+ * string log_bucket = 1;
+ *
+ * @param value The logBucket to set.
+ * @return This builder for chaining.
+ */
+ public Builder setLogBucket(java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ logBucket_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * The destination bucket where the current bucket's logs should be placed.
+ *
+ *
+ * string log_bucket = 1;
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearLogBucket() {
+
+ logBucket_ = getDefaultInstance().getLogBucket();
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * The destination bucket where the current bucket's logs should be placed.
+ *
+ *
+ * string log_bucket = 1;
+ *
+ * @param value The bytes for logBucket to set.
+ * @return This builder for chaining.
+ */
+ public Builder setLogBucketBytes(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+
+ logBucket_ = value;
+ onChanged();
+ return this;
+ }
+
+ private java.lang.Object logObjectPrefix_ = "";
+ /**
+ *
+ *
+ *
+ * A prefix for log object names.
+ *
+ *
+ * string log_object_prefix = 2;
+ *
+ * @return The logObjectPrefix.
+ */
+ public java.lang.String getLogObjectPrefix() {
+ java.lang.Object ref = logObjectPrefix_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ logObjectPrefix_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * A prefix for log object names.
+ *
+ *
+ * string log_object_prefix = 2;
+ *
+ * @return The bytes for logObjectPrefix.
+ */
+ public com.google.protobuf.ByteString getLogObjectPrefixBytes() {
+ java.lang.Object ref = logObjectPrefix_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+ logObjectPrefix_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * A prefix for log object names.
+ *
+ *
+ * string log_object_prefix = 2;
+ *
+ * @param value The logObjectPrefix to set.
+ * @return This builder for chaining.
+ */
+ public Builder setLogObjectPrefix(java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ logObjectPrefix_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * A prefix for log object names.
+ *
+ *
+ * string log_object_prefix = 2;
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearLogObjectPrefix() {
+
+ logObjectPrefix_ = getDefaultInstance().getLogObjectPrefix();
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * A prefix for log object names.
+ *
+ *
+ * string log_object_prefix = 2;
+ *
+ * @param value The bytes for logObjectPrefix to set.
+ * @return This builder for chaining.
+ */
+ public Builder setLogObjectPrefixBytes(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+
+ logObjectPrefix_ = 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.storage.v2.Bucket.Logging)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.storage.v2.Bucket.Logging)
+ private static final com.google.storage.v2.Bucket.Logging DEFAULT_INSTANCE;
+
+ static {
+ DEFAULT_INSTANCE = new com.google.storage.v2.Bucket.Logging();
+ }
+
+ public static com.google.storage.v2.Bucket.Logging getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser
+ * Server-determined value that indicates the time from which policy was
+ * enforced and effective. This value is in
+ * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+ *
+ *
+ * .google.protobuf.Timestamp effective_time = 1;
+ *
+ * @return Whether the effectiveTime field is set.
+ */
+ boolean hasEffectiveTime();
+ /**
+ *
+ *
+ *
+ * Server-determined value that indicates the time from which policy was
+ * enforced and effective. This value is in
+ * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+ *
+ *
+ * .google.protobuf.Timestamp effective_time = 1;
+ *
+ * @return The effectiveTime.
+ */
+ com.google.protobuf.Timestamp getEffectiveTime();
+ /**
+ *
+ *
+ *
+ * Server-determined value that indicates the time from which policy was
+ * enforced and effective. This value is in
+ * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+ *
+ *
+ * .google.protobuf.Timestamp effective_time = 1;
+ */
+ com.google.protobuf.TimestampOrBuilder getEffectiveTimeOrBuilder();
+
+ /**
+ *
+ *
+ *
+ * Once locked, an object retention policy cannot be modified.
+ *
+ *
+ * bool is_locked = 2;
+ *
+ * @return The isLocked.
+ */
+ boolean getIsLocked();
+
+ /**
+ *
+ *
+ *
+ * The duration in seconds that objects need to be retained. Retention
+ * duration must be greater than zero and less than 100 years. Note that
+ * enforcement of retention periods less than a day is not guaranteed. Such
+ * periods should only be used for testing purposes.
+ *
+ *
+ * int64 retention_period = 3;
+ *
+ * @return The retentionPeriod.
+ */
+ long getRetentionPeriod();
+ }
+ /**
+ *
+ *
+ *
+ * Retention policy properties of a bucket.
+ *
+ *
+ * Protobuf type {@code google.storage.v2.Bucket.RetentionPolicy}
+ */
+ public static final class RetentionPolicy extends com.google.protobuf.GeneratedMessageV3
+ implements
+ // @@protoc_insertion_point(message_implements:google.storage.v2.Bucket.RetentionPolicy)
+ RetentionPolicyOrBuilder {
+ private static final long serialVersionUID = 0L;
+ // Use RetentionPolicy.newBuilder() to construct.
+ private RetentionPolicy(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ super(builder);
+ }
+
+ private RetentionPolicy() {}
+
+ @java.lang.Override
+ @SuppressWarnings({"unused"})
+ protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
+ return new RetentionPolicy();
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
+ return this.unknownFields;
+ }
+
+ private RetentionPolicy(
+ 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.protobuf.Timestamp.Builder subBuilder = null;
+ if (effectiveTime_ != null) {
+ subBuilder = effectiveTime_.toBuilder();
+ }
+ effectiveTime_ =
+ input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom(effectiveTime_);
+ effectiveTime_ = subBuilder.buildPartial();
+ }
+
+ break;
+ }
+ case 16:
+ {
+ isLocked_ = input.readBool();
+ break;
+ }
+ case 24:
+ {
+ retentionPeriod_ = input.readInt64();
+ break;
+ }
+ default:
+ {
+ if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+
+ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
+ return com.google.storage.v2.StorageProto
+ .internal_static_google_storage_v2_Bucket_RetentionPolicy_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.storage.v2.StorageProto
+ .internal_static_google_storage_v2_Bucket_RetentionPolicy_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.storage.v2.Bucket.RetentionPolicy.class,
+ com.google.storage.v2.Bucket.RetentionPolicy.Builder.class);
+ }
+
+ public static final int EFFECTIVE_TIME_FIELD_NUMBER = 1;
+ private com.google.protobuf.Timestamp effectiveTime_;
+ /**
+ *
+ *
+ *
+ * Server-determined value that indicates the time from which policy was
+ * enforced and effective. This value is in
+ * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+ *
+ *
+ * .google.protobuf.Timestamp effective_time = 1;
+ *
+ * @return Whether the effectiveTime field is set.
+ */
+ @java.lang.Override
+ public boolean hasEffectiveTime() {
+ return effectiveTime_ != null;
+ }
+ /**
+ *
+ *
+ *
+ * Server-determined value that indicates the time from which policy was
+ * enforced and effective. This value is in
+ * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+ *
+ *
+ * .google.protobuf.Timestamp effective_time = 1;
+ *
+ * @return The effectiveTime.
+ */
+ @java.lang.Override
+ public com.google.protobuf.Timestamp getEffectiveTime() {
+ return effectiveTime_ == null
+ ? com.google.protobuf.Timestamp.getDefaultInstance()
+ : effectiveTime_;
+ }
+ /**
+ *
+ *
+ *
+ * Server-determined value that indicates the time from which policy was
+ * enforced and effective. This value is in
+ * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+ *
+ *
+ * .google.protobuf.Timestamp effective_time = 1;
+ */
+ @java.lang.Override
+ public com.google.protobuf.TimestampOrBuilder getEffectiveTimeOrBuilder() {
+ return getEffectiveTime();
+ }
+
+ public static final int IS_LOCKED_FIELD_NUMBER = 2;
+ private boolean isLocked_;
+ /**
+ *
+ *
+ *
+ * Once locked, an object retention policy cannot be modified.
+ *
+ *
+ * bool is_locked = 2;
+ *
+ * @return The isLocked.
+ */
+ @java.lang.Override
+ public boolean getIsLocked() {
+ return isLocked_;
+ }
+
+ public static final int RETENTION_PERIOD_FIELD_NUMBER = 3;
+ private long retentionPeriod_;
+ /**
+ *
+ *
+ *
+ * The duration in seconds that objects need to be retained. Retention
+ * duration must be greater than zero and less than 100 years. Note that
+ * enforcement of retention periods less than a day is not guaranteed. Such
+ * periods should only be used for testing purposes.
+ *
+ *
+ * int64 retention_period = 3;
+ *
+ * @return The retentionPeriod.
+ */
+ @java.lang.Override
+ public long getRetentionPeriod() {
+ return retentionPeriod_;
+ }
+
+ 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 (effectiveTime_ != null) {
+ output.writeMessage(1, getEffectiveTime());
+ }
+ if (isLocked_ != false) {
+ output.writeBool(2, isLocked_);
+ }
+ if (retentionPeriod_ != 0L) {
+ output.writeInt64(3, retentionPeriod_);
+ }
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (effectiveTime_ != null) {
+ size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getEffectiveTime());
+ }
+ if (isLocked_ != false) {
+ size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, isLocked_);
+ }
+ if (retentionPeriod_ != 0L) {
+ size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, retentionPeriod_);
+ }
+ 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.storage.v2.Bucket.RetentionPolicy)) {
+ return super.equals(obj);
+ }
+ com.google.storage.v2.Bucket.RetentionPolicy other =
+ (com.google.storage.v2.Bucket.RetentionPolicy) obj;
+
+ if (hasEffectiveTime() != other.hasEffectiveTime()) return false;
+ if (hasEffectiveTime()) {
+ if (!getEffectiveTime().equals(other.getEffectiveTime())) return false;
+ }
+ if (getIsLocked() != other.getIsLocked()) return false;
+ if (getRetentionPeriod() != other.getRetentionPeriod()) 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 (hasEffectiveTime()) {
+ hash = (37 * hash) + EFFECTIVE_TIME_FIELD_NUMBER;
+ hash = (53 * hash) + getEffectiveTime().hashCode();
+ }
+ hash = (37 * hash) + IS_LOCKED_FIELD_NUMBER;
+ hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIsLocked());
+ hash = (37 * hash) + RETENTION_PERIOD_FIELD_NUMBER;
+ hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getRetentionPeriod());
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.storage.v2.Bucket.RetentionPolicy parseFrom(java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.storage.v2.Bucket.RetentionPolicy parseFrom(
+ java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.storage.v2.Bucket.RetentionPolicy parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.storage.v2.Bucket.RetentionPolicy 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.storage.v2.Bucket.RetentionPolicy parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.storage.v2.Bucket.RetentionPolicy parseFrom(
+ byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.storage.v2.Bucket.RetentionPolicy parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.storage.v2.Bucket.RetentionPolicy 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.storage.v2.Bucket.RetentionPolicy parseDelimitedFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
+ }
+
+ public static com.google.storage.v2.Bucket.RetentionPolicy 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.storage.v2.Bucket.RetentionPolicy parseFrom(
+ com.google.protobuf.CodedInputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.storage.v2.Bucket.RetentionPolicy 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.storage.v2.Bucket.RetentionPolicy 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;
+ }
+ /**
+ *
+ *
+ *
+ * Retention policy properties of a bucket.
+ *
+ *
+ * Protobuf type {@code google.storage.v2.Bucket.RetentionPolicy}
+ */
+ public static final class Builder
+ extends com.google.protobuf.GeneratedMessageV3.Builder
+ * Server-determined value that indicates the time from which policy was
+ * enforced and effective. This value is in
+ * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+ *
+ *
+ * .google.protobuf.Timestamp effective_time = 1;
+ *
+ * @return Whether the effectiveTime field is set.
+ */
+ public boolean hasEffectiveTime() {
+ return effectiveTimeBuilder_ != null || effectiveTime_ != null;
+ }
+ /**
+ *
+ *
+ *
+ * Server-determined value that indicates the time from which policy was
+ * enforced and effective. This value is in
+ * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+ *
+ *
+ * .google.protobuf.Timestamp effective_time = 1;
+ *
+ * @return The effectiveTime.
+ */
+ public com.google.protobuf.Timestamp getEffectiveTime() {
+ if (effectiveTimeBuilder_ == null) {
+ return effectiveTime_ == null
+ ? com.google.protobuf.Timestamp.getDefaultInstance()
+ : effectiveTime_;
+ } else {
+ return effectiveTimeBuilder_.getMessage();
+ }
+ }
+ /**
+ *
+ *
+ *
+ * Server-determined value that indicates the time from which policy was
+ * enforced and effective. This value is in
+ * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+ *
+ *
+ * .google.protobuf.Timestamp effective_time = 1;
+ */
+ public Builder setEffectiveTime(com.google.protobuf.Timestamp value) {
+ if (effectiveTimeBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ effectiveTime_ = value;
+ onChanged();
+ } else {
+ effectiveTimeBuilder_.setMessage(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * Server-determined value that indicates the time from which policy was
+ * enforced and effective. This value is in
+ * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+ *
+ *
+ * .google.protobuf.Timestamp effective_time = 1;
+ */
+ public Builder setEffectiveTime(com.google.protobuf.Timestamp.Builder builderForValue) {
+ if (effectiveTimeBuilder_ == null) {
+ effectiveTime_ = builderForValue.build();
+ onChanged();
+ } else {
+ effectiveTimeBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * Server-determined value that indicates the time from which policy was
+ * enforced and effective. This value is in
+ * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+ *
+ *
+ * .google.protobuf.Timestamp effective_time = 1;
+ */
+ public Builder mergeEffectiveTime(com.google.protobuf.Timestamp value) {
+ if (effectiveTimeBuilder_ == null) {
+ if (effectiveTime_ != null) {
+ effectiveTime_ =
+ com.google.protobuf.Timestamp.newBuilder(effectiveTime_)
+ .mergeFrom(value)
+ .buildPartial();
+ } else {
+ effectiveTime_ = value;
+ }
+ onChanged();
+ } else {
+ effectiveTimeBuilder_.mergeFrom(value);
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * Server-determined value that indicates the time from which policy was
+ * enforced and effective. This value is in
+ * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+ *
+ *
+ * .google.protobuf.Timestamp effective_time = 1;
+ */
+ public Builder clearEffectiveTime() {
+ if (effectiveTimeBuilder_ == null) {
+ effectiveTime_ = null;
+ onChanged();
+ } else {
+ effectiveTime_ = null;
+ effectiveTimeBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * Server-determined value that indicates the time from which policy was
+ * enforced and effective. This value is in
+ * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+ *
+ *
+ * .google.protobuf.Timestamp effective_time = 1;
+ */
+ public com.google.protobuf.Timestamp.Builder getEffectiveTimeBuilder() {
+
+ onChanged();
+ return getEffectiveTimeFieldBuilder().getBuilder();
+ }
+ /**
+ *
+ *
+ *
+ * Server-determined value that indicates the time from which policy was
+ * enforced and effective. This value is in
+ * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+ *
+ *
+ * .google.protobuf.Timestamp effective_time = 1;
+ */
+ public com.google.protobuf.TimestampOrBuilder getEffectiveTimeOrBuilder() {
+ if (effectiveTimeBuilder_ != null) {
+ return effectiveTimeBuilder_.getMessageOrBuilder();
+ } else {
+ return effectiveTime_ == null
+ ? com.google.protobuf.Timestamp.getDefaultInstance()
+ : effectiveTime_;
+ }
+ }
+ /**
+ *
+ *
+ *
+ * Server-determined value that indicates the time from which policy was
+ * enforced and effective. This value is in
+ * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+ *
+ *
+ * .google.protobuf.Timestamp effective_time = 1;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.protobuf.Timestamp,
+ com.google.protobuf.Timestamp.Builder,
+ com.google.protobuf.TimestampOrBuilder>
+ getEffectiveTimeFieldBuilder() {
+ if (effectiveTimeBuilder_ == null) {
+ effectiveTimeBuilder_ =
+ new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.protobuf.Timestamp,
+ com.google.protobuf.Timestamp.Builder,
+ com.google.protobuf.TimestampOrBuilder>(
+ getEffectiveTime(), getParentForChildren(), isClean());
+ effectiveTime_ = null;
+ }
+ return effectiveTimeBuilder_;
+ }
+
+ private boolean isLocked_;
+ /**
+ *
+ *
+ *
+ * Once locked, an object retention policy cannot be modified.
+ *
+ *
+ * bool is_locked = 2;
+ *
+ * @return The isLocked.
+ */
+ @java.lang.Override
+ public boolean getIsLocked() {
+ return isLocked_;
+ }
+ /**
+ *
+ *
+ *
+ * Once locked, an object retention policy cannot be modified.
+ *
+ *
+ * bool is_locked = 2;
+ *
+ * @param value The isLocked to set.
+ * @return This builder for chaining.
+ */
+ public Builder setIsLocked(boolean value) {
+
+ isLocked_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * Once locked, an object retention policy cannot be modified.
+ *
+ *
+ * bool is_locked = 2;
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearIsLocked() {
+
+ isLocked_ = false;
+ onChanged();
+ return this;
+ }
+
+ private long retentionPeriod_;
+ /**
+ *
+ *
+ *
+ * The duration in seconds that objects need to be retained. Retention
+ * duration must be greater than zero and less than 100 years. Note that
+ * enforcement of retention periods less than a day is not guaranteed. Such
+ * periods should only be used for testing purposes.
+ *
+ *
+ * int64 retention_period = 3;
+ *
+ * @return The retentionPeriod.
+ */
+ @java.lang.Override
+ public long getRetentionPeriod() {
+ return retentionPeriod_;
+ }
+ /**
+ *
+ *
+ *
+ * The duration in seconds that objects need to be retained. Retention
+ * duration must be greater than zero and less than 100 years. Note that
+ * enforcement of retention periods less than a day is not guaranteed. Such
+ * periods should only be used for testing purposes.
+ *
+ *
+ * int64 retention_period = 3;
+ *
+ * @param value The retentionPeriod to set.
+ * @return This builder for chaining.
+ */
+ public Builder setRetentionPeriod(long value) {
+
+ retentionPeriod_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * The duration in seconds that objects need to be retained. Retention
+ * duration must be greater than zero and less than 100 years. Note that
+ * enforcement of retention periods less than a day is not guaranteed. Such
+ * periods should only be used for testing purposes.
+ *
+ *
+ * int64 retention_period = 3;
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearRetentionPeriod() {
+
+ retentionPeriod_ = 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.storage.v2.Bucket.RetentionPolicy)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.storage.v2.Bucket.RetentionPolicy)
+ private static final com.google.storage.v2.Bucket.RetentionPolicy DEFAULT_INSTANCE;
+
+ static {
+ DEFAULT_INSTANCE = new com.google.storage.v2.Bucket.RetentionPolicy();
+ }
+
+ public static com.google.storage.v2.Bucket.RetentionPolicy getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser
+ * While set to true, versioning is fully enabled for this bucket.
+ *
+ *
+ * bool enabled = 1;
+ *
+ * @return The enabled.
+ */
+ boolean getEnabled();
+ }
+ /**
+ *
+ *
+ *
+ * Properties of a bucket related to versioning.
+ * For more on Cloud Storage versioning, see
+ * https://cloud.google.com/storage/docs/object-versioning.
+ *
+ *
+ * Protobuf type {@code google.storage.v2.Bucket.Versioning}
+ */
+ public static final class Versioning extends com.google.protobuf.GeneratedMessageV3
+ implements
+ // @@protoc_insertion_point(message_implements:google.storage.v2.Bucket.Versioning)
+ VersioningOrBuilder {
+ private static final long serialVersionUID = 0L;
+ // Use Versioning.newBuilder() to construct.
+ private Versioning(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ super(builder);
+ }
+
+ private Versioning() {}
+
+ @java.lang.Override
+ @SuppressWarnings({"unused"})
+ protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
+ return new Versioning();
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
+ return this.unknownFields;
+ }
+
+ private Versioning(
+ 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:
+ {
+ enabled_ = input.readBool();
+ break;
+ }
+ default:
+ {
+ if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
+ done = true;
+ }
+ break;
+ }
+ }
+ }
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(this);
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
+ } finally {
+ this.unknownFields = unknownFields.build();
+ makeExtensionsImmutable();
+ }
+ }
+
+ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
+ return com.google.storage.v2.StorageProto
+ .internal_static_google_storage_v2_Bucket_Versioning_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return com.google.storage.v2.StorageProto
+ .internal_static_google_storage_v2_Bucket_Versioning_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ com.google.storage.v2.Bucket.Versioning.class,
+ com.google.storage.v2.Bucket.Versioning.Builder.class);
+ }
+
+ public static final int ENABLED_FIELD_NUMBER = 1;
+ private boolean enabled_;
+ /**
+ *
+ *
+ *
+ * While set to true, versioning is fully enabled for this bucket.
+ *
+ *
+ * bool enabled = 1;
+ *
+ * @return The enabled.
+ */
+ @java.lang.Override
+ public boolean getEnabled() {
+ return enabled_;
+ }
+
+ 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 (enabled_ != false) {
+ output.writeBool(1, enabled_);
+ }
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (enabled_ != false) {
+ size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, enabled_);
+ }
+ 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.storage.v2.Bucket.Versioning)) {
+ return super.equals(obj);
+ }
+ com.google.storage.v2.Bucket.Versioning other = (com.google.storage.v2.Bucket.Versioning) obj;
+
+ if (getEnabled() != other.getEnabled()) 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) + ENABLED_FIELD_NUMBER;
+ hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnabled());
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.storage.v2.Bucket.Versioning parseFrom(java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.storage.v2.Bucket.Versioning parseFrom(
+ java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.storage.v2.Bucket.Versioning parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.storage.v2.Bucket.Versioning 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.storage.v2.Bucket.Versioning parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+
+ public static com.google.storage.v2.Bucket.Versioning parseFrom(
+ byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+
+ public static com.google.storage.v2.Bucket.Versioning parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.storage.v2.Bucket.Versioning 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.storage.v2.Bucket.Versioning parseDelimitedFrom(
+ java.io.InputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
+ }
+
+ public static com.google.storage.v2.Bucket.Versioning 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.storage.v2.Bucket.Versioning parseFrom(
+ com.google.protobuf.CodedInputStream input) throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
+ }
+
+ public static com.google.storage.v2.Bucket.Versioning 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.storage.v2.Bucket.Versioning 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;
+ }
+ /**
+ *
+ *
+ *
+ * Properties of a bucket related to versioning.
+ * For more on Cloud Storage versioning, see
+ * https://cloud.google.com/storage/docs/object-versioning.
+ *
+ *
+ * Protobuf type {@code google.storage.v2.Bucket.Versioning}
+ */
+ public static final class Builder
+ extends com.google.protobuf.GeneratedMessageV3.Builder
+ * While set to true, versioning is fully enabled for this bucket.
+ *
+ *
+ * bool enabled = 1;
+ *
+ * @return The enabled.
+ */
+ @java.lang.Override
+ public boolean getEnabled() {
+ return enabled_;
+ }
+ /**
+ *
+ *
+ *
+ * While set to true, versioning is fully enabled for this bucket.
+ *
+ *
+ * bool enabled = 1;
+ *
+ * @param value The enabled to set.
+ * @return This builder for chaining.
+ */
+ public Builder setEnabled(boolean value) {
+
+ enabled_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ *
+ * While set to true, versioning is fully enabled for this bucket.
+ *
+ *
+ * bool enabled = 1;
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearEnabled() {
+
+ enabled_ = 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.storage.v2.Bucket.Versioning)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.storage.v2.Bucket.Versioning)
+ private static final com.google.storage.v2.Bucket.Versioning DEFAULT_INSTANCE;
+
+ static {
+ DEFAULT_INSTANCE = new com.google.storage.v2.Bucket.Versioning();
+ }
+
+ public static com.google.storage.v2.Bucket.Versioning getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser