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

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

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

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

This class can be customized by passing in a custom instance of 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 stream = storageClient.readObjectCallable().call(request);
+   *   for (ReadObjectResponse response : stream) {
+   *     // Do something when a response is received.
+   *   }
+   * }
+   * }
+ */ + public final ServerStreamingCallable readObjectCallable() { + return stub.readObjectCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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. + * + *

Sample code: + * + *

{@code
+   * try (StorageClient storageClient = StorageClient.create()) {
+   *   ApiStreamObserver responseObserver =
+   *       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);
+   * }
+   * }
+ */ + public final ClientStreamingCallable + writeObjectCallable() { + return stub.writeObjectCallable(); + } + + // 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();
+   *   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 future =
+   *       storageClient.startResumableWriteCallable().futureCall(request);
+   *   // Do something.
+   *   StartResumableWriteResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + startResumableWriteCallable() { + return stub.startResumableWriteCallable(); + } + + // 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()) {
+   *   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 future =
+   *       storageClient.queryWriteStatusCallable().futureCall(request);
+   *   // Do something.
+   *   QueryWriteStatusResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + queryWriteStatusCallable() { + return stub.queryWriteStatusCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } +} diff --git a/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageSettings.java b/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageSettings.java new file mode 100644 index 0000000000..1ca8da9b36 --- /dev/null +++ b/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageSettings.java @@ -0,0 +1,217 @@ +/* + * 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.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.storage.v2.stub.StorageStubSettings; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link StorageClient}. + * + *

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

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

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

For example, to set the total timeout of 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 { + + /** Returns the object with the settings used for calls to readObject. */ + public ServerStreamingCallSettings readObjectSettings() { + return ((StorageStubSettings) getStubSettings()).readObjectSettings(); + } + + /** Returns the object with the settings used for calls to writeObject. */ + public StreamingCallSettings writeObjectSettings() { + return ((StorageStubSettings) getStubSettings()).writeObjectSettings(); + } + + /** Returns the object with the settings used for calls to startResumableWrite. */ + public UnaryCallSettings + startResumableWriteSettings() { + return ((StorageStubSettings) getStubSettings()).startResumableWriteSettings(); + } + + /** Returns the object with the settings used for calls to queryWriteStatus. */ + public UnaryCallSettings + queryWriteStatusSettings() { + return ((StorageStubSettings) getStubSettings()).queryWriteStatusSettings(); + } + + public static final StorageSettings create(StorageStubSettings stub) throws IOException { + return new StorageSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return StorageStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return StorageStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return StorageStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return StorageStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return StorageStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return StorageStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return StorageStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected StorageSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for StorageSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(StorageStubSettings.newBuilder(clientContext)); + } + + protected Builder(StorageSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(StorageStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(StorageStubSettings.newBuilder()); + } + + public StorageStubSettings.Builder getStubSettingsBuilder() { + return ((StorageStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to readObject. */ + public ServerStreamingCallSettings.Builder + readObjectSettings() { + return getStubSettingsBuilder().readObjectSettings(); + } + + /** Returns the builder for the settings used for calls to writeObject. */ + public StreamingCallSettings.Builder + writeObjectSettings() { + return getStubSettingsBuilder().writeObjectSettings(); + } + + /** Returns the builder for the settings used for calls to startResumableWrite. */ + public UnaryCallSettings.Builder + startResumableWriteSettings() { + return getStubSettingsBuilder().startResumableWriteSettings(); + } + + /** Returns the builder for the settings used for calls to queryWriteStatus. */ + public UnaryCallSettings.Builder + queryWriteStatusSettings() { + return getStubSettingsBuilder().queryWriteStatusSettings(); + } + + @Override + public StorageSettings build() throws IOException { + return new StorageSettings(this); + } + } +} diff --git a/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/package-info.java b/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/package-info.java new file mode 100644 index 0000000000..bfb389cc80 --- /dev/null +++ b/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/package-info.java @@ -0,0 +1,41 @@ +/* + * 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. + */ + +/** + * The interfaces provided are listed below, along with usage samples. + * + *

======================= StorageClient ======================= + * + *

Service Description: Manages Google Cloud Storage resources. + * + *

Sample for StorageClient: + * + *

{@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. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcStorageCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/GrpcStorageStub.java b/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/GrpcStorageStub.java new file mode 100644 index 0000000000..3097e32c82 --- /dev/null +++ b/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/GrpcStorageStub.java @@ -0,0 +1,237 @@ +/* + * 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.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.storage.v2.QueryWriteStatusRequest; +import com.google.storage.v2.QueryWriteStatusResponse; +import com.google.storage.v2.ReadObjectRequest; +import com.google.storage.v2.ReadObjectResponse; +import com.google.storage.v2.StartResumableWriteRequest; +import com.google.storage.v2.StartResumableWriteResponse; +import com.google.storage.v2.WriteObjectRequest; +import com.google.storage.v2.WriteObjectResponse; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the Storage service API. + * + *

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 + readObjectMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName("google.storage.v2.Storage/ReadObject") + .setRequestMarshaller(ProtoUtils.marshaller(ReadObjectRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ReadObjectResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + writeObjectMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.CLIENT_STREAMING) + .setFullMethodName("google.storage.v2.Storage/WriteObject") + .setRequestMarshaller(ProtoUtils.marshaller(WriteObjectRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(WriteObjectResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + startResumableWriteMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.storage.v2.Storage/StartResumableWrite") + .setRequestMarshaller( + ProtoUtils.marshaller(StartResumableWriteRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(StartResumableWriteResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + queryWriteStatusMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.storage.v2.Storage/QueryWriteStatus") + .setRequestMarshaller( + ProtoUtils.marshaller(QueryWriteStatusRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(QueryWriteStatusResponse.getDefaultInstance())) + .build(); + + private final ServerStreamingCallable readObjectCallable; + private final ClientStreamingCallable + writeObjectCallable; + private final UnaryCallable + startResumableWriteCallable; + private final UnaryCallable + queryWriteStatusCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcStorageStub create(StorageStubSettings settings) throws IOException { + return new GrpcStorageStub(settings, ClientContext.create(settings)); + } + + public static final GrpcStorageStub create(ClientContext clientContext) throws IOException { + return new GrpcStorageStub(StorageStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcStorageStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcStorageStub( + StorageStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcStorageStub, 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 GrpcStorageStub(StorageStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcStorageCallableFactory()); + } + + /** + * Constructs an instance of GrpcStorageStub, 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 GrpcStorageStub( + StorageStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings readObjectTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(readObjectMethodDescriptor) + .build(); + GrpcCallSettings writeObjectTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(writeObjectMethodDescriptor) + .build(); + GrpcCallSettings + startResumableWriteTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(startResumableWriteMethodDescriptor) + .build(); + GrpcCallSettings + queryWriteStatusTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(queryWriteStatusMethodDescriptor) + .build(); + + this.readObjectCallable = + callableFactory.createServerStreamingCallable( + readObjectTransportSettings, settings.readObjectSettings(), clientContext); + this.writeObjectCallable = + callableFactory.createClientStreamingCallable( + writeObjectTransportSettings, settings.writeObjectSettings(), clientContext); + this.startResumableWriteCallable = + callableFactory.createUnaryCallable( + startResumableWriteTransportSettings, + settings.startResumableWriteSettings(), + clientContext); + this.queryWriteStatusCallable = + callableFactory.createUnaryCallable( + queryWriteStatusTransportSettings, settings.queryWriteStatusSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public ServerStreamingCallable readObjectCallable() { + return readObjectCallable; + } + + @Override + public ClientStreamingCallable writeObjectCallable() { + return writeObjectCallable; + } + + @Override + public UnaryCallable + startResumableWriteCallable() { + return startResumableWriteCallable; + } + + @Override + public UnaryCallable + queryWriteStatusCallable() { + return queryWriteStatusCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/StorageStub.java b/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/StorageStub.java new file mode 100644 index 0000000000..06ee713906 --- /dev/null +++ b/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/StorageStub.java @@ -0,0 +1,62 @@ +/* + * 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.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.QueryWriteStatusRequest; +import com.google.storage.v2.QueryWriteStatusResponse; +import com.google.storage.v2.ReadObjectRequest; +import com.google.storage.v2.ReadObjectResponse; +import com.google.storage.v2.StartResumableWriteRequest; +import com.google.storage.v2.StartResumableWriteResponse; +import com.google.storage.v2.WriteObjectRequest; +import com.google.storage.v2.WriteObjectResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the Storage service API. + * + *

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 readObjectCallable() { + throw new UnsupportedOperationException("Not implemented: readObjectCallable()"); + } + + public ClientStreamingCallable writeObjectCallable() { + throw new UnsupportedOperationException("Not implemented: writeObjectCallable()"); + } + + public UnaryCallable + startResumableWriteCallable() { + throw new UnsupportedOperationException("Not implemented: startResumableWriteCallable()"); + } + + public UnaryCallable + queryWriteStatusCallable() { + throw new UnsupportedOperationException("Not implemented: queryWriteStatusCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/StorageStubSettings.java b/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/StorageStubSettings.java new file mode 100644 index 0000000000..7a10ecf5e4 --- /dev/null +++ b/gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/StorageStubSettings.java @@ -0,0 +1,356 @@ +/* + * 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.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.storage.v2.QueryWriteStatusRequest; +import com.google.storage.v2.QueryWriteStatusResponse; +import com.google.storage.v2.ReadObjectRequest; +import com.google.storage.v2.ReadObjectResponse; +import com.google.storage.v2.StartResumableWriteRequest; +import com.google.storage.v2.StartResumableWriteResponse; +import com.google.storage.v2.WriteObjectRequest; +import com.google.storage.v2.WriteObjectResponse; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link StorageStub}. + * + *

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

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

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

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

{@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 { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder() + .add("https://www.googleapis.com/auth/cloud-platform") + .add("https://www.googleapis.com/auth/cloud-platform.read-only") + .add("https://www.googleapis.com/auth/devstorage.full_control") + .add("https://www.googleapis.com/auth/devstorage.read_only") + .add("https://www.googleapis.com/auth/devstorage.read_write") + .build(); + + private final ServerStreamingCallSettings + readObjectSettings; + private final StreamingCallSettings writeObjectSettings; + private final UnaryCallSettings + startResumableWriteSettings; + private final UnaryCallSettings + queryWriteStatusSettings; + + /** Returns the object with the settings used for calls to readObject. */ + public ServerStreamingCallSettings readObjectSettings() { + return readObjectSettings; + } + + /** Returns the object with the settings used for calls to writeObject. */ + public StreamingCallSettings writeObjectSettings() { + return writeObjectSettings; + } + + /** Returns the object with the settings used for calls to startResumableWrite. */ + public UnaryCallSettings + startResumableWriteSettings() { + return startResumableWriteSettings; + } + + /** Returns the object with the settings used for calls to queryWriteStatus. */ + public UnaryCallSettings + queryWriteStatusSettings() { + return queryWriteStatusSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public StorageStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcStorageStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "storage.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "storage.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(StorageStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected StorageStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + readObjectSettings = settingsBuilder.readObjectSettings().build(); + writeObjectSettings = settingsBuilder.writeObjectSettings().build(); + startResumableWriteSettings = settingsBuilder.startResumableWriteSettings().build(); + queryWriteStatusSettings = settingsBuilder.queryWriteStatusSettings().build(); + } + + /** Builder for StorageStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final ServerStreamingCallSettings.Builder + readObjectSettings; + private final StreamingCallSettings.Builder + writeObjectSettings; + private final UnaryCallSettings.Builder + startResumableWriteSettings; + private final UnaryCallSettings.Builder + queryWriteStatusSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + readObjectSettings = ServerStreamingCallSettings.newBuilder(); + writeObjectSettings = StreamingCallSettings.newBuilder(); + startResumableWriteSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + queryWriteStatusSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + startResumableWriteSettings, queryWriteStatusSettings); + initDefaults(this); + } + + protected Builder(StorageStubSettings settings) { + super(settings); + + readObjectSettings = settings.readObjectSettings.toBuilder(); + writeObjectSettings = settings.writeObjectSettings.toBuilder(); + startResumableWriteSettings = settings.startResumableWriteSettings.toBuilder(); + queryWriteStatusSettings = settings.queryWriteStatusSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + startResumableWriteSettings, queryWriteStatusSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .readObjectSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .startResumableWriteSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .queryWriteStatusSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to readObject. */ + public ServerStreamingCallSettings.Builder + readObjectSettings() { + return readObjectSettings; + } + + /** Returns the builder for the settings used for calls to writeObject. */ + public StreamingCallSettings.Builder + writeObjectSettings() { + return writeObjectSettings; + } + + /** Returns the builder for the settings used for calls to startResumableWrite. */ + public UnaryCallSettings.Builder + startResumableWriteSettings() { + return startResumableWriteSettings; + } + + /** Returns the builder for the settings used for calls to queryWriteStatus. */ + public UnaryCallSettings.Builder + queryWriteStatusSettings() { + return queryWriteStatusSettings; + } + + @Override + public StorageStubSettings build() throws IOException { + return new StorageStubSettings(this); + } + } +} diff --git a/gapic-google-cloud-storage-v2/src/main/resources/com/google/storage/v2/gapic_metadata.json b/gapic-google-cloud-storage-v2/src/main/resources/com/google/storage/v2/gapic_metadata.json new file mode 100644 index 0000000000..a9899e16f9 --- /dev/null +++ b/gapic-google-cloud-storage-v2/src/main/resources/com/google/storage/v2/gapic_metadata.json @@ -0,0 +1,30 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.storage.v2", + "libraryPackage": "com.google.storage.v2", + "services": { + "Storage": { + "clients": { + "grpc": { + "libraryClient": "StorageClient", + "rpcs": { + "QueryWriteStatus": { + "methods": ["queryWriteStatus", "queryWriteStatus", "queryWriteStatusCallable"] + }, + "ReadObject": { + "methods": ["readObjectCallable"] + }, + "StartResumableWrite": { + "methods": ["startResumableWrite", "startResumableWriteCallable"] + }, + "WriteObject": { + "methods": ["writeObjectCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/gapic-google-cloud-storage-v2/src/test/java/com/google/storage/v2/MockStorage.java b/gapic-google-cloud-storage-v2/src/test/java/com/google/storage/v2/MockStorage.java new file mode 100644 index 0000000000..dbaae70d75 --- /dev/null +++ b/gapic-google-cloud-storage-v2/src/test/java/com/google/storage/v2/MockStorage.java @@ -0,0 +1,59 @@ +/* + * 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.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockStorage implements MockGrpcService { + private final MockStorageImpl serviceImpl; + + public MockStorage() { + serviceImpl = new MockStorageImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/gapic-google-cloud-storage-v2/src/test/java/com/google/storage/v2/MockStorageImpl.java b/gapic-google-cloud-storage-v2/src/test/java/com/google/storage/v2/MockStorageImpl.java new file mode 100644 index 0000000000..a2787a85bd --- /dev/null +++ b/gapic-google-cloud-storage-v2/src/test/java/com/google/storage/v2/MockStorageImpl.java @@ -0,0 +1,161 @@ +/* + * 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.protobuf.AbstractMessage; +import com.google.storage.v2.StorageGrpc.StorageImplBase; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockStorageImpl extends StorageImplBase { + private List requests; + private Queue responses; + + public MockStorageImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void readObject( + ReadObjectRequest request, StreamObserver responseObserver) { + java.lang.Object response = responses.poll(); + if (response instanceof ReadObjectResponse) { + requests.add(request); + responseObserver.onNext(((ReadObjectResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ReadObject, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ReadObjectResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public StreamObserver writeObject( + final StreamObserver responseObserver) { + StreamObserver requestObserver = + new StreamObserver() { + @Override + public void onNext(WriteObjectRequest value) { + requests.add(value); + final java.lang.Object response = responses.remove(); + if (response instanceof WriteObjectResponse) { + responseObserver.onNext(((WriteObjectResponse) response)); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method WriteObject, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + WriteObjectResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void onError(Throwable t) { + responseObserver.onError(t); + } + + @Override + public void onCompleted() { + responseObserver.onCompleted(); + } + }; + return requestObserver; + } + + @Override + public void startResumableWrite( + StartResumableWriteRequest request, + StreamObserver responseObserver) { + java.lang.Object response = responses.poll(); + if (response instanceof StartResumableWriteResponse) { + requests.add(request); + responseObserver.onNext(((StartResumableWriteResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method StartResumableWrite, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + StartResumableWriteResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void queryWriteStatus( + QueryWriteStatusRequest request, StreamObserver responseObserver) { + java.lang.Object response = responses.poll(); + if (response instanceof QueryWriteStatusResponse) { + requests.add(request); + responseObserver.onNext(((QueryWriteStatusResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method QueryWriteStatus, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + QueryWriteStatusResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/gapic-google-cloud-storage-v2/src/test/java/com/google/storage/v2/StorageClientTest.java b/gapic-google-cloud-storage-v2/src/test/java/com/google/storage/v2/StorageClientTest.java new file mode 100644 index 0000000000..6374e98e7a --- /dev/null +++ b/gapic-google-cloud-storage-v2/src/test/java/com/google/storage/v2/StorageClientTest.java @@ -0,0 +1,301 @@ +/* + * 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.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.grpc.testing.MockStreamObserver; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiStreamObserver; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StatusCode; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.FieldMask; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class StorageClientTest { + private static MockServiceHelper mockServiceHelper; + private static MockStorage mockStorage; + private LocalChannelProvider channelProvider; + private StorageClient client; + + @BeforeClass + public static void startStaticServer() { + mockStorage = new MockStorage(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockStorage)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + StorageSettings settings = + StorageSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = StorageClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void readObjectTest() throws Exception { + ReadObjectResponse expectedResponse = + ReadObjectResponse.newBuilder() + .setChecksummedData(ChecksummedData.newBuilder().build()) + .setObjectChecksums(ObjectChecksums.newBuilder().build()) + .setContentRange(ContentRange.newBuilder().build()) + .setMetadata(Object.newBuilder().build()) + .build(); + mockStorage.addResponse(expectedResponse); + 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(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ServerStreamingCallable callable = + client.readObjectCallable(); + callable.serverStreamingCall(request, responseObserver); + + List actualResponses = responseObserver.future().get(); + Assert.assertEquals(1, actualResponses.size()); + Assert.assertEquals(expectedResponse, actualResponses.get(0)); + } + + @Test + public void readObjectExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockStorage.addException(exception); + 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(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ServerStreamingCallable callable = + client.readObjectCallable(); + callable.serverStreamingCall(request, responseObserver); + + try { + List actualResponses = responseObserver.future().get(); + Assert.fail("No exception thrown"); + } catch (ExecutionException e) { + Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void writeObjectTest() throws Exception { + WriteObjectResponse expectedResponse = WriteObjectResponse.newBuilder().build(); + mockStorage.addResponse(expectedResponse); + WriteObjectRequest request = + WriteObjectRequest.newBuilder() + .setWriteOffset(-1559543565) + .setObjectChecksums(ObjectChecksums.newBuilder().build()) + .setFinishWrite(true) + .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ClientStreamingCallable callable = + client.writeObjectCallable(); + ApiStreamObserver requestObserver = + callable.clientStreamingCall(responseObserver); + + requestObserver.onNext(request); + requestObserver.onCompleted(); + + List actualResponses = responseObserver.future().get(); + Assert.assertEquals(1, actualResponses.size()); + Assert.assertEquals(expectedResponse, actualResponses.get(0)); + } + + @Test + public void writeObjectExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockStorage.addException(exception); + WriteObjectRequest request = + WriteObjectRequest.newBuilder() + .setWriteOffset(-1559543565) + .setObjectChecksums(ObjectChecksums.newBuilder().build()) + .setFinishWrite(true) + .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + ClientStreamingCallable callable = + client.writeObjectCallable(); + ApiStreamObserver requestObserver = + callable.clientStreamingCall(responseObserver); + + requestObserver.onNext(request); + + try { + List actualResponses = responseObserver.future().get(); + Assert.fail("No exception thrown"); + } catch (ExecutionException e) { + Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void startResumableWriteTest() throws Exception { + StartResumableWriteResponse expectedResponse = + StartResumableWriteResponse.newBuilder().setUploadId("uploadId1563990780").build(); + mockStorage.addResponse(expectedResponse); + + StartResumableWriteRequest request = + StartResumableWriteRequest.newBuilder() + .setWriteObjectSpec(WriteObjectSpec.newBuilder().build()) + .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .build(); + + StartResumableWriteResponse actualResponse = client.startResumableWrite(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockStorage.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + StartResumableWriteRequest actualRequest = ((StartResumableWriteRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getWriteObjectSpec(), actualRequest.getWriteObjectSpec()); + Assert.assertEquals( + request.getCommonObjectRequestParams(), actualRequest.getCommonObjectRequestParams()); + Assert.assertEquals(request.getCommonRequestParams(), actualRequest.getCommonRequestParams()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void startResumableWriteExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockStorage.addException(exception); + + try { + StartResumableWriteRequest request = + StartResumableWriteRequest.newBuilder() + .setWriteObjectSpec(WriteObjectSpec.newBuilder().build()) + .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .build(); + client.startResumableWrite(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void queryWriteStatusTest() throws Exception { + QueryWriteStatusResponse expectedResponse = QueryWriteStatusResponse.newBuilder().build(); + mockStorage.addResponse(expectedResponse); + + String uploadId = "uploadId1563990780"; + + QueryWriteStatusResponse actualResponse = client.queryWriteStatus(uploadId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockStorage.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + QueryWriteStatusRequest actualRequest = ((QueryWriteStatusRequest) actualRequests.get(0)); + + Assert.assertEquals(uploadId, actualRequest.getUploadId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void queryWriteStatusExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockStorage.addException(exception); + + try { + String uploadId = "uploadId1563990780"; + client.queryWriteStatus(uploadId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/grpc-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageGrpc.java b/grpc-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageGrpc.java new file mode 100644 index 0000000000..c0add75794 --- /dev/null +++ b/grpc-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageGrpc.java @@ -0,0 +1,738 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.storage.v2; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *

+ * 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 + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ReadObject")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.storage.v2.ReadObjectRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.storage.v2.ReadObjectResponse.getDefaultInstance())) + .setSchemaDescriptor(new StorageMethodDescriptorSupplier("ReadObject")) + .build(); + } + } + } + return getReadObjectMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.storage.v2.WriteObjectRequest, com.google.storage.v2.WriteObjectResponse> + getWriteObjectMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "WriteObject", + requestType = com.google.storage.v2.WriteObjectRequest.class, + responseType = com.google.storage.v2.WriteObjectResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.storage.v2.WriteObjectRequest, com.google.storage.v2.WriteObjectResponse> + getWriteObjectMethod() { + io.grpc.MethodDescriptor< + com.google.storage.v2.WriteObjectRequest, com.google.storage.v2.WriteObjectResponse> + getWriteObjectMethod; + if ((getWriteObjectMethod = StorageGrpc.getWriteObjectMethod) == null) { + synchronized (StorageGrpc.class) { + if ((getWriteObjectMethod = StorageGrpc.getWriteObjectMethod) == null) { + StorageGrpc.getWriteObjectMethod = + getWriteObjectMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "WriteObject")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.storage.v2.WriteObjectRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.storage.v2.WriteObjectResponse.getDefaultInstance())) + .setSchemaDescriptor(new StorageMethodDescriptorSupplier("WriteObject")) + .build(); + } + } + } + return getWriteObjectMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.storage.v2.StartResumableWriteRequest, + com.google.storage.v2.StartResumableWriteResponse> + getStartResumableWriteMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "StartResumableWrite", + requestType = com.google.storage.v2.StartResumableWriteRequest.class, + responseType = com.google.storage.v2.StartResumableWriteResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.storage.v2.StartResumableWriteRequest, + com.google.storage.v2.StartResumableWriteResponse> + getStartResumableWriteMethod() { + io.grpc.MethodDescriptor< + com.google.storage.v2.StartResumableWriteRequest, + com.google.storage.v2.StartResumableWriteResponse> + getStartResumableWriteMethod; + if ((getStartResumableWriteMethod = StorageGrpc.getStartResumableWriteMethod) == null) { + synchronized (StorageGrpc.class) { + if ((getStartResumableWriteMethod = StorageGrpc.getStartResumableWriteMethod) == null) { + StorageGrpc.getStartResumableWriteMethod = + getStartResumableWriteMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "StartResumableWrite")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.storage.v2.StartResumableWriteRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.storage.v2.StartResumableWriteResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new StorageMethodDescriptorSupplier("StartResumableWrite")) + .build(); + } + } + } + return getStartResumableWriteMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.storage.v2.QueryWriteStatusRequest, + com.google.storage.v2.QueryWriteStatusResponse> + getQueryWriteStatusMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "QueryWriteStatus", + requestType = com.google.storage.v2.QueryWriteStatusRequest.class, + responseType = com.google.storage.v2.QueryWriteStatusResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.storage.v2.QueryWriteStatusRequest, + com.google.storage.v2.QueryWriteStatusResponse> + getQueryWriteStatusMethod() { + io.grpc.MethodDescriptor< + com.google.storage.v2.QueryWriteStatusRequest, + com.google.storage.v2.QueryWriteStatusResponse> + getQueryWriteStatusMethod; + if ((getQueryWriteStatusMethod = StorageGrpc.getQueryWriteStatusMethod) == null) { + synchronized (StorageGrpc.class) { + if ((getQueryWriteStatusMethod = StorageGrpc.getQueryWriteStatusMethod) == null) { + StorageGrpc.getQueryWriteStatusMethod = + getQueryWriteStatusMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "QueryWriteStatus")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.storage.v2.QueryWriteStatusRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.storage.v2.QueryWriteStatusResponse.getDefaultInstance())) + .setSchemaDescriptor(new StorageMethodDescriptorSupplier("QueryWriteStatus")) + .build(); + } + } + } + return getQueryWriteStatusMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static StorageStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public StorageStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new StorageStub(channel, callOptions); + } + }; + return StorageStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static StorageBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public StorageBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new StorageBlockingStub(channel, callOptions); + } + }; + return StorageBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static StorageFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public StorageFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new StorageFutureStub(channel, callOptions); + } + }; + return StorageFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * 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 responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getReadObjectMethod(), responseObserver); + } + + /** + * + * + *
+     * 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 writeObject( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall( + getWriteObjectMethod(), responseObserver); + } + + /** + * + * + *
+     * 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 + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getStartResumableWriteMethod(), responseObserver); + } + + /** + * + * + *
+     * 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 + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getQueryWriteStatusMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getReadObjectMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + com.google.storage.v2.ReadObjectRequest, + com.google.storage.v2.ReadObjectResponse>(this, METHODID_READ_OBJECT))) + .addMethod( + getWriteObjectMethod(), + io.grpc.stub.ServerCalls.asyncClientStreamingCall( + new MethodHandlers< + com.google.storage.v2.WriteObjectRequest, + com.google.storage.v2.WriteObjectResponse>(this, METHODID_WRITE_OBJECT))) + .addMethod( + getStartResumableWriteMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.storage.v2.StartResumableWriteRequest, + com.google.storage.v2.StartResumableWriteResponse>( + this, METHODID_START_RESUMABLE_WRITE))) + .addMethod( + getQueryWriteStatusMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.storage.v2.QueryWriteStatusRequest, + com.google.storage.v2.QueryWriteStatusResponse>( + this, METHODID_QUERY_WRITE_STATUS))) + .build(); + } + } + + /** + * + * + *
+   * Manages Google Cloud Storage resources.
+   * 
+ */ + public static final class StorageStub extends io.grpc.stub.AbstractAsyncStub { + private StorageStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected StorageStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new StorageStub(channel, callOptions); + } + + /** + * + * + *
+     * Reads an object's data.
+     * 
+ */ + public void readObject( + com.google.storage.v2.ReadObjectRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncServerStreamingCall( + getChannel().newCall(getReadObjectMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * 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 writeObject( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ClientCalls.asyncClientStreamingCall( + getChannel().newCall(getWriteObjectMethod(), getCallOptions()), responseObserver); + } + + /** + * + * + *
+     * 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 + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getStartResumableWriteMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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 + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getQueryWriteStatusMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Manages Google Cloud Storage resources.
+   * 
+ */ + public static final class StorageBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private StorageBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected StorageBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new StorageBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Reads an object's data.
+     * 
+ */ + public java.util.Iterator readObject( + com.google.storage.v2.ReadObjectRequest request) { + return io.grpc.stub.ClientCalls.blockingServerStreamingCall( + getChannel(), getReadObjectMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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 { + private StorageFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected StorageFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new StorageFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * 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 + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final StorageImplBase serviceImpl; + private final int methodId; + + MethodHandlers(StorageImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_READ_OBJECT: + serviceImpl.readObject( + (com.google.storage.v2.ReadObjectRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_START_RESUMABLE_WRITE: + serviceImpl.startResumableWrite( + (com.google.storage.v2.StartResumableWriteRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_QUERY_WRITE_STATUS: + serviceImpl.queryWriteStatus( + (com.google.storage.v2.QueryWriteStatusRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_WRITE_OBJECT: + return (io.grpc.stub.StreamObserver) + serviceImpl.writeObject( + (io.grpc.stub.StreamObserver) + responseObserver); + default: + throw new AssertionError(); + } + } + } + + private abstract static class StorageBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + StorageBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.storage.v2.StorageProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Storage"); + } + } + + private static final class StorageFileDescriptorSupplier extends StorageBaseDescriptorSupplier { + StorageFileDescriptorSupplier() {} + } + + private static final class StorageMethodDescriptorSupplier extends StorageBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + StorageMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (StorageGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new StorageFileDescriptorSupplier()) + .addMethod(getReadObjectMethod()) + .addMethod(getWriteObjectMethod()) + .addMethod(getStartResumableWriteMethod()) + .addMethod(getQueryWriteStatusMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/Bucket.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/Bucket.java new file mode 100644 index 0000000000..ebe211fd86 --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/Bucket.java @@ -0,0 +1,21456 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +package com.google.storage.v2; + +/** + * + * + *
+ * 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(); + mutable_bitField0_ |= 0x00000001; + } + acl_.add( + input.readMessage( + com.google.storage.v2.BucketAccessControl.parser(), extensionRegistry)); + break; + } + case 74: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + defaultObjectAcl_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + defaultObjectAcl_.add( + input.readMessage( + com.google.storage.v2.ObjectAccessControl.parser(), extensionRegistry)); + break; + } + case 82: + { + com.google.storage.v2.Bucket.Lifecycle.Builder subBuilder = null; + if (lifecycle_ != null) { + subBuilder = lifecycle_.toBuilder(); + } + lifecycle_ = + input.readMessage( + com.google.storage.v2.Bucket.Lifecycle.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(lifecycle_); + lifecycle_ = subBuilder.buildPartial(); + } + + break; + } + case 90: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 98: + { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + cors_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + cors_.add( + input.readMessage(com.google.storage.v2.Bucket.Cors.parser(), extensionRegistry)); + break; + } + case 106: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + case 112: + { + defaultEventBasedHold_ = input.readBool(); + break; + } + case 122: + { + if (!((mutable_bitField0_ & 0x00000008) != 0)) { + labels_ = + com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000008; + } + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put(labels__.getKey(), labels__.getValue()); + break; + } + case 130: + { + com.google.storage.v2.Bucket.Website.Builder subBuilder = null; + if (website_ != null) { + subBuilder = website_.toBuilder(); + } + website_ = + input.readMessage( + com.google.storage.v2.Bucket.Website.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(website_); + website_ = subBuilder.buildPartial(); + } + + break; + } + case 138: + { + com.google.storage.v2.Bucket.Versioning.Builder subBuilder = null; + if (versioning_ != null) { + subBuilder = versioning_.toBuilder(); + } + versioning_ = + input.readMessage( + com.google.storage.v2.Bucket.Versioning.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(versioning_); + versioning_ = subBuilder.buildPartial(); + } + + break; + } + case 146: + { + com.google.storage.v2.Bucket.Logging.Builder subBuilder = null; + if (logging_ != null) { + subBuilder = logging_.toBuilder(); + } + logging_ = + input.readMessage( + com.google.storage.v2.Bucket.Logging.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(logging_); + logging_ = subBuilder.buildPartial(); + } + + break; + } + case 154: + { + com.google.storage.v2.Owner.Builder subBuilder = null; + if (owner_ != null) { + subBuilder = owner_.toBuilder(); + } + owner_ = input.readMessage(com.google.storage.v2.Owner.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(owner_); + owner_ = subBuilder.buildPartial(); + } + + break; + } + case 162: + { + com.google.storage.v2.Bucket.Encryption.Builder subBuilder = null; + if (encryption_ != null) { + subBuilder = encryption_.toBuilder(); + } + encryption_ = + input.readMessage( + com.google.storage.v2.Bucket.Encryption.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(encryption_); + encryption_ = subBuilder.buildPartial(); + } + + break; + } + case 170: + { + com.google.storage.v2.Bucket.Billing.Builder subBuilder = null; + if (billing_ != null) { + subBuilder = billing_.toBuilder(); + } + billing_ = + input.readMessage( + com.google.storage.v2.Bucket.Billing.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(billing_); + billing_ = subBuilder.buildPartial(); + } + + break; + } + case 178: + { + com.google.storage.v2.Bucket.RetentionPolicy.Builder subBuilder = null; + if (retentionPolicy_ != null) { + subBuilder = retentionPolicy_.toBuilder(); + } + retentionPolicy_ = + input.readMessage( + com.google.storage.v2.Bucket.RetentionPolicy.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(retentionPolicy_); + retentionPolicy_ = subBuilder.buildPartial(); + } + + break; + } + case 186: + { + com.google.storage.v2.Bucket.IamConfig.Builder subBuilder = null; + if (iamConfig_ != null) { + subBuilder = iamConfig_.toBuilder(); + } + iamConfig_ = + input.readMessage( + com.google.storage.v2.Bucket.IamConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(iamConfig_); + iamConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 194: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000010) != 0)) { + zoneAffinity_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000010; + } + zoneAffinity_.add(s); + break; + } + case 200: + { + satisfiesPzs_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + acl_ = java.util.Collections.unmodifiableList(acl_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + defaultObjectAcl_ = java.util.Collections.unmodifiableList(defaultObjectAcl_); + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + cors_ = java.util.Collections.unmodifiableList(cors_); + } + if (((mutable_bitField0_ & 0x00000010) != 0)) { + zoneAffinity_ = zoneAffinity_.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_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 15: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_Bucket_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.Bucket.class, com.google.storage.v2.Bucket.Builder.class); + } + + public interface BillingOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.Bucket.Billing) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * 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 + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.Bucket.Billing) + com.google.storage.v2.Bucket.BillingOrBuilder { + 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); + } + + // Construct using com.google.storage.v2.Bucket.Billing.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + requesterPays_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_Bucket_Billing_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.Bucket.Billing getDefaultInstanceForType() { + return com.google.storage.v2.Bucket.Billing.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.Bucket.Billing build() { + com.google.storage.v2.Bucket.Billing result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.Bucket.Billing buildPartial() { + com.google.storage.v2.Bucket.Billing result = + new com.google.storage.v2.Bucket.Billing(this); + result.requesterPays_ = requesterPays_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.storage.v2.Bucket.Billing) { + return mergeFrom((com.google.storage.v2.Bucket.Billing) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.Bucket.Billing other) { + if (other == com.google.storage.v2.Bucket.Billing.getDefaultInstance()) return this; + if (other.getRequesterPays() != false) { + setRequesterPays(other.getRequesterPays()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.storage.v2.Bucket.Billing parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.storage.v2.Bucket.Billing) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + 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_; + } + /** + * + * + *
+       * 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 PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Billing parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Billing(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.storage.v2.Bucket.Billing getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface CorsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.Bucket.Cors) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * 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 getOriginList(); + /** + * + * + *
+     * 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 getMethodList(); + /** + * + * + *
+     * 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 getResponseHeaderList(); + /** + * + * + *
+     * 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 + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.Bucket.Cors) + com.google.storage.v2.Bucket.CorsOrBuilder { + 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); + } + + // Construct using com.google.storage.v2.Bucket.Cors.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + origin_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + method_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + responseHeader_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + maxAgeSeconds_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_Bucket_Cors_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.Bucket.Cors getDefaultInstanceForType() { + return com.google.storage.v2.Bucket.Cors.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.Bucket.Cors build() { + com.google.storage.v2.Bucket.Cors result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.Bucket.Cors buildPartial() { + com.google.storage.v2.Bucket.Cors result = new com.google.storage.v2.Bucket.Cors(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + origin_ = origin_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.origin_ = origin_; + if (((bitField0_ & 0x00000002) != 0)) { + method_ = method_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.method_ = method_; + if (((bitField0_ & 0x00000004) != 0)) { + responseHeader_ = responseHeader_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.responseHeader_ = responseHeader_; + result.maxAgeSeconds_ = maxAgeSeconds_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.storage.v2.Bucket.Cors) { + return mergeFrom((com.google.storage.v2.Bucket.Cors) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.Bucket.Cors other) { + if (other == com.google.storage.v2.Bucket.Cors.getDefaultInstance()) return this; + if (!other.origin_.isEmpty()) { + if (origin_.isEmpty()) { + origin_ = other.origin_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureOriginIsMutable(); + origin_.addAll(other.origin_); + } + onChanged(); + } + if (!other.method_.isEmpty()) { + if (method_.isEmpty()) { + method_ = other.method_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureMethodIsMutable(); + method_.addAll(other.method_); + } + onChanged(); + } + if (!other.responseHeader_.isEmpty()) { + if (responseHeader_.isEmpty()) { + responseHeader_ = other.responseHeader_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureResponseHeaderIsMutable(); + responseHeader_.addAll(other.responseHeader_); + } + onChanged(); + } + if (other.getMaxAgeSeconds() != 0) { + setMaxAgeSeconds(other.getMaxAgeSeconds()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.storage.v2.Bucket.Cors parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.storage.v2.Bucket.Cors) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList origin_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureOriginIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + origin_ = new com.google.protobuf.LazyStringArrayList(origin_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * 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 values) { + ensureOriginIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, origin_); + 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; + * + * @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 values) { + ensureMethodIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, method_); + 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; + * + * @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 values) { + ensureResponseHeaderIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, responseHeader_); + 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; + * + * @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 PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Cors parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Cors(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.storage.v2.Bucket.Cors getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface EncryptionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.Bucket.Encryption) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * 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 + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.Bucket.Encryption) + com.google.storage.v2.Bucket.EncryptionOrBuilder { + 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); + } + + // Construct using com.google.storage.v2.Bucket.Encryption.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + defaultKmsKey_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_Bucket_Encryption_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.Bucket.Encryption getDefaultInstanceForType() { + return com.google.storage.v2.Bucket.Encryption.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.Bucket.Encryption build() { + com.google.storage.v2.Bucket.Encryption result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.Bucket.Encryption buildPartial() { + com.google.storage.v2.Bucket.Encryption result = + new com.google.storage.v2.Bucket.Encryption(this); + result.defaultKmsKey_ = defaultKmsKey_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.storage.v2.Bucket.Encryption) { + return mergeFrom((com.google.storage.v2.Bucket.Encryption) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.Bucket.Encryption other) { + if (other == com.google.storage.v2.Bucket.Encryption.getDefaultInstance()) return this; + if (!other.getDefaultKmsKey().isEmpty()) { + defaultKmsKey_ = other.defaultKmsKey_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.storage.v2.Bucket.Encryption parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.storage.v2.Bucket.Encryption) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private 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. + */ + 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 PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Encryption parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Encryption(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.storage.v2.Bucket.Encryption getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface IamConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.Bucket.IamConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * 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 + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public PublicAccessPrevention findValueByNumber(int number) { + return PublicAccessPrevention.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.storage.v2.Bucket.IamConfig.getDescriptor().getEnumTypes().get(0); + } + + private static final PublicAccessPrevention[] VALUES = values(); + + public static PublicAccessPrevention valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private PublicAccessPrevention(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.storage.v2.Bucket.IamConfig.PublicAccessPrevention) + } + + public interface UniformBucketLevelAccessOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * 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 + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess) + com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccessOrBuilder { + 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); + } + + // Construct using + // com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + enabled_ = false; + + if (lockTimeBuilder_ == null) { + lockTime_ = null; + } else { + lockTime_ = null; + lockTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_Bucket_IamConfig_UniformBucketLevelAccess_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess + getDefaultInstanceForType() { + return com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess build() { + com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess buildPartial() { + com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess result = + new com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess(this); + result.enabled_ = enabled_; + if (lockTimeBuilder_ == null) { + result.lockTime_ = lockTime_; + } else { + result.lockTime_ = lockTimeBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess) { + return mergeFrom( + (com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess other) { + if (other + == com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess + .getDefaultInstance()) return this; + if (other.getEnabled() != false) { + setEnabled(other.getEnabled()); + } + if (other.hasLockTime()) { + mergeLockTime(other.getLockTime()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + 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_; + } + /** + * + * + *
+         * 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 PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UniformBucketLevelAccess parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UniformBucketLevelAccess(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int UNIFORM_BUCKET_LEVEL_ACCESS_FIELD_NUMBER = 1; + private com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess + uniformBucketLevelAccess_; + /** + * + * + *
+     * 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 + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.Bucket.IamConfig) + com.google.storage.v2.Bucket.IamConfigOrBuilder { + 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); + } + + // Construct using com.google.storage.v2.Bucket.IamConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (uniformBucketLevelAccessBuilder_ == null) { + uniformBucketLevelAccess_ = null; + } else { + uniformBucketLevelAccess_ = null; + uniformBucketLevelAccessBuilder_ = null; + } + publicAccessPrevention_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_Bucket_IamConfig_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.Bucket.IamConfig getDefaultInstanceForType() { + return com.google.storage.v2.Bucket.IamConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.Bucket.IamConfig build() { + com.google.storage.v2.Bucket.IamConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.Bucket.IamConfig buildPartial() { + com.google.storage.v2.Bucket.IamConfig result = + new com.google.storage.v2.Bucket.IamConfig(this); + if (uniformBucketLevelAccessBuilder_ == null) { + result.uniformBucketLevelAccess_ = uniformBucketLevelAccess_; + } else { + result.uniformBucketLevelAccess_ = uniformBucketLevelAccessBuilder_.build(); + } + result.publicAccessPrevention_ = publicAccessPrevention_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.storage.v2.Bucket.IamConfig) { + return mergeFrom((com.google.storage.v2.Bucket.IamConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.Bucket.IamConfig other) { + if (other == com.google.storage.v2.Bucket.IamConfig.getDefaultInstance()) return this; + if (other.hasUniformBucketLevelAccess()) { + mergeUniformBucketLevelAccess(other.getUniformBucketLevelAccess()); + } + if (other.publicAccessPrevention_ != 0) { + setPublicAccessPreventionValue(other.getPublicAccessPreventionValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.storage.v2.Bucket.IamConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.storage.v2.Bucket.IamConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess + uniformBucketLevelAccess_; + 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> + uniformBucketLevelAccessBuilder_; + /** + * + * + *
+       * 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 PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public IamConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new IamConfig(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.storage.v2.Bucket.IamConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface LifecycleOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.Bucket.Lifecycle) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * 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 getRuleList(); + /** + * + * + *
+     * 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 + 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(); + mutable_bitField0_ |= 0x00000001; + } + rule_.add( + input.readMessage( + com.google.storage.v2.Bucket.Lifecycle.Rule.parser(), extensionRegistry)); + 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)) { + rule_ = java.util.Collections.unmodifiableList(rule_); + } + 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_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_Bucket_Lifecycle_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.Bucket.Lifecycle.class, + com.google.storage.v2.Bucket.Lifecycle.Builder.class); + } + + public interface RuleOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.Bucket.Lifecycle.Rule) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * 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 + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.Bucket.Lifecycle.Rule.Action) + com.google.storage.v2.Bucket.Lifecycle.Rule.ActionOrBuilder { + 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); + } + + // Construct using com.google.storage.v2.Bucket.Lifecycle.Rule.Action.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + type_ = ""; + + storageClass_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_Bucket_Lifecycle_Rule_Action_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.Bucket.Lifecycle.Rule.Action getDefaultInstanceForType() { + return com.google.storage.v2.Bucket.Lifecycle.Rule.Action.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.Bucket.Lifecycle.Rule.Action build() { + com.google.storage.v2.Bucket.Lifecycle.Rule.Action result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.Bucket.Lifecycle.Rule.Action buildPartial() { + com.google.storage.v2.Bucket.Lifecycle.Rule.Action result = + new com.google.storage.v2.Bucket.Lifecycle.Rule.Action(this); + result.type_ = type_; + result.storageClass_ = storageClass_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.storage.v2.Bucket.Lifecycle.Rule.Action) { + return mergeFrom((com.google.storage.v2.Bucket.Lifecycle.Rule.Action) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.Bucket.Lifecycle.Rule.Action other) { + if (other == com.google.storage.v2.Bucket.Lifecycle.Rule.Action.getDefaultInstance()) + return this; + if (!other.getType().isEmpty()) { + type_ = other.type_; + onChanged(); + } + if (!other.getStorageClass().isEmpty()) { + storageClass_ = other.storageClass_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.storage.v2.Bucket.Lifecycle.Rule.Action parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.storage.v2.Bucket.Lifecycle.Rule.Action) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object type_ = ""; + /** + * + * + *
+           * 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 PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Action parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Action(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.storage.v2.Bucket.Lifecycle.Rule.Action getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ConditionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.Bucket.Lifecycle.Rule.Condition) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+         * 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 getMatchesStorageClassList(); + /** + * + * + *
+         * 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 + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.Bucket.Lifecycle.Rule.Condition) + com.google.storage.v2.Bucket.Lifecycle.Rule.ConditionOrBuilder { + 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); + } + + // Construct using com.google.storage.v2.Bucket.Lifecycle.Rule.Condition.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + ageDays_ = 0; + bitField0_ = (bitField0_ & ~0x00000001); + if (createdBeforeBuilder_ == null) { + createdBefore_ = null; + } else { + createdBefore_ = null; + createdBeforeBuilder_ = null; + } + isLive_ = false; + bitField0_ = (bitField0_ & ~0x00000002); + numNewerVersions_ = 0; + bitField0_ = (bitField0_ & ~0x00000004); + matchesStorageClass_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000008); + daysSinceCustomTime_ = 0; + bitField0_ = (bitField0_ & ~0x00000010); + if (customTimeBeforeBuilder_ == null) { + customTimeBefore_ = null; + } else { + customTimeBefore_ = null; + customTimeBeforeBuilder_ = null; + } + daysSinceNoncurrentTime_ = 0; + bitField0_ = (bitField0_ & ~0x00000020); + if (noncurrentTimeBeforeBuilder_ == null) { + noncurrentTimeBefore_ = null; + } else { + noncurrentTimeBefore_ = null; + noncurrentTimeBeforeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_Bucket_Lifecycle_Rule_Condition_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.Bucket.Lifecycle.Rule.Condition getDefaultInstanceForType() { + return com.google.storage.v2.Bucket.Lifecycle.Rule.Condition.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.Bucket.Lifecycle.Rule.Condition build() { + com.google.storage.v2.Bucket.Lifecycle.Rule.Condition result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.Bucket.Lifecycle.Rule.Condition buildPartial() { + com.google.storage.v2.Bucket.Lifecycle.Rule.Condition result = + new com.google.storage.v2.Bucket.Lifecycle.Rule.Condition(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.ageDays_ = ageDays_; + to_bitField0_ |= 0x00000001; + } + if (createdBeforeBuilder_ == null) { + result.createdBefore_ = createdBefore_; + } else { + result.createdBefore_ = createdBeforeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.isLive_ = isLive_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.numNewerVersions_ = numNewerVersions_; + to_bitField0_ |= 0x00000004; + } + if (((bitField0_ & 0x00000008) != 0)) { + matchesStorageClass_ = matchesStorageClass_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.matchesStorageClass_ = matchesStorageClass_; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.daysSinceCustomTime_ = daysSinceCustomTime_; + to_bitField0_ |= 0x00000008; + } + if (customTimeBeforeBuilder_ == null) { + result.customTimeBefore_ = customTimeBefore_; + } else { + result.customTimeBefore_ = customTimeBeforeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.daysSinceNoncurrentTime_ = daysSinceNoncurrentTime_; + to_bitField0_ |= 0x00000010; + } + if (noncurrentTimeBeforeBuilder_ == null) { + result.noncurrentTimeBefore_ = noncurrentTimeBefore_; + } else { + result.noncurrentTimeBefore_ = noncurrentTimeBeforeBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.storage.v2.Bucket.Lifecycle.Rule.Condition) { + return mergeFrom((com.google.storage.v2.Bucket.Lifecycle.Rule.Condition) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.Bucket.Lifecycle.Rule.Condition other) { + if (other == com.google.storage.v2.Bucket.Lifecycle.Rule.Condition.getDefaultInstance()) + return this; + if (other.hasAgeDays()) { + setAgeDays(other.getAgeDays()); + } + if (other.hasCreatedBefore()) { + mergeCreatedBefore(other.getCreatedBefore()); + } + if (other.hasIsLive()) { + setIsLive(other.getIsLive()); + } + if (other.hasNumNewerVersions()) { + setNumNewerVersions(other.getNumNewerVersions()); + } + if (!other.matchesStorageClass_.isEmpty()) { + if (matchesStorageClass_.isEmpty()) { + matchesStorageClass_ = other.matchesStorageClass_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureMatchesStorageClassIsMutable(); + matchesStorageClass_.addAll(other.matchesStorageClass_); + } + onChanged(); + } + if (other.hasDaysSinceCustomTime()) { + setDaysSinceCustomTime(other.getDaysSinceCustomTime()); + } + if (other.hasCustomTimeBefore()) { + mergeCustomTimeBefore(other.getCustomTimeBefore()); + } + if (other.hasDaysSinceNoncurrentTime()) { + setDaysSinceNoncurrentTime(other.getDaysSinceNoncurrentTime()); + } + if (other.hasNoncurrentTimeBefore()) { + mergeNoncurrentTimeBefore(other.getNoncurrentTimeBefore()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.storage.v2.Bucket.Lifecycle.Rule.Condition parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.storage.v2.Bucket.Lifecycle.Rule.Condition) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + 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_; + } + /** + * + * + *
+           * 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 values) { + ensureMatchesStorageClassIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, matchesStorageClass_); + 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; + * + * @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 PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Condition parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Condition(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.storage.v2.Bucket.Lifecycle.Rule.Condition getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int ACTION_FIELD_NUMBER = 1; + private com.google.storage.v2.Bucket.Lifecycle.Rule.Action action_; + /** + * + * + *
+       * 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 + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.Bucket.Lifecycle.Rule) + com.google.storage.v2.Bucket.Lifecycle.RuleOrBuilder { + 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); + } + + // Construct using com.google.storage.v2.Bucket.Lifecycle.Rule.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (actionBuilder_ == null) { + action_ = null; + } else { + action_ = null; + actionBuilder_ = null; + } + if (conditionBuilder_ == null) { + condition_ = null; + } else { + condition_ = null; + conditionBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_Bucket_Lifecycle_Rule_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.Bucket.Lifecycle.Rule getDefaultInstanceForType() { + return com.google.storage.v2.Bucket.Lifecycle.Rule.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.Bucket.Lifecycle.Rule build() { + com.google.storage.v2.Bucket.Lifecycle.Rule result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.Bucket.Lifecycle.Rule buildPartial() { + com.google.storage.v2.Bucket.Lifecycle.Rule result = + new com.google.storage.v2.Bucket.Lifecycle.Rule(this); + if (actionBuilder_ == null) { + result.action_ = action_; + } else { + result.action_ = actionBuilder_.build(); + } + if (conditionBuilder_ == null) { + result.condition_ = condition_; + } else { + result.condition_ = conditionBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.storage.v2.Bucket.Lifecycle.Rule) { + return mergeFrom((com.google.storage.v2.Bucket.Lifecycle.Rule) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.Bucket.Lifecycle.Rule other) { + if (other == com.google.storage.v2.Bucket.Lifecycle.Rule.getDefaultInstance()) + return this; + if (other.hasAction()) { + mergeAction(other.getAction()); + } + if (other.hasCondition()) { + mergeCondition(other.getCondition()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.storage.v2.Bucket.Lifecycle.Rule parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.storage.v2.Bucket.Lifecycle.Rule) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.storage.v2.Bucket.Lifecycle.Rule.Action action_; + 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> + actionBuilder_; + /** + * + * + *
+         * 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 PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Rule parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Rule(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.storage.v2.Bucket.Lifecycle.Rule getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int RULE_FIELD_NUMBER = 1; + private java.util.List 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 java.util.List getRuleList() { + 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 java.util.List + 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 + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.Bucket.Lifecycle) + com.google.storage.v2.Bucket.LifecycleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_Bucket_Lifecycle_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_Bucket_Lifecycle_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.Bucket.Lifecycle.class, + com.google.storage.v2.Bucket.Lifecycle.Builder.class); + } + + // Construct using com.google.storage.v2.Bucket.Lifecycle.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getRuleFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (ruleBuilder_ == null) { + rule_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ruleBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_Bucket_Lifecycle_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.Bucket.Lifecycle getDefaultInstanceForType() { + return com.google.storage.v2.Bucket.Lifecycle.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.Bucket.Lifecycle build() { + com.google.storage.v2.Bucket.Lifecycle result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.Bucket.Lifecycle buildPartial() { + com.google.storage.v2.Bucket.Lifecycle result = + new com.google.storage.v2.Bucket.Lifecycle(this); + int from_bitField0_ = bitField0_; + if (ruleBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + rule_ = java.util.Collections.unmodifiableList(rule_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.rule_ = rule_; + } else { + result.rule_ = ruleBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.storage.v2.Bucket.Lifecycle) { + return mergeFrom((com.google.storage.v2.Bucket.Lifecycle) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.Bucket.Lifecycle other) { + if (other == com.google.storage.v2.Bucket.Lifecycle.getDefaultInstance()) return this; + if (ruleBuilder_ == null) { + if (!other.rule_.isEmpty()) { + if (rule_.isEmpty()) { + rule_ = other.rule_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRuleIsMutable(); + rule_.addAll(other.rule_); + } + onChanged(); + } + } else { + if (!other.rule_.isEmpty()) { + if (ruleBuilder_.isEmpty()) { + ruleBuilder_.dispose(); + ruleBuilder_ = null; + rule_ = other.rule_; + bitField0_ = (bitField0_ & ~0x00000001); + ruleBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getRuleFieldBuilder() + : null; + } else { + ruleBuilder_.addAllMessages(other.rule_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.storage.v2.Bucket.Lifecycle parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.storage.v2.Bucket.Lifecycle) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List rule_ = + java.util.Collections.emptyList(); + + private void ensureRuleIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + rule_ = new java.util.ArrayList(rule_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.storage.v2.Bucket.Lifecycle.Rule, + com.google.storage.v2.Bucket.Lifecycle.Rule.Builder, + com.google.storage.v2.Bucket.Lifecycle.RuleOrBuilder> + ruleBuilder_; + + /** + * + * + *
+       * 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 getRuleList() { + if (ruleBuilder_ == null) { + return java.util.Collections.unmodifiableList(rule_); + } else { + return ruleBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * 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 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 + 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 + getRuleBuilderList() { + return getRuleFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.storage.v2.Bucket.Lifecycle.Rule, + com.google.storage.v2.Bucket.Lifecycle.Rule.Builder, + com.google.storage.v2.Bucket.Lifecycle.RuleOrBuilder> + getRuleFieldBuilder() { + if (ruleBuilder_ == null) { + ruleBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.storage.v2.Bucket.Lifecycle.Rule, + com.google.storage.v2.Bucket.Lifecycle.Rule.Builder, + com.google.storage.v2.Bucket.Lifecycle.RuleOrBuilder>( + rule_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + rule_ = null; + } + return ruleBuilder_; + } + + @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) + } + + // @@protoc_insertion_point(class_scope:google.storage.v2.Bucket.Lifecycle) + private static final com.google.storage.v2.Bucket.Lifecycle DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.v2.Bucket.Lifecycle(); + } + + public static com.google.storage.v2.Bucket.Lifecycle getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Lifecycle parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Lifecycle(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.storage.v2.Bucket.Lifecycle getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface LoggingOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.Bucket.Logging) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * 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 + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.Bucket.Logging) + com.google.storage.v2.Bucket.LoggingOrBuilder { + 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); + } + + // Construct using com.google.storage.v2.Bucket.Logging.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + logBucket_ = ""; + + logObjectPrefix_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_Bucket_Logging_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.Bucket.Logging getDefaultInstanceForType() { + return com.google.storage.v2.Bucket.Logging.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.Bucket.Logging build() { + com.google.storage.v2.Bucket.Logging result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.Bucket.Logging buildPartial() { + com.google.storage.v2.Bucket.Logging result = + new com.google.storage.v2.Bucket.Logging(this); + result.logBucket_ = logBucket_; + result.logObjectPrefix_ = logObjectPrefix_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.storage.v2.Bucket.Logging) { + return mergeFrom((com.google.storage.v2.Bucket.Logging) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.Bucket.Logging other) { + if (other == com.google.storage.v2.Bucket.Logging.getDefaultInstance()) return this; + if (!other.getLogBucket().isEmpty()) { + logBucket_ = other.logBucket_; + onChanged(); + } + if (!other.getLogObjectPrefix().isEmpty()) { + logObjectPrefix_ = other.logObjectPrefix_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.storage.v2.Bucket.Logging parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.storage.v2.Bucket.Logging) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object logBucket_ = ""; + /** + * + * + *
+       * 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 PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Logging parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Logging(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.storage.v2.Bucket.Logging getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface RetentionPolicyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.Bucket.RetentionPolicy) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * 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 + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.Bucket.RetentionPolicy) + com.google.storage.v2.Bucket.RetentionPolicyOrBuilder { + 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); + } + + // Construct using com.google.storage.v2.Bucket.RetentionPolicy.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (effectiveTimeBuilder_ == null) { + effectiveTime_ = null; + } else { + effectiveTime_ = null; + effectiveTimeBuilder_ = null; + } + isLocked_ = false; + + retentionPeriod_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_Bucket_RetentionPolicy_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.Bucket.RetentionPolicy getDefaultInstanceForType() { + return com.google.storage.v2.Bucket.RetentionPolicy.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.Bucket.RetentionPolicy build() { + com.google.storage.v2.Bucket.RetentionPolicy result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.Bucket.RetentionPolicy buildPartial() { + com.google.storage.v2.Bucket.RetentionPolicy result = + new com.google.storage.v2.Bucket.RetentionPolicy(this); + if (effectiveTimeBuilder_ == null) { + result.effectiveTime_ = effectiveTime_; + } else { + result.effectiveTime_ = effectiveTimeBuilder_.build(); + } + result.isLocked_ = isLocked_; + result.retentionPeriod_ = retentionPeriod_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.storage.v2.Bucket.RetentionPolicy) { + return mergeFrom((com.google.storage.v2.Bucket.RetentionPolicy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.Bucket.RetentionPolicy other) { + if (other == com.google.storage.v2.Bucket.RetentionPolicy.getDefaultInstance()) return this; + if (other.hasEffectiveTime()) { + mergeEffectiveTime(other.getEffectiveTime()); + } + if (other.getIsLocked() != false) { + setIsLocked(other.getIsLocked()); + } + if (other.getRetentionPeriod() != 0L) { + setRetentionPeriod(other.getRetentionPeriod()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.storage.v2.Bucket.RetentionPolicy parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.storage.v2.Bucket.RetentionPolicy) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.Timestamp effectiveTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + effectiveTimeBuilder_; + /** + * + * + *
+       * 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 PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RetentionPolicy parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RetentionPolicy(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.storage.v2.Bucket.RetentionPolicy getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface VersioningOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.Bucket.Versioning) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * 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 + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.Bucket.Versioning) + com.google.storage.v2.Bucket.VersioningOrBuilder { + 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); + } + + // Construct using com.google.storage.v2.Bucket.Versioning.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + enabled_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_Bucket_Versioning_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.Bucket.Versioning getDefaultInstanceForType() { + return com.google.storage.v2.Bucket.Versioning.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.Bucket.Versioning build() { + com.google.storage.v2.Bucket.Versioning result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.Bucket.Versioning buildPartial() { + com.google.storage.v2.Bucket.Versioning result = + new com.google.storage.v2.Bucket.Versioning(this); + result.enabled_ = enabled_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.storage.v2.Bucket.Versioning) { + return mergeFrom((com.google.storage.v2.Bucket.Versioning) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.Bucket.Versioning other) { + if (other == com.google.storage.v2.Bucket.Versioning.getDefaultInstance()) return this; + if (other.getEnabled() != false) { + setEnabled(other.getEnabled()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.storage.v2.Bucket.Versioning parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.storage.v2.Bucket.Versioning) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + 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_; + } + /** + * + * + *
+       * 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 PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Versioning parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Versioning(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.storage.v2.Bucket.Versioning getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface WebsiteOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.Bucket.Website) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * If the requested object path is missing, the service will ensure the path
+     * has a trailing '/', append this suffix, and attempt to retrieve the
+     * resulting object. This allows the creation of `index.html`
+     * objects to represent directory pages.
+     * 
+ * + * string main_page_suffix = 1; + * + * @return The mainPageSuffix. + */ + java.lang.String getMainPageSuffix(); + /** + * + * + *
+     * If the requested object path is missing, the service will ensure the path
+     * has a trailing '/', append this suffix, and attempt to retrieve the
+     * resulting object. This allows the creation of `index.html`
+     * objects to represent directory pages.
+     * 
+ * + * string main_page_suffix = 1; + * + * @return The bytes for mainPageSuffix. + */ + com.google.protobuf.ByteString getMainPageSuffixBytes(); + + /** + * + * + *
+     * If the requested object path is missing, and any
+     * `mainPageSuffix` object is missing, if applicable, the service
+     * will return the named object from this bucket as the content for a
+     * [https://tools.ietf.org/html/rfc7231#section-6.5.4][404 Not Found]
+     * result.
+     * 
+ * + * string not_found_page = 2; + * + * @return The notFoundPage. + */ + java.lang.String getNotFoundPage(); + /** + * + * + *
+     * If the requested object path is missing, and any
+     * `mainPageSuffix` object is missing, if applicable, the service
+     * will return the named object from this bucket as the content for a
+     * [https://tools.ietf.org/html/rfc7231#section-6.5.4][404 Not Found]
+     * result.
+     * 
+ * + * string not_found_page = 2; + * + * @return The bytes for notFoundPage. + */ + com.google.protobuf.ByteString getNotFoundPageBytes(); + } + /** + * + * + *
+   * Properties of a bucket related to accessing the contents as a static
+   * website. For more on hosting a static website via Cloud Storage, see
+   * https://cloud.google.com/storage/docs/hosting-static-website.
+   * 
+ * + * Protobuf type {@code google.storage.v2.Bucket.Website} + */ + public static final class Website extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.v2.Bucket.Website) + WebsiteOrBuilder { + private static final long serialVersionUID = 0L; + // Use Website.newBuilder() to construct. + private Website(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Website() { + mainPageSuffix_ = ""; + notFoundPage_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Website(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Website( + 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(); + + mainPageSuffix_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + notFoundPage_ = 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_Website_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_Bucket_Website_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.Bucket.Website.class, + com.google.storage.v2.Bucket.Website.Builder.class); + } + + public static final int MAIN_PAGE_SUFFIX_FIELD_NUMBER = 1; + private volatile java.lang.Object mainPageSuffix_; + /** + * + * + *
+     * If the requested object path is missing, the service will ensure the path
+     * has a trailing '/', append this suffix, and attempt to retrieve the
+     * resulting object. This allows the creation of `index.html`
+     * objects to represent directory pages.
+     * 
+ * + * string main_page_suffix = 1; + * + * @return The mainPageSuffix. + */ + @java.lang.Override + public java.lang.String getMainPageSuffix() { + java.lang.Object ref = mainPageSuffix_; + 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(); + mainPageSuffix_ = s; + return s; + } + } + /** + * + * + *
+     * If the requested object path is missing, the service will ensure the path
+     * has a trailing '/', append this suffix, and attempt to retrieve the
+     * resulting object. This allows the creation of `index.html`
+     * objects to represent directory pages.
+     * 
+ * + * string main_page_suffix = 1; + * + * @return The bytes for mainPageSuffix. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMainPageSuffixBytes() { + java.lang.Object ref = mainPageSuffix_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + mainPageSuffix_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NOT_FOUND_PAGE_FIELD_NUMBER = 2; + private volatile java.lang.Object notFoundPage_; + /** + * + * + *
+     * If the requested object path is missing, and any
+     * `mainPageSuffix` object is missing, if applicable, the service
+     * will return the named object from this bucket as the content for a
+     * [https://tools.ietf.org/html/rfc7231#section-6.5.4][404 Not Found]
+     * result.
+     * 
+ * + * string not_found_page = 2; + * + * @return The notFoundPage. + */ + @java.lang.Override + public java.lang.String getNotFoundPage() { + java.lang.Object ref = notFoundPage_; + 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(); + notFoundPage_ = s; + return s; + } + } + /** + * + * + *
+     * If the requested object path is missing, and any
+     * `mainPageSuffix` object is missing, if applicable, the service
+     * will return the named object from this bucket as the content for a
+     * [https://tools.ietf.org/html/rfc7231#section-6.5.4][404 Not Found]
+     * result.
+     * 
+ * + * string not_found_page = 2; + * + * @return The bytes for notFoundPage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNotFoundPageBytes() { + java.lang.Object ref = notFoundPage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + notFoundPage_ = 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 (!getMainPageSuffixBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, mainPageSuffix_); + } + if (!getNotFoundPageBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, notFoundPage_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getMainPageSuffixBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, mainPageSuffix_); + } + if (!getNotFoundPageBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, notFoundPage_); + } + 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.Website)) { + return super.equals(obj); + } + com.google.storage.v2.Bucket.Website other = (com.google.storage.v2.Bucket.Website) obj; + + if (!getMainPageSuffix().equals(other.getMainPageSuffix())) return false; + if (!getNotFoundPage().equals(other.getNotFoundPage())) 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) + MAIN_PAGE_SUFFIX_FIELD_NUMBER; + hash = (53 * hash) + getMainPageSuffix().hashCode(); + hash = (37 * hash) + NOT_FOUND_PAGE_FIELD_NUMBER; + hash = (53 * hash) + getNotFoundPage().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.v2.Bucket.Website parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.Bucket.Website 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.Website parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.Bucket.Website 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.Website parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.Bucket.Website 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.Website parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.Bucket.Website 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.Website parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.v2.Bucket.Website 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.Website 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.Website 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.Website 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 accessing the contents as a static
+     * website. For more on hosting a static website via Cloud Storage, see
+     * https://cloud.google.com/storage/docs/hosting-static-website.
+     * 
+ * + * Protobuf type {@code google.storage.v2.Bucket.Website} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.Bucket.Website) + com.google.storage.v2.Bucket.WebsiteOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_Bucket_Website_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_Bucket_Website_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.Bucket.Website.class, + com.google.storage.v2.Bucket.Website.Builder.class); + } + + // Construct using com.google.storage.v2.Bucket.Website.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + mainPageSuffix_ = ""; + + notFoundPage_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_Bucket_Website_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.Bucket.Website getDefaultInstanceForType() { + return com.google.storage.v2.Bucket.Website.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.Bucket.Website build() { + com.google.storage.v2.Bucket.Website result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.Bucket.Website buildPartial() { + com.google.storage.v2.Bucket.Website result = + new com.google.storage.v2.Bucket.Website(this); + result.mainPageSuffix_ = mainPageSuffix_; + result.notFoundPage_ = notFoundPage_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.storage.v2.Bucket.Website) { + return mergeFrom((com.google.storage.v2.Bucket.Website) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.Bucket.Website other) { + if (other == com.google.storage.v2.Bucket.Website.getDefaultInstance()) return this; + if (!other.getMainPageSuffix().isEmpty()) { + mainPageSuffix_ = other.mainPageSuffix_; + onChanged(); + } + if (!other.getNotFoundPage().isEmpty()) { + notFoundPage_ = other.notFoundPage_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.storage.v2.Bucket.Website parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.storage.v2.Bucket.Website) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object mainPageSuffix_ = ""; + /** + * + * + *
+       * If the requested object path is missing, the service will ensure the path
+       * has a trailing '/', append this suffix, and attempt to retrieve the
+       * resulting object. This allows the creation of `index.html`
+       * objects to represent directory pages.
+       * 
+ * + * string main_page_suffix = 1; + * + * @return The mainPageSuffix. + */ + public java.lang.String getMainPageSuffix() { + java.lang.Object ref = mainPageSuffix_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + mainPageSuffix_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * If the requested object path is missing, the service will ensure the path
+       * has a trailing '/', append this suffix, and attempt to retrieve the
+       * resulting object. This allows the creation of `index.html`
+       * objects to represent directory pages.
+       * 
+ * + * string main_page_suffix = 1; + * + * @return The bytes for mainPageSuffix. + */ + public com.google.protobuf.ByteString getMainPageSuffixBytes() { + java.lang.Object ref = mainPageSuffix_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + mainPageSuffix_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * If the requested object path is missing, the service will ensure the path
+       * has a trailing '/', append this suffix, and attempt to retrieve the
+       * resulting object. This allows the creation of `index.html`
+       * objects to represent directory pages.
+       * 
+ * + * string main_page_suffix = 1; + * + * @param value The mainPageSuffix to set. + * @return This builder for chaining. + */ + public Builder setMainPageSuffix(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + mainPageSuffix_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * If the requested object path is missing, the service will ensure the path
+       * has a trailing '/', append this suffix, and attempt to retrieve the
+       * resulting object. This allows the creation of `index.html`
+       * objects to represent directory pages.
+       * 
+ * + * string main_page_suffix = 1; + * + * @return This builder for chaining. + */ + public Builder clearMainPageSuffix() { + + mainPageSuffix_ = getDefaultInstance().getMainPageSuffix(); + onChanged(); + return this; + } + /** + * + * + *
+       * If the requested object path is missing, the service will ensure the path
+       * has a trailing '/', append this suffix, and attempt to retrieve the
+       * resulting object. This allows the creation of `index.html`
+       * objects to represent directory pages.
+       * 
+ * + * string main_page_suffix = 1; + * + * @param value The bytes for mainPageSuffix to set. + * @return This builder for chaining. + */ + public Builder setMainPageSuffixBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + mainPageSuffix_ = value; + onChanged(); + return this; + } + + private java.lang.Object notFoundPage_ = ""; + /** + * + * + *
+       * If the requested object path is missing, and any
+       * `mainPageSuffix` object is missing, if applicable, the service
+       * will return the named object from this bucket as the content for a
+       * [https://tools.ietf.org/html/rfc7231#section-6.5.4][404 Not Found]
+       * result.
+       * 
+ * + * string not_found_page = 2; + * + * @return The notFoundPage. + */ + public java.lang.String getNotFoundPage() { + java.lang.Object ref = notFoundPage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + notFoundPage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * If the requested object path is missing, and any
+       * `mainPageSuffix` object is missing, if applicable, the service
+       * will return the named object from this bucket as the content for a
+       * [https://tools.ietf.org/html/rfc7231#section-6.5.4][404 Not Found]
+       * result.
+       * 
+ * + * string not_found_page = 2; + * + * @return The bytes for notFoundPage. + */ + public com.google.protobuf.ByteString getNotFoundPageBytes() { + java.lang.Object ref = notFoundPage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + notFoundPage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * If the requested object path is missing, and any
+       * `mainPageSuffix` object is missing, if applicable, the service
+       * will return the named object from this bucket as the content for a
+       * [https://tools.ietf.org/html/rfc7231#section-6.5.4][404 Not Found]
+       * result.
+       * 
+ * + * string not_found_page = 2; + * + * @param value The notFoundPage to set. + * @return This builder for chaining. + */ + public Builder setNotFoundPage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + notFoundPage_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * If the requested object path is missing, and any
+       * `mainPageSuffix` object is missing, if applicable, the service
+       * will return the named object from this bucket as the content for a
+       * [https://tools.ietf.org/html/rfc7231#section-6.5.4][404 Not Found]
+       * result.
+       * 
+ * + * string not_found_page = 2; + * + * @return This builder for chaining. + */ + public Builder clearNotFoundPage() { + + notFoundPage_ = getDefaultInstance().getNotFoundPage(); + onChanged(); + return this; + } + /** + * + * + *
+       * If the requested object path is missing, and any
+       * `mainPageSuffix` object is missing, if applicable, the service
+       * will return the named object from this bucket as the content for a
+       * [https://tools.ietf.org/html/rfc7231#section-6.5.4][404 Not Found]
+       * result.
+       * 
+ * + * string not_found_page = 2; + * + * @param value The bytes for notFoundPage to set. + * @return This builder for chaining. + */ + public Builder setNotFoundPageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + notFoundPage_ = 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.Website) + } + + // @@protoc_insertion_point(class_scope:google.storage.v2.Bucket.Website) + private static final com.google.storage.v2.Bucket.Website DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.v2.Bucket.Website(); + } + + public static com.google.storage.v2.Bucket.Website getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Website parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Website(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.storage.v2.Bucket.Website getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Immutable. The name of the bucket.
+   * Global buckets will be of the format `projects/{project}/buckets/{bucket}`.
+   * Other sorts of buckets in the future are not guaranteed to follow this
+   * pattern.
+   * For globally unique bucket names, a `_` may be substituted for the project
+   * ID.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Immutable. The name of the bucket.
+   * Global buckets will be of the format `projects/{project}/buckets/{bucket}`.
+   * Other sorts of buckets in the future are not guaranteed to follow this
+   * pattern.
+   * For globally unique bucket names, a `_` may be substituted for the project
+   * ID.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BUCKET_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object bucketId_; + /** + * + * + *
+   * Output only. The user-chosen part of the bucket name. The `{bucket}` portion of the
+   * `name` field. For globally unique buckets, this is equal to the "bucket
+   * name" of other Cloud Storage APIs. Example: "pub".
+   * 
+ * + * string bucket_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bucketId. + */ + @java.lang.Override + public java.lang.String getBucketId() { + java.lang.Object ref = bucketId_; + 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(); + bucketId_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The user-chosen part of the bucket name. The `{bucket}` portion of the
+   * `name` field. For globally unique buckets, this is equal to the "bucket
+   * name" of other Cloud Storage APIs. Example: "pub".
+   * 
+ * + * string bucket_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for bucketId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBucketIdBytes() { + java.lang.Object ref = bucketId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + bucketId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_FIELD_NUMBER = 3; + private volatile java.lang.Object project_; + /** + * + * + *
+   * Immutable. The project which owns this bucket.
+   * Format: projects/{project_number}
+   * Example: `projects/123456`.
+   * 
+ * + * + * string project = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The project. + */ + @java.lang.Override + public java.lang.String getProject() { + java.lang.Object ref = project_; + 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(); + project_ = s; + return s; + } + } + /** + * + * + *
+   * Immutable. The project which owns this bucket.
+   * Format: projects/{project_number}
+   * Example: `projects/123456`.
+   * 
+ * + * + * string project = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for project. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int METAGENERATION_FIELD_NUMBER = 4; + private long metageneration_; + /** + * + * + *
+   * Output only. The metadata generation of this bucket.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * int64 metageneration = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The metageneration. + */ + @java.lang.Override + public long getMetageneration() { + return metageneration_; + } + + public static final int LOCATION_FIELD_NUMBER = 5; + private volatile java.lang.Object location_; + /** + * + * + *
+   * Immutable. The location of the bucket. Object data for objects in the bucket resides
+   * in physical storage within this region.  Defaults to `US`. See the
+   * [https://developers.google.com/storage/docs/concepts-techniques#specifyinglocations"][developer's
+   * guide] for the authoritative list. Attempting to update this field after
+   * the bucket is created will result in an error.
+   * 
+ * + * string location = 5 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The location. + */ + @java.lang.Override + public java.lang.String getLocation() { + java.lang.Object ref = location_; + 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(); + location_ = s; + return s; + } + } + /** + * + * + *
+   * Immutable. The location of the bucket. Object data for objects in the bucket resides
+   * in physical storage within this region.  Defaults to `US`. See the
+   * [https://developers.google.com/storage/docs/concepts-techniques#specifyinglocations"][developer's
+   * guide] for the authoritative list. Attempting to update this field after
+   * the bucket is created will result in an error.
+   * 
+ * + * string location = 5 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for location. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LOCATION_TYPE_FIELD_NUMBER = 6; + private volatile java.lang.Object locationType_; + /** + * + * + *
+   * Output only. The location type of the bucket (region, dual-region, multi-region, etc).
+   * 
+ * + * string location_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The locationType. + */ + @java.lang.Override + public java.lang.String getLocationType() { + java.lang.Object ref = locationType_; + 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(); + locationType_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The location type of the bucket (region, dual-region, multi-region, etc).
+   * 
+ * + * string location_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for locationType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLocationTypeBytes() { + java.lang.Object ref = locationType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + locationType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STORAGE_CLASS_FIELD_NUMBER = 7; + private volatile java.lang.Object storageClass_; + /** + * + * + *
+   * The bucket's default storage class, used whenever no storageClass is
+   * specified for a newly-created object. This defines how objects in the
+   * bucket are stored and determines the SLA and the cost of storage.
+   * If this value is not specified when the bucket is created, it will default
+   * to `STANDARD`. For more information, see
+   * https://developers.google.com/storage/docs/storage-classes.
+   * 
+ * + * string storage_class = 7; + * + * @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; + } + } + /** + * + * + *
+   * The bucket's default storage class, used whenever no storageClass is
+   * specified for a newly-created object. This defines how objects in the
+   * bucket are stored and determines the SLA and the cost of storage.
+   * If this value is not specified when the bucket is created, it will default
+   * to `STANDARD`. For more information, see
+   * https://developers.google.com/storage/docs/storage-classes.
+   * 
+ * + * string storage_class = 7; + * + * @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; + } + } + + public static final int ACL_FIELD_NUMBER = 8; + private java.util.List acl_; + /** + * + * + *
+   * Access controls on the bucket.
+   * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+   * requests to set, read, or modify acl is an error.
+   * 
+ * + * repeated .google.storage.v2.BucketAccessControl acl = 8; + */ + @java.lang.Override + public java.util.List getAclList() { + return acl_; + } + /** + * + * + *
+   * Access controls on the bucket.
+   * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+   * requests to set, read, or modify acl is an error.
+   * 
+ * + * repeated .google.storage.v2.BucketAccessControl acl = 8; + */ + @java.lang.Override + public java.util.List + getAclOrBuilderList() { + return acl_; + } + /** + * + * + *
+   * Access controls on the bucket.
+   * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+   * requests to set, read, or modify acl is an error.
+   * 
+ * + * repeated .google.storage.v2.BucketAccessControl acl = 8; + */ + @java.lang.Override + public int getAclCount() { + return acl_.size(); + } + /** + * + * + *
+   * Access controls on the bucket.
+   * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+   * requests to set, read, or modify acl is an error.
+   * 
+ * + * repeated .google.storage.v2.BucketAccessControl acl = 8; + */ + @java.lang.Override + public com.google.storage.v2.BucketAccessControl getAcl(int index) { + return acl_.get(index); + } + /** + * + * + *
+   * Access controls on the bucket.
+   * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+   * requests to set, read, or modify acl is an error.
+   * 
+ * + * repeated .google.storage.v2.BucketAccessControl acl = 8; + */ + @java.lang.Override + public com.google.storage.v2.BucketAccessControlOrBuilder getAclOrBuilder(int index) { + return acl_.get(index); + } + + public static final int DEFAULT_OBJECT_ACL_FIELD_NUMBER = 9; + private java.util.List defaultObjectAcl_; + /** + * + * + *
+   * Default access controls to apply to new objects when no ACL is provided.
+   * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+   * requests to set, read, or modify acl is an error.
+   * 
+ * + * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; + */ + @java.lang.Override + public java.util.List getDefaultObjectAclList() { + return defaultObjectAcl_; + } + /** + * + * + *
+   * Default access controls to apply to new objects when no ACL is provided.
+   * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+   * requests to set, read, or modify acl is an error.
+   * 
+ * + * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; + */ + @java.lang.Override + public java.util.List + getDefaultObjectAclOrBuilderList() { + return defaultObjectAcl_; + } + /** + * + * + *
+   * Default access controls to apply to new objects when no ACL is provided.
+   * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+   * requests to set, read, or modify acl is an error.
+   * 
+ * + * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; + */ + @java.lang.Override + public int getDefaultObjectAclCount() { + return defaultObjectAcl_.size(); + } + /** + * + * + *
+   * Default access controls to apply to new objects when no ACL is provided.
+   * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+   * requests to set, read, or modify acl is an error.
+   * 
+ * + * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; + */ + @java.lang.Override + public com.google.storage.v2.ObjectAccessControl getDefaultObjectAcl(int index) { + return defaultObjectAcl_.get(index); + } + /** + * + * + *
+   * Default access controls to apply to new objects when no ACL is provided.
+   * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+   * requests to set, read, or modify acl is an error.
+   * 
+ * + * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; + */ + @java.lang.Override + public com.google.storage.v2.ObjectAccessControlOrBuilder getDefaultObjectAclOrBuilder( + int index) { + return defaultObjectAcl_.get(index); + } + + public static final int LIFECYCLE_FIELD_NUMBER = 10; + private com.google.storage.v2.Bucket.Lifecycle lifecycle_; + /** + * + * + *
+   * The bucket's lifecycle config. See
+   * [https://developers.google.com/storage/docs/lifecycle]Lifecycle Management]
+   * for more information.
+   * 
+ * + * .google.storage.v2.Bucket.Lifecycle lifecycle = 10; + * + * @return Whether the lifecycle field is set. + */ + @java.lang.Override + public boolean hasLifecycle() { + return lifecycle_ != null; + } + /** + * + * + *
+   * The bucket's lifecycle config. See
+   * [https://developers.google.com/storage/docs/lifecycle]Lifecycle Management]
+   * for more information.
+   * 
+ * + * .google.storage.v2.Bucket.Lifecycle lifecycle = 10; + * + * @return The lifecycle. + */ + @java.lang.Override + public com.google.storage.v2.Bucket.Lifecycle getLifecycle() { + return lifecycle_ == null + ? com.google.storage.v2.Bucket.Lifecycle.getDefaultInstance() + : lifecycle_; + } + /** + * + * + *
+   * The bucket's lifecycle config. See
+   * [https://developers.google.com/storage/docs/lifecycle]Lifecycle Management]
+   * for more information.
+   * 
+ * + * .google.storage.v2.Bucket.Lifecycle lifecycle = 10; + */ + @java.lang.Override + public com.google.storage.v2.Bucket.LifecycleOrBuilder getLifecycleOrBuilder() { + return getLifecycle(); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 11; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The creation time of the bucket in
+   * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. The creation time of the bucket in
+   * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. The creation time of the bucket in
+   * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int CORS_FIELD_NUMBER = 12; + private java.util.List cors_; + /** + * + * + *
+   * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
+   * (CORS) config.
+   * 
+ * + * repeated .google.storage.v2.Bucket.Cors cors = 12; + */ + @java.lang.Override + public java.util.List getCorsList() { + return cors_; + } + /** + * + * + *
+   * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
+   * (CORS) config.
+   * 
+ * + * repeated .google.storage.v2.Bucket.Cors cors = 12; + */ + @java.lang.Override + public java.util.List + getCorsOrBuilderList() { + return cors_; + } + /** + * + * + *
+   * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
+   * (CORS) config.
+   * 
+ * + * repeated .google.storage.v2.Bucket.Cors cors = 12; + */ + @java.lang.Override + public int getCorsCount() { + return cors_.size(); + } + /** + * + * + *
+   * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
+   * (CORS) config.
+   * 
+ * + * repeated .google.storage.v2.Bucket.Cors cors = 12; + */ + @java.lang.Override + public com.google.storage.v2.Bucket.Cors getCors(int index) { + return cors_.get(index); + } + /** + * + * + *
+   * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
+   * (CORS) config.
+   * 
+ * + * repeated .google.storage.v2.Bucket.Cors cors = 12; + */ + @java.lang.Override + public com.google.storage.v2.Bucket.CorsOrBuilder getCorsOrBuilder(int index) { + return cors_.get(index); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 13; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The modification time of the bucket.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. The modification time of the bucket.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. The modification time of the bucket.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int DEFAULT_EVENT_BASED_HOLD_FIELD_NUMBER = 14; + private boolean defaultEventBasedHold_; + /** + * + * + *
+   * The default value for event-based hold on newly created objects in this
+   * bucket.  Event-based hold is a way to retain objects indefinitely until an
+   * event occurs, signified by the
+   * hold's release. After being released, such objects will be subject to
+   * bucket-level retention (if any).  One sample use case of this flag is for
+   * banks to hold loan documents for at least 3 years after loan is paid in
+   * full. Here, bucket-level retention is 3 years and the event is loan being
+   * paid in full. In this example, these objects will be held intact for any
+   * number of years until the event has occurred (event-based hold on the
+   * object is released) and then 3 more years after that. That means retention
+   * duration of the objects begins from the moment event-based hold
+   * transitioned from true to false.  Objects under event-based hold cannot be
+   * deleted, overwritten or archived until the hold is removed.
+   * 
+ * + * bool default_event_based_hold = 14; + * + * @return The defaultEventBasedHold. + */ + @java.lang.Override + public boolean getDefaultEventBasedHold() { + return defaultEventBasedHold_; + } + + public static final int LABELS_FIELD_NUMBER = 15; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_Bucket_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * User-provided labels, in key/value pairs.
+   * 
+ * + * map<string, string> labels = 15; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * User-provided labels, in key/value pairs.
+   * 
+ * + * map<string, string> labels = 15; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * User-provided labels, in key/value pairs.
+   * 
+ * + * map<string, string> labels = 15; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * User-provided labels, in key/value pairs.
+   * 
+ * + * map<string, string> labels = 15; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int WEBSITE_FIELD_NUMBER = 16; + private com.google.storage.v2.Bucket.Website website_; + /** + * + * + *
+   * The bucket's website config, controlling how the service behaves
+   * when accessing bucket contents as a web site. See the
+   * [https://cloud.google.com/storage/docs/static-website][Static Website
+   * Examples] for more information.
+   * 
+ * + * .google.storage.v2.Bucket.Website website = 16; + * + * @return Whether the website field is set. + */ + @java.lang.Override + public boolean hasWebsite() { + return website_ != null; + } + /** + * + * + *
+   * The bucket's website config, controlling how the service behaves
+   * when accessing bucket contents as a web site. See the
+   * [https://cloud.google.com/storage/docs/static-website][Static Website
+   * Examples] for more information.
+   * 
+ * + * .google.storage.v2.Bucket.Website website = 16; + * + * @return The website. + */ + @java.lang.Override + public com.google.storage.v2.Bucket.Website getWebsite() { + return website_ == null ? com.google.storage.v2.Bucket.Website.getDefaultInstance() : website_; + } + /** + * + * + *
+   * The bucket's website config, controlling how the service behaves
+   * when accessing bucket contents as a web site. See the
+   * [https://cloud.google.com/storage/docs/static-website][Static Website
+   * Examples] for more information.
+   * 
+ * + * .google.storage.v2.Bucket.Website website = 16; + */ + @java.lang.Override + public com.google.storage.v2.Bucket.WebsiteOrBuilder getWebsiteOrBuilder() { + return getWebsite(); + } + + public static final int VERSIONING_FIELD_NUMBER = 17; + private com.google.storage.v2.Bucket.Versioning versioning_; + /** + * + * + *
+   * The bucket's versioning config.
+   * 
+ * + * .google.storage.v2.Bucket.Versioning versioning = 17; + * + * @return Whether the versioning field is set. + */ + @java.lang.Override + public boolean hasVersioning() { + return versioning_ != null; + } + /** + * + * + *
+   * The bucket's versioning config.
+   * 
+ * + * .google.storage.v2.Bucket.Versioning versioning = 17; + * + * @return The versioning. + */ + @java.lang.Override + public com.google.storage.v2.Bucket.Versioning getVersioning() { + return versioning_ == null + ? com.google.storage.v2.Bucket.Versioning.getDefaultInstance() + : versioning_; + } + /** + * + * + *
+   * The bucket's versioning config.
+   * 
+ * + * .google.storage.v2.Bucket.Versioning versioning = 17; + */ + @java.lang.Override + public com.google.storage.v2.Bucket.VersioningOrBuilder getVersioningOrBuilder() { + return getVersioning(); + } + + public static final int LOGGING_FIELD_NUMBER = 18; + private com.google.storage.v2.Bucket.Logging logging_; + /** + * + * + *
+   * The bucket's logging config, which defines the destination bucket
+   * and name prefix (if any) for the current bucket's logs.
+   * 
+ * + * .google.storage.v2.Bucket.Logging logging = 18; + * + * @return Whether the logging field is set. + */ + @java.lang.Override + public boolean hasLogging() { + return logging_ != null; + } + /** + * + * + *
+   * The bucket's logging config, which defines the destination bucket
+   * and name prefix (if any) for the current bucket's logs.
+   * 
+ * + * .google.storage.v2.Bucket.Logging logging = 18; + * + * @return The logging. + */ + @java.lang.Override + public com.google.storage.v2.Bucket.Logging getLogging() { + return logging_ == null ? com.google.storage.v2.Bucket.Logging.getDefaultInstance() : logging_; + } + /** + * + * + *
+   * The bucket's logging config, which defines the destination bucket
+   * and name prefix (if any) for the current bucket's logs.
+   * 
+ * + * .google.storage.v2.Bucket.Logging logging = 18; + */ + @java.lang.Override + public com.google.storage.v2.Bucket.LoggingOrBuilder getLoggingOrBuilder() { + return getLogging(); + } + + public static final int OWNER_FIELD_NUMBER = 19; + private com.google.storage.v2.Owner owner_; + /** + * + * + *
+   * Output only. The owner of the bucket. This is always the project team's owner group.
+   * 
+ * + * .google.storage.v2.Owner owner = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the owner field is set. + */ + @java.lang.Override + public boolean hasOwner() { + return owner_ != null; + } + /** + * + * + *
+   * Output only. The owner of the bucket. This is always the project team's owner group.
+   * 
+ * + * .google.storage.v2.Owner owner = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The owner. + */ + @java.lang.Override + public com.google.storage.v2.Owner getOwner() { + return owner_ == null ? com.google.storage.v2.Owner.getDefaultInstance() : owner_; + } + /** + * + * + *
+   * Output only. The owner of the bucket. This is always the project team's owner group.
+   * 
+ * + * .google.storage.v2.Owner owner = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + @java.lang.Override + public com.google.storage.v2.OwnerOrBuilder getOwnerOrBuilder() { + return getOwner(); + } + + public static final int ENCRYPTION_FIELD_NUMBER = 20; + private com.google.storage.v2.Bucket.Encryption encryption_; + /** + * + * + *
+   * Encryption config for a bucket.
+   * 
+ * + * .google.storage.v2.Bucket.Encryption encryption = 20; + * + * @return Whether the encryption field is set. + */ + @java.lang.Override + public boolean hasEncryption() { + return encryption_ != null; + } + /** + * + * + *
+   * Encryption config for a bucket.
+   * 
+ * + * .google.storage.v2.Bucket.Encryption encryption = 20; + * + * @return The encryption. + */ + @java.lang.Override + public com.google.storage.v2.Bucket.Encryption getEncryption() { + return encryption_ == null + ? com.google.storage.v2.Bucket.Encryption.getDefaultInstance() + : encryption_; + } + /** + * + * + *
+   * Encryption config for a bucket.
+   * 
+ * + * .google.storage.v2.Bucket.Encryption encryption = 20; + */ + @java.lang.Override + public com.google.storage.v2.Bucket.EncryptionOrBuilder getEncryptionOrBuilder() { + return getEncryption(); + } + + public static final int BILLING_FIELD_NUMBER = 21; + private com.google.storage.v2.Bucket.Billing billing_; + /** + * + * + *
+   * The bucket's billing config.
+   * 
+ * + * .google.storage.v2.Bucket.Billing billing = 21; + * + * @return Whether the billing field is set. + */ + @java.lang.Override + public boolean hasBilling() { + return billing_ != null; + } + /** + * + * + *
+   * The bucket's billing config.
+   * 
+ * + * .google.storage.v2.Bucket.Billing billing = 21; + * + * @return The billing. + */ + @java.lang.Override + public com.google.storage.v2.Bucket.Billing getBilling() { + return billing_ == null ? com.google.storage.v2.Bucket.Billing.getDefaultInstance() : billing_; + } + /** + * + * + *
+   * The bucket's billing config.
+   * 
+ * + * .google.storage.v2.Bucket.Billing billing = 21; + */ + @java.lang.Override + public com.google.storage.v2.Bucket.BillingOrBuilder getBillingOrBuilder() { + return getBilling(); + } + + public static final int RETENTION_POLICY_FIELD_NUMBER = 22; + private com.google.storage.v2.Bucket.RetentionPolicy retentionPolicy_; + /** + * + * + *
+   * The bucket's retention policy. The retention policy enforces a minimum
+   * retention time for all objects contained in the bucket, based on their
+   * creation time. Any attempt to overwrite or delete objects younger than the
+   * retention period will result in a PERMISSION_DENIED error.  An unlocked
+   * retention policy can be modified or removed from the bucket via a
+   * storage.buckets.update operation. A locked retention policy cannot be
+   * removed or shortened in duration for the lifetime of the bucket.
+   * Attempting to remove or decrease period of a locked retention policy will
+   * result in a PERMISSION_DENIED error.
+   * 
+ * + * .google.storage.v2.Bucket.RetentionPolicy retention_policy = 22; + * + * @return Whether the retentionPolicy field is set. + */ + @java.lang.Override + public boolean hasRetentionPolicy() { + return retentionPolicy_ != null; + } + /** + * + * + *
+   * The bucket's retention policy. The retention policy enforces a minimum
+   * retention time for all objects contained in the bucket, based on their
+   * creation time. Any attempt to overwrite or delete objects younger than the
+   * retention period will result in a PERMISSION_DENIED error.  An unlocked
+   * retention policy can be modified or removed from the bucket via a
+   * storage.buckets.update operation. A locked retention policy cannot be
+   * removed or shortened in duration for the lifetime of the bucket.
+   * Attempting to remove or decrease period of a locked retention policy will
+   * result in a PERMISSION_DENIED error.
+   * 
+ * + * .google.storage.v2.Bucket.RetentionPolicy retention_policy = 22; + * + * @return The retentionPolicy. + */ + @java.lang.Override + public com.google.storage.v2.Bucket.RetentionPolicy getRetentionPolicy() { + return retentionPolicy_ == null + ? com.google.storage.v2.Bucket.RetentionPolicy.getDefaultInstance() + : retentionPolicy_; + } + /** + * + * + *
+   * The bucket's retention policy. The retention policy enforces a minimum
+   * retention time for all objects contained in the bucket, based on their
+   * creation time. Any attempt to overwrite or delete objects younger than the
+   * retention period will result in a PERMISSION_DENIED error.  An unlocked
+   * retention policy can be modified or removed from the bucket via a
+   * storage.buckets.update operation. A locked retention policy cannot be
+   * removed or shortened in duration for the lifetime of the bucket.
+   * Attempting to remove or decrease period of a locked retention policy will
+   * result in a PERMISSION_DENIED error.
+   * 
+ * + * .google.storage.v2.Bucket.RetentionPolicy retention_policy = 22; + */ + @java.lang.Override + public com.google.storage.v2.Bucket.RetentionPolicyOrBuilder getRetentionPolicyOrBuilder() { + return getRetentionPolicy(); + } + + public static final int IAM_CONFIG_FIELD_NUMBER = 23; + private com.google.storage.v2.Bucket.IamConfig iamConfig_; + /** + * + * + *
+   * The bucket's IAM config.
+   * 
+ * + * .google.storage.v2.Bucket.IamConfig iam_config = 23; + * + * @return Whether the iamConfig field is set. + */ + @java.lang.Override + public boolean hasIamConfig() { + return iamConfig_ != null; + } + /** + * + * + *
+   * The bucket's IAM config.
+   * 
+ * + * .google.storage.v2.Bucket.IamConfig iam_config = 23; + * + * @return The iamConfig. + */ + @java.lang.Override + public com.google.storage.v2.Bucket.IamConfig getIamConfig() { + return iamConfig_ == null + ? com.google.storage.v2.Bucket.IamConfig.getDefaultInstance() + : iamConfig_; + } + /** + * + * + *
+   * The bucket's IAM config.
+   * 
+ * + * .google.storage.v2.Bucket.IamConfig iam_config = 23; + */ + @java.lang.Override + public com.google.storage.v2.Bucket.IamConfigOrBuilder getIamConfigOrBuilder() { + return getIamConfig(); + } + + public static final int ZONE_AFFINITY_FIELD_NUMBER = 24; + private com.google.protobuf.LazyStringList zoneAffinity_; + /** + * + * + *
+   * Immutable. The zone or zones from which the bucket is intended to use zonal quota.
+   * Requests for data from outside the specified affinities are still allowed
+   * but won't be able to use zonal quota. The values are case-insensitive.
+   * Attempting to update this field after bucket is created will result in an
+   * error.
+   * 
+ * + * repeated string zone_affinity = 24 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return A list containing the zoneAffinity. + */ + public com.google.protobuf.ProtocolStringList getZoneAffinityList() { + return zoneAffinity_; + } + /** + * + * + *
+   * Immutable. The zone or zones from which the bucket is intended to use zonal quota.
+   * Requests for data from outside the specified affinities are still allowed
+   * but won't be able to use zonal quota. The values are case-insensitive.
+   * Attempting to update this field after bucket is created will result in an
+   * error.
+   * 
+ * + * repeated string zone_affinity = 24 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The count of zoneAffinity. + */ + public int getZoneAffinityCount() { + return zoneAffinity_.size(); + } + /** + * + * + *
+   * Immutable. The zone or zones from which the bucket is intended to use zonal quota.
+   * Requests for data from outside the specified affinities are still allowed
+   * but won't be able to use zonal quota. The values are case-insensitive.
+   * Attempting to update this field after bucket is created will result in an
+   * error.
+   * 
+ * + * repeated string zone_affinity = 24 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param index The index of the element to return. + * @return The zoneAffinity at the given index. + */ + public java.lang.String getZoneAffinity(int index) { + return zoneAffinity_.get(index); + } + /** + * + * + *
+   * Immutable. The zone or zones from which the bucket is intended to use zonal quota.
+   * Requests for data from outside the specified affinities are still allowed
+   * but won't be able to use zonal quota. The values are case-insensitive.
+   * Attempting to update this field after bucket is created will result in an
+   * error.
+   * 
+ * + * repeated string zone_affinity = 24 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param index The index of the value to return. + * @return The bytes of the zoneAffinity at the given index. + */ + public com.google.protobuf.ByteString getZoneAffinityBytes(int index) { + return zoneAffinity_.getByteString(index); + } + + public static final int SATISFIES_PZS_FIELD_NUMBER = 25; + private boolean satisfiesPzs_; + /** + * + * + *
+   * Reserved for future use.
+   * 
+ * + * bool satisfies_pzs = 25; + * + * @return The satisfiesPzs. + */ + @java.lang.Override + public boolean getSatisfiesPzs() { + return satisfiesPzs_; + } + + 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getBucketIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, bucketId_); + } + if (!getProjectBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, project_); + } + if (metageneration_ != 0L) { + output.writeInt64(4, metageneration_); + } + if (!getLocationBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, location_); + } + if (!getLocationTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, locationType_); + } + if (!getStorageClassBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, storageClass_); + } + for (int i = 0; i < acl_.size(); i++) { + output.writeMessage(8, acl_.get(i)); + } + for (int i = 0; i < defaultObjectAcl_.size(); i++) { + output.writeMessage(9, defaultObjectAcl_.get(i)); + } + if (lifecycle_ != null) { + output.writeMessage(10, getLifecycle()); + } + if (createTime_ != null) { + output.writeMessage(11, getCreateTime()); + } + for (int i = 0; i < cors_.size(); i++) { + output.writeMessage(12, cors_.get(i)); + } + if (updateTime_ != null) { + output.writeMessage(13, getUpdateTime()); + } + if (defaultEventBasedHold_ != false) { + output.writeBool(14, defaultEventBasedHold_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 15); + if (website_ != null) { + output.writeMessage(16, getWebsite()); + } + if (versioning_ != null) { + output.writeMessage(17, getVersioning()); + } + if (logging_ != null) { + output.writeMessage(18, getLogging()); + } + if (owner_ != null) { + output.writeMessage(19, getOwner()); + } + if (encryption_ != null) { + output.writeMessage(20, getEncryption()); + } + if (billing_ != null) { + output.writeMessage(21, getBilling()); + } + if (retentionPolicy_ != null) { + output.writeMessage(22, getRetentionPolicy()); + } + if (iamConfig_ != null) { + output.writeMessage(23, getIamConfig()); + } + for (int i = 0; i < zoneAffinity_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 24, zoneAffinity_.getRaw(i)); + } + if (satisfiesPzs_ != false) { + output.writeBool(25, satisfiesPzs_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getBucketIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, bucketId_); + } + if (!getProjectBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, project_); + } + if (metageneration_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, metageneration_); + } + if (!getLocationBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, location_); + } + if (!getLocationTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, locationType_); + } + if (!getStorageClassBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, storageClass_); + } + for (int i = 0; i < acl_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, acl_.get(i)); + } + for (int i = 0; i < defaultObjectAcl_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, defaultObjectAcl_.get(i)); + } + if (lifecycle_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getLifecycle()); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getCreateTime()); + } + for (int i = 0; i < cors_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, cors_.get(i)); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, getUpdateTime()); + } + if (defaultEventBasedHold_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(14, defaultEventBasedHold_); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(15, labels__); + } + if (website_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(16, getWebsite()); + } + if (versioning_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(17, getVersioning()); + } + if (logging_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(18, getLogging()); + } + if (owner_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(19, getOwner()); + } + if (encryption_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(20, getEncryption()); + } + if (billing_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(21, getBilling()); + } + if (retentionPolicy_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(22, getRetentionPolicy()); + } + if (iamConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(23, getIamConfig()); + } + { + int dataSize = 0; + for (int i = 0; i < zoneAffinity_.size(); i++) { + dataSize += computeStringSizeNoTag(zoneAffinity_.getRaw(i)); + } + size += dataSize; + size += 2 * getZoneAffinityList().size(); + } + if (satisfiesPzs_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(25, satisfiesPzs_); + } + 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)) { + return super.equals(obj); + } + com.google.storage.v2.Bucket other = (com.google.storage.v2.Bucket) obj; + + if (!getName().equals(other.getName())) return false; + if (!getBucketId().equals(other.getBucketId())) return false; + if (!getProject().equals(other.getProject())) return false; + if (getMetageneration() != other.getMetageneration()) return false; + if (!getLocation().equals(other.getLocation())) return false; + if (!getLocationType().equals(other.getLocationType())) return false; + if (!getStorageClass().equals(other.getStorageClass())) return false; + if (!getAclList().equals(other.getAclList())) return false; + if (!getDefaultObjectAclList().equals(other.getDefaultObjectAclList())) return false; + if (hasLifecycle() != other.hasLifecycle()) return false; + if (hasLifecycle()) { + if (!getLifecycle().equals(other.getLifecycle())) return false; + } + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (!getCorsList().equals(other.getCorsList())) return false; + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (getDefaultEventBasedHold() != other.getDefaultEventBasedHold()) return false; + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (hasWebsite() != other.hasWebsite()) return false; + if (hasWebsite()) { + if (!getWebsite().equals(other.getWebsite())) return false; + } + if (hasVersioning() != other.hasVersioning()) return false; + if (hasVersioning()) { + if (!getVersioning().equals(other.getVersioning())) return false; + } + if (hasLogging() != other.hasLogging()) return false; + if (hasLogging()) { + if (!getLogging().equals(other.getLogging())) return false; + } + if (hasOwner() != other.hasOwner()) return false; + if (hasOwner()) { + if (!getOwner().equals(other.getOwner())) return false; + } + if (hasEncryption() != other.hasEncryption()) return false; + if (hasEncryption()) { + if (!getEncryption().equals(other.getEncryption())) return false; + } + if (hasBilling() != other.hasBilling()) return false; + if (hasBilling()) { + if (!getBilling().equals(other.getBilling())) return false; + } + if (hasRetentionPolicy() != other.hasRetentionPolicy()) return false; + if (hasRetentionPolicy()) { + if (!getRetentionPolicy().equals(other.getRetentionPolicy())) return false; + } + if (hasIamConfig() != other.hasIamConfig()) return false; + if (hasIamConfig()) { + if (!getIamConfig().equals(other.getIamConfig())) return false; + } + if (!getZoneAffinityList().equals(other.getZoneAffinityList())) return false; + if (getSatisfiesPzs() != other.getSatisfiesPzs()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + BUCKET_ID_FIELD_NUMBER; + hash = (53 * hash) + getBucketId().hashCode(); + hash = (37 * hash) + PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getProject().hashCode(); + hash = (37 * hash) + METAGENERATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getMetageneration()); + hash = (37 * hash) + LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getLocation().hashCode(); + hash = (37 * hash) + LOCATION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getLocationType().hashCode(); + hash = (37 * hash) + STORAGE_CLASS_FIELD_NUMBER; + hash = (53 * hash) + getStorageClass().hashCode(); + if (getAclCount() > 0) { + hash = (37 * hash) + ACL_FIELD_NUMBER; + hash = (53 * hash) + getAclList().hashCode(); + } + if (getDefaultObjectAclCount() > 0) { + hash = (37 * hash) + DEFAULT_OBJECT_ACL_FIELD_NUMBER; + hash = (53 * hash) + getDefaultObjectAclList().hashCode(); + } + if (hasLifecycle()) { + hash = (37 * hash) + LIFECYCLE_FIELD_NUMBER; + hash = (53 * hash) + getLifecycle().hashCode(); + } + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (getCorsCount() > 0) { + hash = (37 * hash) + CORS_FIELD_NUMBER; + hash = (53 * hash) + getCorsList().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + hash = (37 * hash) + DEFAULT_EVENT_BASED_HOLD_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDefaultEventBasedHold()); + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + if (hasWebsite()) { + hash = (37 * hash) + WEBSITE_FIELD_NUMBER; + hash = (53 * hash) + getWebsite().hashCode(); + } + if (hasVersioning()) { + hash = (37 * hash) + VERSIONING_FIELD_NUMBER; + hash = (53 * hash) + getVersioning().hashCode(); + } + if (hasLogging()) { + hash = (37 * hash) + LOGGING_FIELD_NUMBER; + hash = (53 * hash) + getLogging().hashCode(); + } + if (hasOwner()) { + hash = (37 * hash) + OWNER_FIELD_NUMBER; + hash = (53 * hash) + getOwner().hashCode(); + } + if (hasEncryption()) { + hash = (37 * hash) + ENCRYPTION_FIELD_NUMBER; + hash = (53 * hash) + getEncryption().hashCode(); + } + if (hasBilling()) { + hash = (37 * hash) + BILLING_FIELD_NUMBER; + hash = (53 * hash) + getBilling().hashCode(); + } + if (hasRetentionPolicy()) { + hash = (37 * hash) + RETENTION_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getRetentionPolicy().hashCode(); + } + if (hasIamConfig()) { + hash = (37 * hash) + IAM_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getIamConfig().hashCode(); + } + if (getZoneAffinityCount() > 0) { + hash = (37 * hash) + ZONE_AFFINITY_FIELD_NUMBER; + hash = (53 * hash) + getZoneAffinityList().hashCode(); + } + hash = (37 * hash) + SATISFIES_PZS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSatisfiesPzs()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.v2.Bucket parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.Bucket 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 parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.Bucket 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 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.Bucket 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 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.Bucket 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 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.v2.Bucket 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 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 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 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 bucket.
+   * 
+ * + * Protobuf type {@code google.storage.v2.Bucket} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.Bucket) + com.google.storage.v2.BucketOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto.internal_static_google_storage_v2_Bucket_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 15: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 15: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_Bucket_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.Bucket.class, com.google.storage.v2.Bucket.Builder.class); + } + + // Construct using com.google.storage.v2.Bucket.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getAclFieldBuilder(); + getDefaultObjectAclFieldBuilder(); + getCorsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + bucketId_ = ""; + + project_ = ""; + + metageneration_ = 0L; + + location_ = ""; + + locationType_ = ""; + + storageClass_ = ""; + + if (aclBuilder_ == null) { + acl_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + aclBuilder_.clear(); + } + if (defaultObjectAclBuilder_ == null) { + defaultObjectAcl_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + defaultObjectAclBuilder_.clear(); + } + if (lifecycleBuilder_ == null) { + lifecycle_ = null; + } else { + lifecycle_ = null; + lifecycleBuilder_ = null; + } + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (corsBuilder_ == null) { + cors_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + corsBuilder_.clear(); + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + defaultEventBasedHold_ = false; + + internalGetMutableLabels().clear(); + if (websiteBuilder_ == null) { + website_ = null; + } else { + website_ = null; + websiteBuilder_ = null; + } + if (versioningBuilder_ == null) { + versioning_ = null; + } else { + versioning_ = null; + versioningBuilder_ = null; + } + if (loggingBuilder_ == null) { + logging_ = null; + } else { + logging_ = null; + loggingBuilder_ = null; + } + if (ownerBuilder_ == null) { + owner_ = null; + } else { + owner_ = null; + ownerBuilder_ = null; + } + if (encryptionBuilder_ == null) { + encryption_ = null; + } else { + encryption_ = null; + encryptionBuilder_ = null; + } + if (billingBuilder_ == null) { + billing_ = null; + } else { + billing_ = null; + billingBuilder_ = null; + } + if (retentionPolicyBuilder_ == null) { + retentionPolicy_ = null; + } else { + retentionPolicy_ = null; + retentionPolicyBuilder_ = null; + } + if (iamConfigBuilder_ == null) { + iamConfig_ = null; + } else { + iamConfig_ = null; + iamConfigBuilder_ = null; + } + zoneAffinity_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000010); + satisfiesPzs_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto.internal_static_google_storage_v2_Bucket_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.Bucket getDefaultInstanceForType() { + return com.google.storage.v2.Bucket.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.Bucket build() { + com.google.storage.v2.Bucket result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.Bucket buildPartial() { + com.google.storage.v2.Bucket result = new com.google.storage.v2.Bucket(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.bucketId_ = bucketId_; + result.project_ = project_; + result.metageneration_ = metageneration_; + result.location_ = location_; + result.locationType_ = locationType_; + result.storageClass_ = storageClass_; + if (aclBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + acl_ = java.util.Collections.unmodifiableList(acl_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.acl_ = acl_; + } else { + result.acl_ = aclBuilder_.build(); + } + if (defaultObjectAclBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + defaultObjectAcl_ = java.util.Collections.unmodifiableList(defaultObjectAcl_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.defaultObjectAcl_ = defaultObjectAcl_; + } else { + result.defaultObjectAcl_ = defaultObjectAclBuilder_.build(); + } + if (lifecycleBuilder_ == null) { + result.lifecycle_ = lifecycle_; + } else { + result.lifecycle_ = lifecycleBuilder_.build(); + } + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (corsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + cors_ = java.util.Collections.unmodifiableList(cors_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.cors_ = cors_; + } else { + result.cors_ = corsBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + result.defaultEventBasedHold_ = defaultEventBasedHold_; + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + if (websiteBuilder_ == null) { + result.website_ = website_; + } else { + result.website_ = websiteBuilder_.build(); + } + if (versioningBuilder_ == null) { + result.versioning_ = versioning_; + } else { + result.versioning_ = versioningBuilder_.build(); + } + if (loggingBuilder_ == null) { + result.logging_ = logging_; + } else { + result.logging_ = loggingBuilder_.build(); + } + if (ownerBuilder_ == null) { + result.owner_ = owner_; + } else { + result.owner_ = ownerBuilder_.build(); + } + if (encryptionBuilder_ == null) { + result.encryption_ = encryption_; + } else { + result.encryption_ = encryptionBuilder_.build(); + } + if (billingBuilder_ == null) { + result.billing_ = billing_; + } else { + result.billing_ = billingBuilder_.build(); + } + if (retentionPolicyBuilder_ == null) { + result.retentionPolicy_ = retentionPolicy_; + } else { + result.retentionPolicy_ = retentionPolicyBuilder_.build(); + } + if (iamConfigBuilder_ == null) { + result.iamConfig_ = iamConfig_; + } else { + result.iamConfig_ = iamConfigBuilder_.build(); + } + if (((bitField0_ & 0x00000010) != 0)) { + zoneAffinity_ = zoneAffinity_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.zoneAffinity_ = zoneAffinity_; + result.satisfiesPzs_ = satisfiesPzs_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.storage.v2.Bucket) { + return mergeFrom((com.google.storage.v2.Bucket) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.Bucket other) { + if (other == com.google.storage.v2.Bucket.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getBucketId().isEmpty()) { + bucketId_ = other.bucketId_; + onChanged(); + } + if (!other.getProject().isEmpty()) { + project_ = other.project_; + onChanged(); + } + if (other.getMetageneration() != 0L) { + setMetageneration(other.getMetageneration()); + } + if (!other.getLocation().isEmpty()) { + location_ = other.location_; + onChanged(); + } + if (!other.getLocationType().isEmpty()) { + locationType_ = other.locationType_; + onChanged(); + } + if (!other.getStorageClass().isEmpty()) { + storageClass_ = other.storageClass_; + onChanged(); + } + if (aclBuilder_ == null) { + if (!other.acl_.isEmpty()) { + if (acl_.isEmpty()) { + acl_ = other.acl_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAclIsMutable(); + acl_.addAll(other.acl_); + } + onChanged(); + } + } else { + if (!other.acl_.isEmpty()) { + if (aclBuilder_.isEmpty()) { + aclBuilder_.dispose(); + aclBuilder_ = null; + acl_ = other.acl_; + bitField0_ = (bitField0_ & ~0x00000001); + aclBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getAclFieldBuilder() + : null; + } else { + aclBuilder_.addAllMessages(other.acl_); + } + } + } + if (defaultObjectAclBuilder_ == null) { + if (!other.defaultObjectAcl_.isEmpty()) { + if (defaultObjectAcl_.isEmpty()) { + defaultObjectAcl_ = other.defaultObjectAcl_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureDefaultObjectAclIsMutable(); + defaultObjectAcl_.addAll(other.defaultObjectAcl_); + } + onChanged(); + } + } else { + if (!other.defaultObjectAcl_.isEmpty()) { + if (defaultObjectAclBuilder_.isEmpty()) { + defaultObjectAclBuilder_.dispose(); + defaultObjectAclBuilder_ = null; + defaultObjectAcl_ = other.defaultObjectAcl_; + bitField0_ = (bitField0_ & ~0x00000002); + defaultObjectAclBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDefaultObjectAclFieldBuilder() + : null; + } else { + defaultObjectAclBuilder_.addAllMessages(other.defaultObjectAcl_); + } + } + } + if (other.hasLifecycle()) { + mergeLifecycle(other.getLifecycle()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (corsBuilder_ == null) { + if (!other.cors_.isEmpty()) { + if (cors_.isEmpty()) { + cors_ = other.cors_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureCorsIsMutable(); + cors_.addAll(other.cors_); + } + onChanged(); + } + } else { + if (!other.cors_.isEmpty()) { + if (corsBuilder_.isEmpty()) { + corsBuilder_.dispose(); + corsBuilder_ = null; + cors_ = other.cors_; + bitField0_ = (bitField0_ & ~0x00000004); + corsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getCorsFieldBuilder() + : null; + } else { + corsBuilder_.addAllMessages(other.cors_); + } + } + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.getDefaultEventBasedHold() != false) { + setDefaultEventBasedHold(other.getDefaultEventBasedHold()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + if (other.hasWebsite()) { + mergeWebsite(other.getWebsite()); + } + if (other.hasVersioning()) { + mergeVersioning(other.getVersioning()); + } + if (other.hasLogging()) { + mergeLogging(other.getLogging()); + } + if (other.hasOwner()) { + mergeOwner(other.getOwner()); + } + if (other.hasEncryption()) { + mergeEncryption(other.getEncryption()); + } + if (other.hasBilling()) { + mergeBilling(other.getBilling()); + } + if (other.hasRetentionPolicy()) { + mergeRetentionPolicy(other.getRetentionPolicy()); + } + if (other.hasIamConfig()) { + mergeIamConfig(other.getIamConfig()); + } + if (!other.zoneAffinity_.isEmpty()) { + if (zoneAffinity_.isEmpty()) { + zoneAffinity_ = other.zoneAffinity_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureZoneAffinityIsMutable(); + zoneAffinity_.addAll(other.zoneAffinity_); + } + onChanged(); + } + if (other.getSatisfiesPzs() != false) { + setSatisfiesPzs(other.getSatisfiesPzs()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.storage.v2.Bucket parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.storage.v2.Bucket) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Immutable. The name of the bucket.
+     * Global buckets will be of the format `projects/{project}/buckets/{bucket}`.
+     * Other sorts of buckets in the future are not guaranteed to follow this
+     * pattern.
+     * For globally unique bucket names, a `_` may be substituted for the project
+     * ID.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Immutable. The name of the bucket.
+     * Global buckets will be of the format `projects/{project}/buckets/{bucket}`.
+     * Other sorts of buckets in the future are not guaranteed to follow this
+     * pattern.
+     * For globally unique bucket names, a `_` may be substituted for the project
+     * ID.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Immutable. The name of the bucket.
+     * Global buckets will be of the format `projects/{project}/buckets/{bucket}`.
+     * Other sorts of buckets in the future are not guaranteed to follow this
+     * pattern.
+     * For globally unique bucket names, a `_` may be substituted for the project
+     * ID.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The name of the bucket.
+     * Global buckets will be of the format `projects/{project}/buckets/{bucket}`.
+     * Other sorts of buckets in the future are not guaranteed to follow this
+     * pattern.
+     * For globally unique bucket names, a `_` may be substituted for the project
+     * ID.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The name of the bucket.
+     * Global buckets will be of the format `projects/{project}/buckets/{bucket}`.
+     * Other sorts of buckets in the future are not guaranteed to follow this
+     * pattern.
+     * For globally unique bucket names, a `_` may be substituted for the project
+     * ID.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object bucketId_ = ""; + /** + * + * + *
+     * Output only. The user-chosen part of the bucket name. The `{bucket}` portion of the
+     * `name` field. For globally unique buckets, this is equal to the "bucket
+     * name" of other Cloud Storage APIs. Example: "pub".
+     * 
+ * + * string bucket_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bucketId. + */ + public java.lang.String getBucketId() { + java.lang.Object ref = bucketId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + bucketId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The user-chosen part of the bucket name. The `{bucket}` portion of the
+     * `name` field. For globally unique buckets, this is equal to the "bucket
+     * name" of other Cloud Storage APIs. Example: "pub".
+     * 
+ * + * string bucket_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for bucketId. + */ + public com.google.protobuf.ByteString getBucketIdBytes() { + java.lang.Object ref = bucketId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + bucketId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The user-chosen part of the bucket name. The `{bucket}` portion of the
+     * `name` field. For globally unique buckets, this is equal to the "bucket
+     * name" of other Cloud Storage APIs. Example: "pub".
+     * 
+ * + * string bucket_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bucketId to set. + * @return This builder for chaining. + */ + public Builder setBucketId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + bucketId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The user-chosen part of the bucket name. The `{bucket}` portion of the
+     * `name` field. For globally unique buckets, this is equal to the "bucket
+     * name" of other Cloud Storage APIs. Example: "pub".
+     * 
+ * + * string bucket_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearBucketId() { + + bucketId_ = getDefaultInstance().getBucketId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The user-chosen part of the bucket name. The `{bucket}` portion of the
+     * `name` field. For globally unique buckets, this is equal to the "bucket
+     * name" of other Cloud Storage APIs. Example: "pub".
+     * 
+ * + * string bucket_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for bucketId to set. + * @return This builder for chaining. + */ + public Builder setBucketIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + bucketId_ = value; + onChanged(); + return this; + } + + private java.lang.Object project_ = ""; + /** + * + * + *
+     * Immutable. The project which owns this bucket.
+     * Format: projects/{project_number}
+     * Example: `projects/123456`.
+     * 
+ * + * + * string project = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The project. + */ + public java.lang.String getProject() { + java.lang.Object ref = project_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + project_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Immutable. The project which owns this bucket.
+     * Format: projects/{project_number}
+     * Example: `projects/123456`.
+     * 
+ * + * + * string project = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for project. + */ + public com.google.protobuf.ByteString getProjectBytes() { + java.lang.Object ref = project_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + project_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Immutable. The project which owns this bucket.
+     * Format: projects/{project_number}
+     * Example: `projects/123456`.
+     * 
+ * + * + * string project = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @param value The project to set. + * @return This builder for chaining. + */ + public Builder setProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + project_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The project which owns this bucket.
+     * Format: projects/{project_number}
+     * Example: `projects/123456`.
+     * 
+ * + * + * string project = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearProject() { + + project_ = getDefaultInstance().getProject(); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The project which owns this bucket.
+     * Format: projects/{project_number}
+     * Example: `projects/123456`.
+     * 
+ * + * + * string project = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for project to set. + * @return This builder for chaining. + */ + public Builder setProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + project_ = value; + onChanged(); + return this; + } + + private long metageneration_; + /** + * + * + *
+     * Output only. The metadata generation of this bucket.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * int64 metageneration = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The metageneration. + */ + @java.lang.Override + public long getMetageneration() { + return metageneration_; + } + /** + * + * + *
+     * Output only. The metadata generation of this bucket.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * int64 metageneration = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The metageneration to set. + * @return This builder for chaining. + */ + public Builder setMetageneration(long value) { + + metageneration_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The metadata generation of this bucket.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * int64 metageneration = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearMetageneration() { + + metageneration_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object location_ = ""; + /** + * + * + *
+     * Immutable. The location of the bucket. Object data for objects in the bucket resides
+     * in physical storage within this region.  Defaults to `US`. See the
+     * [https://developers.google.com/storage/docs/concepts-techniques#specifyinglocations"][developer's
+     * guide] for the authoritative list. Attempting to update this field after
+     * the bucket is created will result in an error.
+     * 
+ * + * string location = 5 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The location. + */ + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Immutable. The location of the bucket. Object data for objects in the bucket resides
+     * in physical storage within this region.  Defaults to `US`. See the
+     * [https://developers.google.com/storage/docs/concepts-techniques#specifyinglocations"][developer's
+     * guide] for the authoritative list. Attempting to update this field after
+     * the bucket is created will result in an error.
+     * 
+ * + * string location = 5 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for location. + */ + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Immutable. The location of the bucket. Object data for objects in the bucket resides
+     * in physical storage within this region.  Defaults to `US`. See the
+     * [https://developers.google.com/storage/docs/concepts-techniques#specifyinglocations"][developer's
+     * guide] for the authoritative list. Attempting to update this field after
+     * the bucket is created will result in an error.
+     * 
+ * + * string location = 5 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The location to set. + * @return This builder for chaining. + */ + public Builder setLocation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + location_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The location of the bucket. Object data for objects in the bucket resides
+     * in physical storage within this region.  Defaults to `US`. See the
+     * [https://developers.google.com/storage/docs/concepts-techniques#specifyinglocations"][developer's
+     * guide] for the authoritative list. Attempting to update this field after
+     * the bucket is created will result in an error.
+     * 
+ * + * string location = 5 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearLocation() { + + location_ = getDefaultInstance().getLocation(); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The location of the bucket. Object data for objects in the bucket resides
+     * in physical storage within this region.  Defaults to `US`. See the
+     * [https://developers.google.com/storage/docs/concepts-techniques#specifyinglocations"][developer's
+     * guide] for the authoritative list. Attempting to update this field after
+     * the bucket is created will result in an error.
+     * 
+ * + * string location = 5 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The bytes for location to set. + * @return This builder for chaining. + */ + public Builder setLocationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + location_ = value; + onChanged(); + return this; + } + + private java.lang.Object locationType_ = ""; + /** + * + * + *
+     * Output only. The location type of the bucket (region, dual-region, multi-region, etc).
+     * 
+ * + * string location_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The locationType. + */ + public java.lang.String getLocationType() { + java.lang.Object ref = locationType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + locationType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The location type of the bucket (region, dual-region, multi-region, etc).
+     * 
+ * + * string location_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for locationType. + */ + public com.google.protobuf.ByteString getLocationTypeBytes() { + java.lang.Object ref = locationType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + locationType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The location type of the bucket (region, dual-region, multi-region, etc).
+     * 
+ * + * string location_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The locationType to set. + * @return This builder for chaining. + */ + public Builder setLocationType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + locationType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The location type of the bucket (region, dual-region, multi-region, etc).
+     * 
+ * + * string location_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearLocationType() { + + locationType_ = getDefaultInstance().getLocationType(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The location type of the bucket (region, dual-region, multi-region, etc).
+     * 
+ * + * string location_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for locationType to set. + * @return This builder for chaining. + */ + public Builder setLocationTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + locationType_ = value; + onChanged(); + return this; + } + + private java.lang.Object storageClass_ = ""; + /** + * + * + *
+     * The bucket's default storage class, used whenever no storageClass is
+     * specified for a newly-created object. This defines how objects in the
+     * bucket are stored and determines the SLA and the cost of storage.
+     * If this value is not specified when the bucket is created, it will default
+     * to `STANDARD`. For more information, see
+     * https://developers.google.com/storage/docs/storage-classes.
+     * 
+ * + * string storage_class = 7; + * + * @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; + } + } + /** + * + * + *
+     * The bucket's default storage class, used whenever no storageClass is
+     * specified for a newly-created object. This defines how objects in the
+     * bucket are stored and determines the SLA and the cost of storage.
+     * If this value is not specified when the bucket is created, it will default
+     * to `STANDARD`. For more information, see
+     * https://developers.google.com/storage/docs/storage-classes.
+     * 
+ * + * string storage_class = 7; + * + * @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; + } + } + /** + * + * + *
+     * The bucket's default storage class, used whenever no storageClass is
+     * specified for a newly-created object. This defines how objects in the
+     * bucket are stored and determines the SLA and the cost of storage.
+     * If this value is not specified when the bucket is created, it will default
+     * to `STANDARD`. For more information, see
+     * https://developers.google.com/storage/docs/storage-classes.
+     * 
+ * + * string storage_class = 7; + * + * @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; + } + /** + * + * + *
+     * The bucket's default storage class, used whenever no storageClass is
+     * specified for a newly-created object. This defines how objects in the
+     * bucket are stored and determines the SLA and the cost of storage.
+     * If this value is not specified when the bucket is created, it will default
+     * to `STANDARD`. For more information, see
+     * https://developers.google.com/storage/docs/storage-classes.
+     * 
+ * + * string storage_class = 7; + * + * @return This builder for chaining. + */ + public Builder clearStorageClass() { + + storageClass_ = getDefaultInstance().getStorageClass(); + onChanged(); + return this; + } + /** + * + * + *
+     * The bucket's default storage class, used whenever no storageClass is
+     * specified for a newly-created object. This defines how objects in the
+     * bucket are stored and determines the SLA and the cost of storage.
+     * If this value is not specified when the bucket is created, it will default
+     * to `STANDARD`. For more information, see
+     * https://developers.google.com/storage/docs/storage-classes.
+     * 
+ * + * string storage_class = 7; + * + * @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; + } + + private java.util.List acl_ = + java.util.Collections.emptyList(); + + private void ensureAclIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + acl_ = new java.util.ArrayList(acl_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.storage.v2.BucketAccessControl, + com.google.storage.v2.BucketAccessControl.Builder, + com.google.storage.v2.BucketAccessControlOrBuilder> + aclBuilder_; + + /** + * + * + *
+     * Access controls on the bucket.
+     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+     * requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.BucketAccessControl acl = 8; + */ + public java.util.List getAclList() { + if (aclBuilder_ == null) { + return java.util.Collections.unmodifiableList(acl_); + } else { + return aclBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Access controls on the bucket.
+     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+     * requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.BucketAccessControl acl = 8; + */ + public int getAclCount() { + if (aclBuilder_ == null) { + return acl_.size(); + } else { + return aclBuilder_.getCount(); + } + } + /** + * + * + *
+     * Access controls on the bucket.
+     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+     * requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.BucketAccessControl acl = 8; + */ + public com.google.storage.v2.BucketAccessControl getAcl(int index) { + if (aclBuilder_ == null) { + return acl_.get(index); + } else { + return aclBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Access controls on the bucket.
+     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+     * requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.BucketAccessControl acl = 8; + */ + public Builder setAcl(int index, com.google.storage.v2.BucketAccessControl value) { + if (aclBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAclIsMutable(); + acl_.set(index, value); + onChanged(); + } else { + aclBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Access controls on the bucket.
+     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+     * requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.BucketAccessControl acl = 8; + */ + public Builder setAcl( + int index, com.google.storage.v2.BucketAccessControl.Builder builderForValue) { + if (aclBuilder_ == null) { + ensureAclIsMutable(); + acl_.set(index, builderForValue.build()); + onChanged(); + } else { + aclBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Access controls on the bucket.
+     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+     * requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.BucketAccessControl acl = 8; + */ + public Builder addAcl(com.google.storage.v2.BucketAccessControl value) { + if (aclBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAclIsMutable(); + acl_.add(value); + onChanged(); + } else { + aclBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Access controls on the bucket.
+     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+     * requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.BucketAccessControl acl = 8; + */ + public Builder addAcl(int index, com.google.storage.v2.BucketAccessControl value) { + if (aclBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAclIsMutable(); + acl_.add(index, value); + onChanged(); + } else { + aclBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Access controls on the bucket.
+     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+     * requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.BucketAccessControl acl = 8; + */ + public Builder addAcl(com.google.storage.v2.BucketAccessControl.Builder builderForValue) { + if (aclBuilder_ == null) { + ensureAclIsMutable(); + acl_.add(builderForValue.build()); + onChanged(); + } else { + aclBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Access controls on the bucket.
+     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+     * requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.BucketAccessControl acl = 8; + */ + public Builder addAcl( + int index, com.google.storage.v2.BucketAccessControl.Builder builderForValue) { + if (aclBuilder_ == null) { + ensureAclIsMutable(); + acl_.add(index, builderForValue.build()); + onChanged(); + } else { + aclBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Access controls on the bucket.
+     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+     * requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.BucketAccessControl acl = 8; + */ + public Builder addAllAcl( + java.lang.Iterable values) { + if (aclBuilder_ == null) { + ensureAclIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, acl_); + onChanged(); + } else { + aclBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Access controls on the bucket.
+     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+     * requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.BucketAccessControl acl = 8; + */ + public Builder clearAcl() { + if (aclBuilder_ == null) { + acl_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + aclBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Access controls on the bucket.
+     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+     * requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.BucketAccessControl acl = 8; + */ + public Builder removeAcl(int index) { + if (aclBuilder_ == null) { + ensureAclIsMutable(); + acl_.remove(index); + onChanged(); + } else { + aclBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Access controls on the bucket.
+     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+     * requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.BucketAccessControl acl = 8; + */ + public com.google.storage.v2.BucketAccessControl.Builder getAclBuilder(int index) { + return getAclFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Access controls on the bucket.
+     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+     * requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.BucketAccessControl acl = 8; + */ + public com.google.storage.v2.BucketAccessControlOrBuilder getAclOrBuilder(int index) { + if (aclBuilder_ == null) { + return acl_.get(index); + } else { + return aclBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Access controls on the bucket.
+     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+     * requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.BucketAccessControl acl = 8; + */ + public java.util.List + getAclOrBuilderList() { + if (aclBuilder_ != null) { + return aclBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(acl_); + } + } + /** + * + * + *
+     * Access controls on the bucket.
+     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+     * requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.BucketAccessControl acl = 8; + */ + public com.google.storage.v2.BucketAccessControl.Builder addAclBuilder() { + return getAclFieldBuilder() + .addBuilder(com.google.storage.v2.BucketAccessControl.getDefaultInstance()); + } + /** + * + * + *
+     * Access controls on the bucket.
+     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+     * requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.BucketAccessControl acl = 8; + */ + public com.google.storage.v2.BucketAccessControl.Builder addAclBuilder(int index) { + return getAclFieldBuilder() + .addBuilder(index, com.google.storage.v2.BucketAccessControl.getDefaultInstance()); + } + /** + * + * + *
+     * Access controls on the bucket.
+     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+     * requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.BucketAccessControl acl = 8; + */ + public java.util.List getAclBuilderList() { + return getAclFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.storage.v2.BucketAccessControl, + com.google.storage.v2.BucketAccessControl.Builder, + com.google.storage.v2.BucketAccessControlOrBuilder> + getAclFieldBuilder() { + if (aclBuilder_ == null) { + aclBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.storage.v2.BucketAccessControl, + com.google.storage.v2.BucketAccessControl.Builder, + com.google.storage.v2.BucketAccessControlOrBuilder>( + acl_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + acl_ = null; + } + return aclBuilder_; + } + + private java.util.List defaultObjectAcl_ = + java.util.Collections.emptyList(); + + private void ensureDefaultObjectAclIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + defaultObjectAcl_ = + new java.util.ArrayList(defaultObjectAcl_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.storage.v2.ObjectAccessControl, + com.google.storage.v2.ObjectAccessControl.Builder, + com.google.storage.v2.ObjectAccessControlOrBuilder> + defaultObjectAclBuilder_; + + /** + * + * + *
+     * Default access controls to apply to new objects when no ACL is provided.
+     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+     * requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; + */ + public java.util.List getDefaultObjectAclList() { + if (defaultObjectAclBuilder_ == null) { + return java.util.Collections.unmodifiableList(defaultObjectAcl_); + } else { + return defaultObjectAclBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Default access controls to apply to new objects when no ACL is provided.
+     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+     * requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; + */ + public int getDefaultObjectAclCount() { + if (defaultObjectAclBuilder_ == null) { + return defaultObjectAcl_.size(); + } else { + return defaultObjectAclBuilder_.getCount(); + } + } + /** + * + * + *
+     * Default access controls to apply to new objects when no ACL is provided.
+     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+     * requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; + */ + public com.google.storage.v2.ObjectAccessControl getDefaultObjectAcl(int index) { + if (defaultObjectAclBuilder_ == null) { + return defaultObjectAcl_.get(index); + } else { + return defaultObjectAclBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Default access controls to apply to new objects when no ACL is provided.
+     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+     * requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; + */ + public Builder setDefaultObjectAcl(int index, com.google.storage.v2.ObjectAccessControl value) { + if (defaultObjectAclBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDefaultObjectAclIsMutable(); + defaultObjectAcl_.set(index, value); + onChanged(); + } else { + defaultObjectAclBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Default access controls to apply to new objects when no ACL is provided.
+     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+     * requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; + */ + public Builder setDefaultObjectAcl( + int index, com.google.storage.v2.ObjectAccessControl.Builder builderForValue) { + if (defaultObjectAclBuilder_ == null) { + ensureDefaultObjectAclIsMutable(); + defaultObjectAcl_.set(index, builderForValue.build()); + onChanged(); + } else { + defaultObjectAclBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Default access controls to apply to new objects when no ACL is provided.
+     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+     * requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; + */ + public Builder addDefaultObjectAcl(com.google.storage.v2.ObjectAccessControl value) { + if (defaultObjectAclBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDefaultObjectAclIsMutable(); + defaultObjectAcl_.add(value); + onChanged(); + } else { + defaultObjectAclBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Default access controls to apply to new objects when no ACL is provided.
+     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+     * requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; + */ + public Builder addDefaultObjectAcl(int index, com.google.storage.v2.ObjectAccessControl value) { + if (defaultObjectAclBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDefaultObjectAclIsMutable(); + defaultObjectAcl_.add(index, value); + onChanged(); + } else { + defaultObjectAclBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Default access controls to apply to new objects when no ACL is provided.
+     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+     * requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; + */ + public Builder addDefaultObjectAcl( + com.google.storage.v2.ObjectAccessControl.Builder builderForValue) { + if (defaultObjectAclBuilder_ == null) { + ensureDefaultObjectAclIsMutable(); + defaultObjectAcl_.add(builderForValue.build()); + onChanged(); + } else { + defaultObjectAclBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Default access controls to apply to new objects when no ACL is provided.
+     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+     * requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; + */ + public Builder addDefaultObjectAcl( + int index, com.google.storage.v2.ObjectAccessControl.Builder builderForValue) { + if (defaultObjectAclBuilder_ == null) { + ensureDefaultObjectAclIsMutable(); + defaultObjectAcl_.add(index, builderForValue.build()); + onChanged(); + } else { + defaultObjectAclBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Default access controls to apply to new objects when no ACL is provided.
+     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+     * requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; + */ + public Builder addAllDefaultObjectAcl( + java.lang.Iterable values) { + if (defaultObjectAclBuilder_ == null) { + ensureDefaultObjectAclIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, defaultObjectAcl_); + onChanged(); + } else { + defaultObjectAclBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Default access controls to apply to new objects when no ACL is provided.
+     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+     * requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; + */ + public Builder clearDefaultObjectAcl() { + if (defaultObjectAclBuilder_ == null) { + defaultObjectAcl_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + defaultObjectAclBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Default access controls to apply to new objects when no ACL is provided.
+     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+     * requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; + */ + public Builder removeDefaultObjectAcl(int index) { + if (defaultObjectAclBuilder_ == null) { + ensureDefaultObjectAclIsMutable(); + defaultObjectAcl_.remove(index); + onChanged(); + } else { + defaultObjectAclBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Default access controls to apply to new objects when no ACL is provided.
+     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+     * requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; + */ + public com.google.storage.v2.ObjectAccessControl.Builder getDefaultObjectAclBuilder(int index) { + return getDefaultObjectAclFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Default access controls to apply to new objects when no ACL is provided.
+     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+     * requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; + */ + public com.google.storage.v2.ObjectAccessControlOrBuilder getDefaultObjectAclOrBuilder( + int index) { + if (defaultObjectAclBuilder_ == null) { + return defaultObjectAcl_.get(index); + } else { + return defaultObjectAclBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Default access controls to apply to new objects when no ACL is provided.
+     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+     * requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; + */ + public java.util.List + getDefaultObjectAclOrBuilderList() { + if (defaultObjectAclBuilder_ != null) { + return defaultObjectAclBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(defaultObjectAcl_); + } + } + /** + * + * + *
+     * Default access controls to apply to new objects when no ACL is provided.
+     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+     * requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; + */ + public com.google.storage.v2.ObjectAccessControl.Builder addDefaultObjectAclBuilder() { + return getDefaultObjectAclFieldBuilder() + .addBuilder(com.google.storage.v2.ObjectAccessControl.getDefaultInstance()); + } + /** + * + * + *
+     * Default access controls to apply to new objects when no ACL is provided.
+     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+     * requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; + */ + public com.google.storage.v2.ObjectAccessControl.Builder addDefaultObjectAclBuilder(int index) { + return getDefaultObjectAclFieldBuilder() + .addBuilder(index, com.google.storage.v2.ObjectAccessControl.getDefaultInstance()); + } + /** + * + * + *
+     * Default access controls to apply to new objects when no ACL is provided.
+     * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+     * requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; + */ + public java.util.List + getDefaultObjectAclBuilderList() { + return getDefaultObjectAclFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.storage.v2.ObjectAccessControl, + com.google.storage.v2.ObjectAccessControl.Builder, + com.google.storage.v2.ObjectAccessControlOrBuilder> + getDefaultObjectAclFieldBuilder() { + if (defaultObjectAclBuilder_ == null) { + defaultObjectAclBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.storage.v2.ObjectAccessControl, + com.google.storage.v2.ObjectAccessControl.Builder, + com.google.storage.v2.ObjectAccessControlOrBuilder>( + defaultObjectAcl_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + defaultObjectAcl_ = null; + } + return defaultObjectAclBuilder_; + } + + private com.google.storage.v2.Bucket.Lifecycle lifecycle_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Bucket.Lifecycle, + com.google.storage.v2.Bucket.Lifecycle.Builder, + com.google.storage.v2.Bucket.LifecycleOrBuilder> + lifecycleBuilder_; + /** + * + * + *
+     * The bucket's lifecycle config. See
+     * [https://developers.google.com/storage/docs/lifecycle]Lifecycle Management]
+     * for more information.
+     * 
+ * + * .google.storage.v2.Bucket.Lifecycle lifecycle = 10; + * + * @return Whether the lifecycle field is set. + */ + public boolean hasLifecycle() { + return lifecycleBuilder_ != null || lifecycle_ != null; + } + /** + * + * + *
+     * The bucket's lifecycle config. See
+     * [https://developers.google.com/storage/docs/lifecycle]Lifecycle Management]
+     * for more information.
+     * 
+ * + * .google.storage.v2.Bucket.Lifecycle lifecycle = 10; + * + * @return The lifecycle. + */ + public com.google.storage.v2.Bucket.Lifecycle getLifecycle() { + if (lifecycleBuilder_ == null) { + return lifecycle_ == null + ? com.google.storage.v2.Bucket.Lifecycle.getDefaultInstance() + : lifecycle_; + } else { + return lifecycleBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The bucket's lifecycle config. See
+     * [https://developers.google.com/storage/docs/lifecycle]Lifecycle Management]
+     * for more information.
+     * 
+ * + * .google.storage.v2.Bucket.Lifecycle lifecycle = 10; + */ + public Builder setLifecycle(com.google.storage.v2.Bucket.Lifecycle value) { + if (lifecycleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + lifecycle_ = value; + onChanged(); + } else { + lifecycleBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The bucket's lifecycle config. See
+     * [https://developers.google.com/storage/docs/lifecycle]Lifecycle Management]
+     * for more information.
+     * 
+ * + * .google.storage.v2.Bucket.Lifecycle lifecycle = 10; + */ + public Builder setLifecycle(com.google.storage.v2.Bucket.Lifecycle.Builder builderForValue) { + if (lifecycleBuilder_ == null) { + lifecycle_ = builderForValue.build(); + onChanged(); + } else { + lifecycleBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The bucket's lifecycle config. See
+     * [https://developers.google.com/storage/docs/lifecycle]Lifecycle Management]
+     * for more information.
+     * 
+ * + * .google.storage.v2.Bucket.Lifecycle lifecycle = 10; + */ + public Builder mergeLifecycle(com.google.storage.v2.Bucket.Lifecycle value) { + if (lifecycleBuilder_ == null) { + if (lifecycle_ != null) { + lifecycle_ = + com.google.storage.v2.Bucket.Lifecycle.newBuilder(lifecycle_) + .mergeFrom(value) + .buildPartial(); + } else { + lifecycle_ = value; + } + onChanged(); + } else { + lifecycleBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The bucket's lifecycle config. See
+     * [https://developers.google.com/storage/docs/lifecycle]Lifecycle Management]
+     * for more information.
+     * 
+ * + * .google.storage.v2.Bucket.Lifecycle lifecycle = 10; + */ + public Builder clearLifecycle() { + if (lifecycleBuilder_ == null) { + lifecycle_ = null; + onChanged(); + } else { + lifecycle_ = null; + lifecycleBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The bucket's lifecycle config. See
+     * [https://developers.google.com/storage/docs/lifecycle]Lifecycle Management]
+     * for more information.
+     * 
+ * + * .google.storage.v2.Bucket.Lifecycle lifecycle = 10; + */ + public com.google.storage.v2.Bucket.Lifecycle.Builder getLifecycleBuilder() { + + onChanged(); + return getLifecycleFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The bucket's lifecycle config. See
+     * [https://developers.google.com/storage/docs/lifecycle]Lifecycle Management]
+     * for more information.
+     * 
+ * + * .google.storage.v2.Bucket.Lifecycle lifecycle = 10; + */ + public com.google.storage.v2.Bucket.LifecycleOrBuilder getLifecycleOrBuilder() { + if (lifecycleBuilder_ != null) { + return lifecycleBuilder_.getMessageOrBuilder(); + } else { + return lifecycle_ == null + ? com.google.storage.v2.Bucket.Lifecycle.getDefaultInstance() + : lifecycle_; + } + } + /** + * + * + *
+     * The bucket's lifecycle config. See
+     * [https://developers.google.com/storage/docs/lifecycle]Lifecycle Management]
+     * for more information.
+     * 
+ * + * .google.storage.v2.Bucket.Lifecycle lifecycle = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Bucket.Lifecycle, + com.google.storage.v2.Bucket.Lifecycle.Builder, + com.google.storage.v2.Bucket.LifecycleOrBuilder> + getLifecycleFieldBuilder() { + if (lifecycleBuilder_ == null) { + lifecycleBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Bucket.Lifecycle, + com.google.storage.v2.Bucket.Lifecycle.Builder, + com.google.storage.v2.Bucket.LifecycleOrBuilder>( + getLifecycle(), getParentForChildren(), isClean()); + lifecycle_ = null; + } + return lifecycleBuilder_; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. The creation time of the bucket in
+     * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. The creation time of the bucket in
+     * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The creation time of the bucket in
+     * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The creation time of the bucket in
+     * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The creation time of the bucket in
+     * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The creation time of the bucket in
+     * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The creation time of the bucket in
+     * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The creation time of the bucket in
+     * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. The creation time of the bucket in
+     * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private java.util.List cors_ = + java.util.Collections.emptyList(); + + private void ensureCorsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + cors_ = new java.util.ArrayList(cors_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.storage.v2.Bucket.Cors, + com.google.storage.v2.Bucket.Cors.Builder, + com.google.storage.v2.Bucket.CorsOrBuilder> + corsBuilder_; + + /** + * + * + *
+     * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
+     * (CORS) config.
+     * 
+ * + * repeated .google.storage.v2.Bucket.Cors cors = 12; + */ + public java.util.List getCorsList() { + if (corsBuilder_ == null) { + return java.util.Collections.unmodifiableList(cors_); + } else { + return corsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
+     * (CORS) config.
+     * 
+ * + * repeated .google.storage.v2.Bucket.Cors cors = 12; + */ + public int getCorsCount() { + if (corsBuilder_ == null) { + return cors_.size(); + } else { + return corsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
+     * (CORS) config.
+     * 
+ * + * repeated .google.storage.v2.Bucket.Cors cors = 12; + */ + public com.google.storage.v2.Bucket.Cors getCors(int index) { + if (corsBuilder_ == null) { + return cors_.get(index); + } else { + return corsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
+     * (CORS) config.
+     * 
+ * + * repeated .google.storage.v2.Bucket.Cors cors = 12; + */ + public Builder setCors(int index, com.google.storage.v2.Bucket.Cors value) { + if (corsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCorsIsMutable(); + cors_.set(index, value); + onChanged(); + } else { + corsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
+     * (CORS) config.
+     * 
+ * + * repeated .google.storage.v2.Bucket.Cors cors = 12; + */ + public Builder setCors(int index, com.google.storage.v2.Bucket.Cors.Builder builderForValue) { + if (corsBuilder_ == null) { + ensureCorsIsMutable(); + cors_.set(index, builderForValue.build()); + onChanged(); + } else { + corsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
+     * (CORS) config.
+     * 
+ * + * repeated .google.storage.v2.Bucket.Cors cors = 12; + */ + public Builder addCors(com.google.storage.v2.Bucket.Cors value) { + if (corsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCorsIsMutable(); + cors_.add(value); + onChanged(); + } else { + corsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
+     * (CORS) config.
+     * 
+ * + * repeated .google.storage.v2.Bucket.Cors cors = 12; + */ + public Builder addCors(int index, com.google.storage.v2.Bucket.Cors value) { + if (corsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCorsIsMutable(); + cors_.add(index, value); + onChanged(); + } else { + corsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
+     * (CORS) config.
+     * 
+ * + * repeated .google.storage.v2.Bucket.Cors cors = 12; + */ + public Builder addCors(com.google.storage.v2.Bucket.Cors.Builder builderForValue) { + if (corsBuilder_ == null) { + ensureCorsIsMutable(); + cors_.add(builderForValue.build()); + onChanged(); + } else { + corsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
+     * (CORS) config.
+     * 
+ * + * repeated .google.storage.v2.Bucket.Cors cors = 12; + */ + public Builder addCors(int index, com.google.storage.v2.Bucket.Cors.Builder builderForValue) { + if (corsBuilder_ == null) { + ensureCorsIsMutable(); + cors_.add(index, builderForValue.build()); + onChanged(); + } else { + corsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
+     * (CORS) config.
+     * 
+ * + * repeated .google.storage.v2.Bucket.Cors cors = 12; + */ + public Builder addAllCors( + java.lang.Iterable values) { + if (corsBuilder_ == null) { + ensureCorsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, cors_); + onChanged(); + } else { + corsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
+     * (CORS) config.
+     * 
+ * + * repeated .google.storage.v2.Bucket.Cors cors = 12; + */ + public Builder clearCors() { + if (corsBuilder_ == null) { + cors_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + corsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
+     * (CORS) config.
+     * 
+ * + * repeated .google.storage.v2.Bucket.Cors cors = 12; + */ + public Builder removeCors(int index) { + if (corsBuilder_ == null) { + ensureCorsIsMutable(); + cors_.remove(index); + onChanged(); + } else { + corsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
+     * (CORS) config.
+     * 
+ * + * repeated .google.storage.v2.Bucket.Cors cors = 12; + */ + public com.google.storage.v2.Bucket.Cors.Builder getCorsBuilder(int index) { + return getCorsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
+     * (CORS) config.
+     * 
+ * + * repeated .google.storage.v2.Bucket.Cors cors = 12; + */ + public com.google.storage.v2.Bucket.CorsOrBuilder getCorsOrBuilder(int index) { + if (corsBuilder_ == null) { + return cors_.get(index); + } else { + return corsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
+     * (CORS) config.
+     * 
+ * + * repeated .google.storage.v2.Bucket.Cors cors = 12; + */ + public java.util.List + getCorsOrBuilderList() { + if (corsBuilder_ != null) { + return corsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(cors_); + } + } + /** + * + * + *
+     * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
+     * (CORS) config.
+     * 
+ * + * repeated .google.storage.v2.Bucket.Cors cors = 12; + */ + public com.google.storage.v2.Bucket.Cors.Builder addCorsBuilder() { + return getCorsFieldBuilder() + .addBuilder(com.google.storage.v2.Bucket.Cors.getDefaultInstance()); + } + /** + * + * + *
+     * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
+     * (CORS) config.
+     * 
+ * + * repeated .google.storage.v2.Bucket.Cors cors = 12; + */ + public com.google.storage.v2.Bucket.Cors.Builder addCorsBuilder(int index) { + return getCorsFieldBuilder() + .addBuilder(index, com.google.storage.v2.Bucket.Cors.getDefaultInstance()); + } + /** + * + * + *
+     * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
+     * (CORS) config.
+     * 
+ * + * repeated .google.storage.v2.Bucket.Cors cors = 12; + */ + public java.util.List getCorsBuilderList() { + return getCorsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.storage.v2.Bucket.Cors, + com.google.storage.v2.Bucket.Cors.Builder, + com.google.storage.v2.Bucket.CorsOrBuilder> + getCorsFieldBuilder() { + if (corsBuilder_ == null) { + corsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.storage.v2.Bucket.Cors, + com.google.storage.v2.Bucket.Cors.Builder, + com.google.storage.v2.Bucket.CorsOrBuilder>( + cors_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + cors_ = null; + } + return corsBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. The modification time of the bucket.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. The modification time of the bucket.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The modification time of the bucket.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The modification time of the bucket.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The modification time of the bucket.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The modification time of the bucket.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The modification time of the bucket.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The modification time of the bucket.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. The modification time of the bucket.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private boolean defaultEventBasedHold_; + /** + * + * + *
+     * The default value for event-based hold on newly created objects in this
+     * bucket.  Event-based hold is a way to retain objects indefinitely until an
+     * event occurs, signified by the
+     * hold's release. After being released, such objects will be subject to
+     * bucket-level retention (if any).  One sample use case of this flag is for
+     * banks to hold loan documents for at least 3 years after loan is paid in
+     * full. Here, bucket-level retention is 3 years and the event is loan being
+     * paid in full. In this example, these objects will be held intact for any
+     * number of years until the event has occurred (event-based hold on the
+     * object is released) and then 3 more years after that. That means retention
+     * duration of the objects begins from the moment event-based hold
+     * transitioned from true to false.  Objects under event-based hold cannot be
+     * deleted, overwritten or archived until the hold is removed.
+     * 
+ * + * bool default_event_based_hold = 14; + * + * @return The defaultEventBasedHold. + */ + @java.lang.Override + public boolean getDefaultEventBasedHold() { + return defaultEventBasedHold_; + } + /** + * + * + *
+     * The default value for event-based hold on newly created objects in this
+     * bucket.  Event-based hold is a way to retain objects indefinitely until an
+     * event occurs, signified by the
+     * hold's release. After being released, such objects will be subject to
+     * bucket-level retention (if any).  One sample use case of this flag is for
+     * banks to hold loan documents for at least 3 years after loan is paid in
+     * full. Here, bucket-level retention is 3 years and the event is loan being
+     * paid in full. In this example, these objects will be held intact for any
+     * number of years until the event has occurred (event-based hold on the
+     * object is released) and then 3 more years after that. That means retention
+     * duration of the objects begins from the moment event-based hold
+     * transitioned from true to false.  Objects under event-based hold cannot be
+     * deleted, overwritten or archived until the hold is removed.
+     * 
+ * + * bool default_event_based_hold = 14; + * + * @param value The defaultEventBasedHold to set. + * @return This builder for chaining. + */ + public Builder setDefaultEventBasedHold(boolean value) { + + defaultEventBasedHold_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The default value for event-based hold on newly created objects in this
+     * bucket.  Event-based hold is a way to retain objects indefinitely until an
+     * event occurs, signified by the
+     * hold's release. After being released, such objects will be subject to
+     * bucket-level retention (if any).  One sample use case of this flag is for
+     * banks to hold loan documents for at least 3 years after loan is paid in
+     * full. Here, bucket-level retention is 3 years and the event is loan being
+     * paid in full. In this example, these objects will be held intact for any
+     * number of years until the event has occurred (event-based hold on the
+     * object is released) and then 3 more years after that. That means retention
+     * duration of the objects begins from the moment event-based hold
+     * transitioned from true to false.  Objects under event-based hold cannot be
+     * deleted, overwritten or archived until the hold is removed.
+     * 
+ * + * bool default_event_based_hold = 14; + * + * @return This builder for chaining. + */ + public Builder clearDefaultEventBasedHold() { + + defaultEventBasedHold_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged(); + ; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * User-provided labels, in key/value pairs.
+     * 
+ * + * map<string, string> labels = 15; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * User-provided labels, in key/value pairs.
+     * 
+ * + * map<string, string> labels = 15; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * User-provided labels, in key/value pairs.
+     * 
+ * + * map<string, string> labels = 15; + */ + @java.lang.Override + public java.lang.String getLabelsOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * User-provided labels, in key/value pairs.
+     * 
+ * + * map<string, string> labels = 15; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * User-provided labels, in key/value pairs.
+     * 
+ * + * map<string, string> labels = 15; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * User-provided labels, in key/value pairs.
+     * 
+ * + * map<string, string> labels = 15; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableLabels().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * User-provided labels, in key/value pairs.
+     * 
+ * + * map<string, string> labels = 15; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + return this; + } + + private com.google.storage.v2.Bucket.Website website_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Bucket.Website, + com.google.storage.v2.Bucket.Website.Builder, + com.google.storage.v2.Bucket.WebsiteOrBuilder> + websiteBuilder_; + /** + * + * + *
+     * The bucket's website config, controlling how the service behaves
+     * when accessing bucket contents as a web site. See the
+     * [https://cloud.google.com/storage/docs/static-website][Static Website
+     * Examples] for more information.
+     * 
+ * + * .google.storage.v2.Bucket.Website website = 16; + * + * @return Whether the website field is set. + */ + public boolean hasWebsite() { + return websiteBuilder_ != null || website_ != null; + } + /** + * + * + *
+     * The bucket's website config, controlling how the service behaves
+     * when accessing bucket contents as a web site. See the
+     * [https://cloud.google.com/storage/docs/static-website][Static Website
+     * Examples] for more information.
+     * 
+ * + * .google.storage.v2.Bucket.Website website = 16; + * + * @return The website. + */ + public com.google.storage.v2.Bucket.Website getWebsite() { + if (websiteBuilder_ == null) { + return website_ == null + ? com.google.storage.v2.Bucket.Website.getDefaultInstance() + : website_; + } else { + return websiteBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The bucket's website config, controlling how the service behaves
+     * when accessing bucket contents as a web site. See the
+     * [https://cloud.google.com/storage/docs/static-website][Static Website
+     * Examples] for more information.
+     * 
+ * + * .google.storage.v2.Bucket.Website website = 16; + */ + public Builder setWebsite(com.google.storage.v2.Bucket.Website value) { + if (websiteBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + website_ = value; + onChanged(); + } else { + websiteBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The bucket's website config, controlling how the service behaves
+     * when accessing bucket contents as a web site. See the
+     * [https://cloud.google.com/storage/docs/static-website][Static Website
+     * Examples] for more information.
+     * 
+ * + * .google.storage.v2.Bucket.Website website = 16; + */ + public Builder setWebsite(com.google.storage.v2.Bucket.Website.Builder builderForValue) { + if (websiteBuilder_ == null) { + website_ = builderForValue.build(); + onChanged(); + } else { + websiteBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The bucket's website config, controlling how the service behaves
+     * when accessing bucket contents as a web site. See the
+     * [https://cloud.google.com/storage/docs/static-website][Static Website
+     * Examples] for more information.
+     * 
+ * + * .google.storage.v2.Bucket.Website website = 16; + */ + public Builder mergeWebsite(com.google.storage.v2.Bucket.Website value) { + if (websiteBuilder_ == null) { + if (website_ != null) { + website_ = + com.google.storage.v2.Bucket.Website.newBuilder(website_) + .mergeFrom(value) + .buildPartial(); + } else { + website_ = value; + } + onChanged(); + } else { + websiteBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The bucket's website config, controlling how the service behaves
+     * when accessing bucket contents as a web site. See the
+     * [https://cloud.google.com/storage/docs/static-website][Static Website
+     * Examples] for more information.
+     * 
+ * + * .google.storage.v2.Bucket.Website website = 16; + */ + public Builder clearWebsite() { + if (websiteBuilder_ == null) { + website_ = null; + onChanged(); + } else { + website_ = null; + websiteBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The bucket's website config, controlling how the service behaves
+     * when accessing bucket contents as a web site. See the
+     * [https://cloud.google.com/storage/docs/static-website][Static Website
+     * Examples] for more information.
+     * 
+ * + * .google.storage.v2.Bucket.Website website = 16; + */ + public com.google.storage.v2.Bucket.Website.Builder getWebsiteBuilder() { + + onChanged(); + return getWebsiteFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The bucket's website config, controlling how the service behaves
+     * when accessing bucket contents as a web site. See the
+     * [https://cloud.google.com/storage/docs/static-website][Static Website
+     * Examples] for more information.
+     * 
+ * + * .google.storage.v2.Bucket.Website website = 16; + */ + public com.google.storage.v2.Bucket.WebsiteOrBuilder getWebsiteOrBuilder() { + if (websiteBuilder_ != null) { + return websiteBuilder_.getMessageOrBuilder(); + } else { + return website_ == null + ? com.google.storage.v2.Bucket.Website.getDefaultInstance() + : website_; + } + } + /** + * + * + *
+     * The bucket's website config, controlling how the service behaves
+     * when accessing bucket contents as a web site. See the
+     * [https://cloud.google.com/storage/docs/static-website][Static Website
+     * Examples] for more information.
+     * 
+ * + * .google.storage.v2.Bucket.Website website = 16; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Bucket.Website, + com.google.storage.v2.Bucket.Website.Builder, + com.google.storage.v2.Bucket.WebsiteOrBuilder> + getWebsiteFieldBuilder() { + if (websiteBuilder_ == null) { + websiteBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Bucket.Website, + com.google.storage.v2.Bucket.Website.Builder, + com.google.storage.v2.Bucket.WebsiteOrBuilder>( + getWebsite(), getParentForChildren(), isClean()); + website_ = null; + } + return websiteBuilder_; + } + + private com.google.storage.v2.Bucket.Versioning versioning_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Bucket.Versioning, + com.google.storage.v2.Bucket.Versioning.Builder, + com.google.storage.v2.Bucket.VersioningOrBuilder> + versioningBuilder_; + /** + * + * + *
+     * The bucket's versioning config.
+     * 
+ * + * .google.storage.v2.Bucket.Versioning versioning = 17; + * + * @return Whether the versioning field is set. + */ + public boolean hasVersioning() { + return versioningBuilder_ != null || versioning_ != null; + } + /** + * + * + *
+     * The bucket's versioning config.
+     * 
+ * + * .google.storage.v2.Bucket.Versioning versioning = 17; + * + * @return The versioning. + */ + public com.google.storage.v2.Bucket.Versioning getVersioning() { + if (versioningBuilder_ == null) { + return versioning_ == null + ? com.google.storage.v2.Bucket.Versioning.getDefaultInstance() + : versioning_; + } else { + return versioningBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The bucket's versioning config.
+     * 
+ * + * .google.storage.v2.Bucket.Versioning versioning = 17; + */ + public Builder setVersioning(com.google.storage.v2.Bucket.Versioning value) { + if (versioningBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + versioning_ = value; + onChanged(); + } else { + versioningBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The bucket's versioning config.
+     * 
+ * + * .google.storage.v2.Bucket.Versioning versioning = 17; + */ + public Builder setVersioning(com.google.storage.v2.Bucket.Versioning.Builder builderForValue) { + if (versioningBuilder_ == null) { + versioning_ = builderForValue.build(); + onChanged(); + } else { + versioningBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The bucket's versioning config.
+     * 
+ * + * .google.storage.v2.Bucket.Versioning versioning = 17; + */ + public Builder mergeVersioning(com.google.storage.v2.Bucket.Versioning value) { + if (versioningBuilder_ == null) { + if (versioning_ != null) { + versioning_ = + com.google.storage.v2.Bucket.Versioning.newBuilder(versioning_) + .mergeFrom(value) + .buildPartial(); + } else { + versioning_ = value; + } + onChanged(); + } else { + versioningBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The bucket's versioning config.
+     * 
+ * + * .google.storage.v2.Bucket.Versioning versioning = 17; + */ + public Builder clearVersioning() { + if (versioningBuilder_ == null) { + versioning_ = null; + onChanged(); + } else { + versioning_ = null; + versioningBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The bucket's versioning config.
+     * 
+ * + * .google.storage.v2.Bucket.Versioning versioning = 17; + */ + public com.google.storage.v2.Bucket.Versioning.Builder getVersioningBuilder() { + + onChanged(); + return getVersioningFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The bucket's versioning config.
+     * 
+ * + * .google.storage.v2.Bucket.Versioning versioning = 17; + */ + public com.google.storage.v2.Bucket.VersioningOrBuilder getVersioningOrBuilder() { + if (versioningBuilder_ != null) { + return versioningBuilder_.getMessageOrBuilder(); + } else { + return versioning_ == null + ? com.google.storage.v2.Bucket.Versioning.getDefaultInstance() + : versioning_; + } + } + /** + * + * + *
+     * The bucket's versioning config.
+     * 
+ * + * .google.storage.v2.Bucket.Versioning versioning = 17; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Bucket.Versioning, + com.google.storage.v2.Bucket.Versioning.Builder, + com.google.storage.v2.Bucket.VersioningOrBuilder> + getVersioningFieldBuilder() { + if (versioningBuilder_ == null) { + versioningBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Bucket.Versioning, + com.google.storage.v2.Bucket.Versioning.Builder, + com.google.storage.v2.Bucket.VersioningOrBuilder>( + getVersioning(), getParentForChildren(), isClean()); + versioning_ = null; + } + return versioningBuilder_; + } + + private com.google.storage.v2.Bucket.Logging logging_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Bucket.Logging, + com.google.storage.v2.Bucket.Logging.Builder, + com.google.storage.v2.Bucket.LoggingOrBuilder> + loggingBuilder_; + /** + * + * + *
+     * The bucket's logging config, which defines the destination bucket
+     * and name prefix (if any) for the current bucket's logs.
+     * 
+ * + * .google.storage.v2.Bucket.Logging logging = 18; + * + * @return Whether the logging field is set. + */ + public boolean hasLogging() { + return loggingBuilder_ != null || logging_ != null; + } + /** + * + * + *
+     * The bucket's logging config, which defines the destination bucket
+     * and name prefix (if any) for the current bucket's logs.
+     * 
+ * + * .google.storage.v2.Bucket.Logging logging = 18; + * + * @return The logging. + */ + public com.google.storage.v2.Bucket.Logging getLogging() { + if (loggingBuilder_ == null) { + return logging_ == null + ? com.google.storage.v2.Bucket.Logging.getDefaultInstance() + : logging_; + } else { + return loggingBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The bucket's logging config, which defines the destination bucket
+     * and name prefix (if any) for the current bucket's logs.
+     * 
+ * + * .google.storage.v2.Bucket.Logging logging = 18; + */ + public Builder setLogging(com.google.storage.v2.Bucket.Logging value) { + if (loggingBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + logging_ = value; + onChanged(); + } else { + loggingBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The bucket's logging config, which defines the destination bucket
+     * and name prefix (if any) for the current bucket's logs.
+     * 
+ * + * .google.storage.v2.Bucket.Logging logging = 18; + */ + public Builder setLogging(com.google.storage.v2.Bucket.Logging.Builder builderForValue) { + if (loggingBuilder_ == null) { + logging_ = builderForValue.build(); + onChanged(); + } else { + loggingBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The bucket's logging config, which defines the destination bucket
+     * and name prefix (if any) for the current bucket's logs.
+     * 
+ * + * .google.storage.v2.Bucket.Logging logging = 18; + */ + public Builder mergeLogging(com.google.storage.v2.Bucket.Logging value) { + if (loggingBuilder_ == null) { + if (logging_ != null) { + logging_ = + com.google.storage.v2.Bucket.Logging.newBuilder(logging_) + .mergeFrom(value) + .buildPartial(); + } else { + logging_ = value; + } + onChanged(); + } else { + loggingBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The bucket's logging config, which defines the destination bucket
+     * and name prefix (if any) for the current bucket's logs.
+     * 
+ * + * .google.storage.v2.Bucket.Logging logging = 18; + */ + public Builder clearLogging() { + if (loggingBuilder_ == null) { + logging_ = null; + onChanged(); + } else { + logging_ = null; + loggingBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The bucket's logging config, which defines the destination bucket
+     * and name prefix (if any) for the current bucket's logs.
+     * 
+ * + * .google.storage.v2.Bucket.Logging logging = 18; + */ + public com.google.storage.v2.Bucket.Logging.Builder getLoggingBuilder() { + + onChanged(); + return getLoggingFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The bucket's logging config, which defines the destination bucket
+     * and name prefix (if any) for the current bucket's logs.
+     * 
+ * + * .google.storage.v2.Bucket.Logging logging = 18; + */ + public com.google.storage.v2.Bucket.LoggingOrBuilder getLoggingOrBuilder() { + if (loggingBuilder_ != null) { + return loggingBuilder_.getMessageOrBuilder(); + } else { + return logging_ == null + ? com.google.storage.v2.Bucket.Logging.getDefaultInstance() + : logging_; + } + } + /** + * + * + *
+     * The bucket's logging config, which defines the destination bucket
+     * and name prefix (if any) for the current bucket's logs.
+     * 
+ * + * .google.storage.v2.Bucket.Logging logging = 18; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Bucket.Logging, + com.google.storage.v2.Bucket.Logging.Builder, + com.google.storage.v2.Bucket.LoggingOrBuilder> + getLoggingFieldBuilder() { + if (loggingBuilder_ == null) { + loggingBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Bucket.Logging, + com.google.storage.v2.Bucket.Logging.Builder, + com.google.storage.v2.Bucket.LoggingOrBuilder>( + getLogging(), getParentForChildren(), isClean()); + logging_ = null; + } + return loggingBuilder_; + } + + private com.google.storage.v2.Owner owner_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Owner, + com.google.storage.v2.Owner.Builder, + com.google.storage.v2.OwnerOrBuilder> + ownerBuilder_; + /** + * + * + *
+     * Output only. The owner of the bucket. This is always the project team's owner group.
+     * 
+ * + * .google.storage.v2.Owner owner = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the owner field is set. + */ + public boolean hasOwner() { + return ownerBuilder_ != null || owner_ != null; + } + /** + * + * + *
+     * Output only. The owner of the bucket. This is always the project team's owner group.
+     * 
+ * + * .google.storage.v2.Owner owner = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The owner. + */ + public com.google.storage.v2.Owner getOwner() { + if (ownerBuilder_ == null) { + return owner_ == null ? com.google.storage.v2.Owner.getDefaultInstance() : owner_; + } else { + return ownerBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The owner of the bucket. This is always the project team's owner group.
+     * 
+ * + * .google.storage.v2.Owner owner = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setOwner(com.google.storage.v2.Owner value) { + if (ownerBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + owner_ = value; + onChanged(); + } else { + ownerBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The owner of the bucket. This is always the project team's owner group.
+     * 
+ * + * .google.storage.v2.Owner owner = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setOwner(com.google.storage.v2.Owner.Builder builderForValue) { + if (ownerBuilder_ == null) { + owner_ = builderForValue.build(); + onChanged(); + } else { + ownerBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The owner of the bucket. This is always the project team's owner group.
+     * 
+ * + * .google.storage.v2.Owner owner = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeOwner(com.google.storage.v2.Owner value) { + if (ownerBuilder_ == null) { + if (owner_ != null) { + owner_ = com.google.storage.v2.Owner.newBuilder(owner_).mergeFrom(value).buildPartial(); + } else { + owner_ = value; + } + onChanged(); + } else { + ownerBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The owner of the bucket. This is always the project team's owner group.
+     * 
+ * + * .google.storage.v2.Owner owner = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearOwner() { + if (ownerBuilder_ == null) { + owner_ = null; + onChanged(); + } else { + owner_ = null; + ownerBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The owner of the bucket. This is always the project team's owner group.
+     * 
+ * + * .google.storage.v2.Owner owner = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.storage.v2.Owner.Builder getOwnerBuilder() { + + onChanged(); + return getOwnerFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The owner of the bucket. This is always the project team's owner group.
+     * 
+ * + * .google.storage.v2.Owner owner = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.storage.v2.OwnerOrBuilder getOwnerOrBuilder() { + if (ownerBuilder_ != null) { + return ownerBuilder_.getMessageOrBuilder(); + } else { + return owner_ == null ? com.google.storage.v2.Owner.getDefaultInstance() : owner_; + } + } + /** + * + * + *
+     * Output only. The owner of the bucket. This is always the project team's owner group.
+     * 
+ * + * .google.storage.v2.Owner owner = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Owner, + com.google.storage.v2.Owner.Builder, + com.google.storage.v2.OwnerOrBuilder> + getOwnerFieldBuilder() { + if (ownerBuilder_ == null) { + ownerBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Owner, + com.google.storage.v2.Owner.Builder, + com.google.storage.v2.OwnerOrBuilder>( + getOwner(), getParentForChildren(), isClean()); + owner_ = null; + } + return ownerBuilder_; + } + + private com.google.storage.v2.Bucket.Encryption encryption_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Bucket.Encryption, + com.google.storage.v2.Bucket.Encryption.Builder, + com.google.storage.v2.Bucket.EncryptionOrBuilder> + encryptionBuilder_; + /** + * + * + *
+     * Encryption config for a bucket.
+     * 
+ * + * .google.storage.v2.Bucket.Encryption encryption = 20; + * + * @return Whether the encryption field is set. + */ + public boolean hasEncryption() { + return encryptionBuilder_ != null || encryption_ != null; + } + /** + * + * + *
+     * Encryption config for a bucket.
+     * 
+ * + * .google.storage.v2.Bucket.Encryption encryption = 20; + * + * @return The encryption. + */ + public com.google.storage.v2.Bucket.Encryption getEncryption() { + if (encryptionBuilder_ == null) { + return encryption_ == null + ? com.google.storage.v2.Bucket.Encryption.getDefaultInstance() + : encryption_; + } else { + return encryptionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Encryption config for a bucket.
+     * 
+ * + * .google.storage.v2.Bucket.Encryption encryption = 20; + */ + public Builder setEncryption(com.google.storage.v2.Bucket.Encryption value) { + if (encryptionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encryption_ = value; + onChanged(); + } else { + encryptionBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Encryption config for a bucket.
+     * 
+ * + * .google.storage.v2.Bucket.Encryption encryption = 20; + */ + public Builder setEncryption(com.google.storage.v2.Bucket.Encryption.Builder builderForValue) { + if (encryptionBuilder_ == null) { + encryption_ = builderForValue.build(); + onChanged(); + } else { + encryptionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Encryption config for a bucket.
+     * 
+ * + * .google.storage.v2.Bucket.Encryption encryption = 20; + */ + public Builder mergeEncryption(com.google.storage.v2.Bucket.Encryption value) { + if (encryptionBuilder_ == null) { + if (encryption_ != null) { + encryption_ = + com.google.storage.v2.Bucket.Encryption.newBuilder(encryption_) + .mergeFrom(value) + .buildPartial(); + } else { + encryption_ = value; + } + onChanged(); + } else { + encryptionBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Encryption config for a bucket.
+     * 
+ * + * .google.storage.v2.Bucket.Encryption encryption = 20; + */ + public Builder clearEncryption() { + if (encryptionBuilder_ == null) { + encryption_ = null; + onChanged(); + } else { + encryption_ = null; + encryptionBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Encryption config for a bucket.
+     * 
+ * + * .google.storage.v2.Bucket.Encryption encryption = 20; + */ + public com.google.storage.v2.Bucket.Encryption.Builder getEncryptionBuilder() { + + onChanged(); + return getEncryptionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Encryption config for a bucket.
+     * 
+ * + * .google.storage.v2.Bucket.Encryption encryption = 20; + */ + public com.google.storage.v2.Bucket.EncryptionOrBuilder getEncryptionOrBuilder() { + if (encryptionBuilder_ != null) { + return encryptionBuilder_.getMessageOrBuilder(); + } else { + return encryption_ == null + ? com.google.storage.v2.Bucket.Encryption.getDefaultInstance() + : encryption_; + } + } + /** + * + * + *
+     * Encryption config for a bucket.
+     * 
+ * + * .google.storage.v2.Bucket.Encryption encryption = 20; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Bucket.Encryption, + com.google.storage.v2.Bucket.Encryption.Builder, + com.google.storage.v2.Bucket.EncryptionOrBuilder> + getEncryptionFieldBuilder() { + if (encryptionBuilder_ == null) { + encryptionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Bucket.Encryption, + com.google.storage.v2.Bucket.Encryption.Builder, + com.google.storage.v2.Bucket.EncryptionOrBuilder>( + getEncryption(), getParentForChildren(), isClean()); + encryption_ = null; + } + return encryptionBuilder_; + } + + private com.google.storage.v2.Bucket.Billing billing_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Bucket.Billing, + com.google.storage.v2.Bucket.Billing.Builder, + com.google.storage.v2.Bucket.BillingOrBuilder> + billingBuilder_; + /** + * + * + *
+     * The bucket's billing config.
+     * 
+ * + * .google.storage.v2.Bucket.Billing billing = 21; + * + * @return Whether the billing field is set. + */ + public boolean hasBilling() { + return billingBuilder_ != null || billing_ != null; + } + /** + * + * + *
+     * The bucket's billing config.
+     * 
+ * + * .google.storage.v2.Bucket.Billing billing = 21; + * + * @return The billing. + */ + public com.google.storage.v2.Bucket.Billing getBilling() { + if (billingBuilder_ == null) { + return billing_ == null + ? com.google.storage.v2.Bucket.Billing.getDefaultInstance() + : billing_; + } else { + return billingBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The bucket's billing config.
+     * 
+ * + * .google.storage.v2.Bucket.Billing billing = 21; + */ + public Builder setBilling(com.google.storage.v2.Bucket.Billing value) { + if (billingBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + billing_ = value; + onChanged(); + } else { + billingBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The bucket's billing config.
+     * 
+ * + * .google.storage.v2.Bucket.Billing billing = 21; + */ + public Builder setBilling(com.google.storage.v2.Bucket.Billing.Builder builderForValue) { + if (billingBuilder_ == null) { + billing_ = builderForValue.build(); + onChanged(); + } else { + billingBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The bucket's billing config.
+     * 
+ * + * .google.storage.v2.Bucket.Billing billing = 21; + */ + public Builder mergeBilling(com.google.storage.v2.Bucket.Billing value) { + if (billingBuilder_ == null) { + if (billing_ != null) { + billing_ = + com.google.storage.v2.Bucket.Billing.newBuilder(billing_) + .mergeFrom(value) + .buildPartial(); + } else { + billing_ = value; + } + onChanged(); + } else { + billingBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The bucket's billing config.
+     * 
+ * + * .google.storage.v2.Bucket.Billing billing = 21; + */ + public Builder clearBilling() { + if (billingBuilder_ == null) { + billing_ = null; + onChanged(); + } else { + billing_ = null; + billingBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The bucket's billing config.
+     * 
+ * + * .google.storage.v2.Bucket.Billing billing = 21; + */ + public com.google.storage.v2.Bucket.Billing.Builder getBillingBuilder() { + + onChanged(); + return getBillingFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The bucket's billing config.
+     * 
+ * + * .google.storage.v2.Bucket.Billing billing = 21; + */ + public com.google.storage.v2.Bucket.BillingOrBuilder getBillingOrBuilder() { + if (billingBuilder_ != null) { + return billingBuilder_.getMessageOrBuilder(); + } else { + return billing_ == null + ? com.google.storage.v2.Bucket.Billing.getDefaultInstance() + : billing_; + } + } + /** + * + * + *
+     * The bucket's billing config.
+     * 
+ * + * .google.storage.v2.Bucket.Billing billing = 21; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Bucket.Billing, + com.google.storage.v2.Bucket.Billing.Builder, + com.google.storage.v2.Bucket.BillingOrBuilder> + getBillingFieldBuilder() { + if (billingBuilder_ == null) { + billingBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Bucket.Billing, + com.google.storage.v2.Bucket.Billing.Builder, + com.google.storage.v2.Bucket.BillingOrBuilder>( + getBilling(), getParentForChildren(), isClean()); + billing_ = null; + } + return billingBuilder_; + } + + private com.google.storage.v2.Bucket.RetentionPolicy retentionPolicy_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Bucket.RetentionPolicy, + com.google.storage.v2.Bucket.RetentionPolicy.Builder, + com.google.storage.v2.Bucket.RetentionPolicyOrBuilder> + retentionPolicyBuilder_; + /** + * + * + *
+     * The bucket's retention policy. The retention policy enforces a minimum
+     * retention time for all objects contained in the bucket, based on their
+     * creation time. Any attempt to overwrite or delete objects younger than the
+     * retention period will result in a PERMISSION_DENIED error.  An unlocked
+     * retention policy can be modified or removed from the bucket via a
+     * storage.buckets.update operation. A locked retention policy cannot be
+     * removed or shortened in duration for the lifetime of the bucket.
+     * Attempting to remove or decrease period of a locked retention policy will
+     * result in a PERMISSION_DENIED error.
+     * 
+ * + * .google.storage.v2.Bucket.RetentionPolicy retention_policy = 22; + * + * @return Whether the retentionPolicy field is set. + */ + public boolean hasRetentionPolicy() { + return retentionPolicyBuilder_ != null || retentionPolicy_ != null; + } + /** + * + * + *
+     * The bucket's retention policy. The retention policy enforces a minimum
+     * retention time for all objects contained in the bucket, based on their
+     * creation time. Any attempt to overwrite or delete objects younger than the
+     * retention period will result in a PERMISSION_DENIED error.  An unlocked
+     * retention policy can be modified or removed from the bucket via a
+     * storage.buckets.update operation. A locked retention policy cannot be
+     * removed or shortened in duration for the lifetime of the bucket.
+     * Attempting to remove or decrease period of a locked retention policy will
+     * result in a PERMISSION_DENIED error.
+     * 
+ * + * .google.storage.v2.Bucket.RetentionPolicy retention_policy = 22; + * + * @return The retentionPolicy. + */ + public com.google.storage.v2.Bucket.RetentionPolicy getRetentionPolicy() { + if (retentionPolicyBuilder_ == null) { + return retentionPolicy_ == null + ? com.google.storage.v2.Bucket.RetentionPolicy.getDefaultInstance() + : retentionPolicy_; + } else { + return retentionPolicyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The bucket's retention policy. The retention policy enforces a minimum
+     * retention time for all objects contained in the bucket, based on their
+     * creation time. Any attempt to overwrite or delete objects younger than the
+     * retention period will result in a PERMISSION_DENIED error.  An unlocked
+     * retention policy can be modified or removed from the bucket via a
+     * storage.buckets.update operation. A locked retention policy cannot be
+     * removed or shortened in duration for the lifetime of the bucket.
+     * Attempting to remove or decrease period of a locked retention policy will
+     * result in a PERMISSION_DENIED error.
+     * 
+ * + * .google.storage.v2.Bucket.RetentionPolicy retention_policy = 22; + */ + public Builder setRetentionPolicy(com.google.storage.v2.Bucket.RetentionPolicy value) { + if (retentionPolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + retentionPolicy_ = value; + onChanged(); + } else { + retentionPolicyBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The bucket's retention policy. The retention policy enforces a minimum
+     * retention time for all objects contained in the bucket, based on their
+     * creation time. Any attempt to overwrite or delete objects younger than the
+     * retention period will result in a PERMISSION_DENIED error.  An unlocked
+     * retention policy can be modified or removed from the bucket via a
+     * storage.buckets.update operation. A locked retention policy cannot be
+     * removed or shortened in duration for the lifetime of the bucket.
+     * Attempting to remove or decrease period of a locked retention policy will
+     * result in a PERMISSION_DENIED error.
+     * 
+ * + * .google.storage.v2.Bucket.RetentionPolicy retention_policy = 22; + */ + public Builder setRetentionPolicy( + com.google.storage.v2.Bucket.RetentionPolicy.Builder builderForValue) { + if (retentionPolicyBuilder_ == null) { + retentionPolicy_ = builderForValue.build(); + onChanged(); + } else { + retentionPolicyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The bucket's retention policy. The retention policy enforces a minimum
+     * retention time for all objects contained in the bucket, based on their
+     * creation time. Any attempt to overwrite or delete objects younger than the
+     * retention period will result in a PERMISSION_DENIED error.  An unlocked
+     * retention policy can be modified or removed from the bucket via a
+     * storage.buckets.update operation. A locked retention policy cannot be
+     * removed or shortened in duration for the lifetime of the bucket.
+     * Attempting to remove or decrease period of a locked retention policy will
+     * result in a PERMISSION_DENIED error.
+     * 
+ * + * .google.storage.v2.Bucket.RetentionPolicy retention_policy = 22; + */ + public Builder mergeRetentionPolicy(com.google.storage.v2.Bucket.RetentionPolicy value) { + if (retentionPolicyBuilder_ == null) { + if (retentionPolicy_ != null) { + retentionPolicy_ = + com.google.storage.v2.Bucket.RetentionPolicy.newBuilder(retentionPolicy_) + .mergeFrom(value) + .buildPartial(); + } else { + retentionPolicy_ = value; + } + onChanged(); + } else { + retentionPolicyBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The bucket's retention policy. The retention policy enforces a minimum
+     * retention time for all objects contained in the bucket, based on their
+     * creation time. Any attempt to overwrite or delete objects younger than the
+     * retention period will result in a PERMISSION_DENIED error.  An unlocked
+     * retention policy can be modified or removed from the bucket via a
+     * storage.buckets.update operation. A locked retention policy cannot be
+     * removed or shortened in duration for the lifetime of the bucket.
+     * Attempting to remove or decrease period of a locked retention policy will
+     * result in a PERMISSION_DENIED error.
+     * 
+ * + * .google.storage.v2.Bucket.RetentionPolicy retention_policy = 22; + */ + public Builder clearRetentionPolicy() { + if (retentionPolicyBuilder_ == null) { + retentionPolicy_ = null; + onChanged(); + } else { + retentionPolicy_ = null; + retentionPolicyBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The bucket's retention policy. The retention policy enforces a minimum
+     * retention time for all objects contained in the bucket, based on their
+     * creation time. Any attempt to overwrite or delete objects younger than the
+     * retention period will result in a PERMISSION_DENIED error.  An unlocked
+     * retention policy can be modified or removed from the bucket via a
+     * storage.buckets.update operation. A locked retention policy cannot be
+     * removed or shortened in duration for the lifetime of the bucket.
+     * Attempting to remove or decrease period of a locked retention policy will
+     * result in a PERMISSION_DENIED error.
+     * 
+ * + * .google.storage.v2.Bucket.RetentionPolicy retention_policy = 22; + */ + public com.google.storage.v2.Bucket.RetentionPolicy.Builder getRetentionPolicyBuilder() { + + onChanged(); + return getRetentionPolicyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The bucket's retention policy. The retention policy enforces a minimum
+     * retention time for all objects contained in the bucket, based on their
+     * creation time. Any attempt to overwrite or delete objects younger than the
+     * retention period will result in a PERMISSION_DENIED error.  An unlocked
+     * retention policy can be modified or removed from the bucket via a
+     * storage.buckets.update operation. A locked retention policy cannot be
+     * removed or shortened in duration for the lifetime of the bucket.
+     * Attempting to remove or decrease period of a locked retention policy will
+     * result in a PERMISSION_DENIED error.
+     * 
+ * + * .google.storage.v2.Bucket.RetentionPolicy retention_policy = 22; + */ + public com.google.storage.v2.Bucket.RetentionPolicyOrBuilder getRetentionPolicyOrBuilder() { + if (retentionPolicyBuilder_ != null) { + return retentionPolicyBuilder_.getMessageOrBuilder(); + } else { + return retentionPolicy_ == null + ? com.google.storage.v2.Bucket.RetentionPolicy.getDefaultInstance() + : retentionPolicy_; + } + } + /** + * + * + *
+     * The bucket's retention policy. The retention policy enforces a minimum
+     * retention time for all objects contained in the bucket, based on their
+     * creation time. Any attempt to overwrite or delete objects younger than the
+     * retention period will result in a PERMISSION_DENIED error.  An unlocked
+     * retention policy can be modified or removed from the bucket via a
+     * storage.buckets.update operation. A locked retention policy cannot be
+     * removed or shortened in duration for the lifetime of the bucket.
+     * Attempting to remove or decrease period of a locked retention policy will
+     * result in a PERMISSION_DENIED error.
+     * 
+ * + * .google.storage.v2.Bucket.RetentionPolicy retention_policy = 22; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Bucket.RetentionPolicy, + com.google.storage.v2.Bucket.RetentionPolicy.Builder, + com.google.storage.v2.Bucket.RetentionPolicyOrBuilder> + getRetentionPolicyFieldBuilder() { + if (retentionPolicyBuilder_ == null) { + retentionPolicyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Bucket.RetentionPolicy, + com.google.storage.v2.Bucket.RetentionPolicy.Builder, + com.google.storage.v2.Bucket.RetentionPolicyOrBuilder>( + getRetentionPolicy(), getParentForChildren(), isClean()); + retentionPolicy_ = null; + } + return retentionPolicyBuilder_; + } + + private com.google.storage.v2.Bucket.IamConfig iamConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Bucket.IamConfig, + com.google.storage.v2.Bucket.IamConfig.Builder, + com.google.storage.v2.Bucket.IamConfigOrBuilder> + iamConfigBuilder_; + /** + * + * + *
+     * The bucket's IAM config.
+     * 
+ * + * .google.storage.v2.Bucket.IamConfig iam_config = 23; + * + * @return Whether the iamConfig field is set. + */ + public boolean hasIamConfig() { + return iamConfigBuilder_ != null || iamConfig_ != null; + } + /** + * + * + *
+     * The bucket's IAM config.
+     * 
+ * + * .google.storage.v2.Bucket.IamConfig iam_config = 23; + * + * @return The iamConfig. + */ + public com.google.storage.v2.Bucket.IamConfig getIamConfig() { + if (iamConfigBuilder_ == null) { + return iamConfig_ == null + ? com.google.storage.v2.Bucket.IamConfig.getDefaultInstance() + : iamConfig_; + } else { + return iamConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The bucket's IAM config.
+     * 
+ * + * .google.storage.v2.Bucket.IamConfig iam_config = 23; + */ + public Builder setIamConfig(com.google.storage.v2.Bucket.IamConfig value) { + if (iamConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + iamConfig_ = value; + onChanged(); + } else { + iamConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The bucket's IAM config.
+     * 
+ * + * .google.storage.v2.Bucket.IamConfig iam_config = 23; + */ + public Builder setIamConfig(com.google.storage.v2.Bucket.IamConfig.Builder builderForValue) { + if (iamConfigBuilder_ == null) { + iamConfig_ = builderForValue.build(); + onChanged(); + } else { + iamConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The bucket's IAM config.
+     * 
+ * + * .google.storage.v2.Bucket.IamConfig iam_config = 23; + */ + public Builder mergeIamConfig(com.google.storage.v2.Bucket.IamConfig value) { + if (iamConfigBuilder_ == null) { + if (iamConfig_ != null) { + iamConfig_ = + com.google.storage.v2.Bucket.IamConfig.newBuilder(iamConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + iamConfig_ = value; + } + onChanged(); + } else { + iamConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The bucket's IAM config.
+     * 
+ * + * .google.storage.v2.Bucket.IamConfig iam_config = 23; + */ + public Builder clearIamConfig() { + if (iamConfigBuilder_ == null) { + iamConfig_ = null; + onChanged(); + } else { + iamConfig_ = null; + iamConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The bucket's IAM config.
+     * 
+ * + * .google.storage.v2.Bucket.IamConfig iam_config = 23; + */ + public com.google.storage.v2.Bucket.IamConfig.Builder getIamConfigBuilder() { + + onChanged(); + return getIamConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The bucket's IAM config.
+     * 
+ * + * .google.storage.v2.Bucket.IamConfig iam_config = 23; + */ + public com.google.storage.v2.Bucket.IamConfigOrBuilder getIamConfigOrBuilder() { + if (iamConfigBuilder_ != null) { + return iamConfigBuilder_.getMessageOrBuilder(); + } else { + return iamConfig_ == null + ? com.google.storage.v2.Bucket.IamConfig.getDefaultInstance() + : iamConfig_; + } + } + /** + * + * + *
+     * The bucket's IAM config.
+     * 
+ * + * .google.storage.v2.Bucket.IamConfig iam_config = 23; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Bucket.IamConfig, + com.google.storage.v2.Bucket.IamConfig.Builder, + com.google.storage.v2.Bucket.IamConfigOrBuilder> + getIamConfigFieldBuilder() { + if (iamConfigBuilder_ == null) { + iamConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Bucket.IamConfig, + com.google.storage.v2.Bucket.IamConfig.Builder, + com.google.storage.v2.Bucket.IamConfigOrBuilder>( + getIamConfig(), getParentForChildren(), isClean()); + iamConfig_ = null; + } + return iamConfigBuilder_; + } + + private com.google.protobuf.LazyStringList zoneAffinity_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureZoneAffinityIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + zoneAffinity_ = new com.google.protobuf.LazyStringArrayList(zoneAffinity_); + bitField0_ |= 0x00000010; + } + } + /** + * + * + *
+     * Immutable. The zone or zones from which the bucket is intended to use zonal quota.
+     * Requests for data from outside the specified affinities are still allowed
+     * but won't be able to use zonal quota. The values are case-insensitive.
+     * Attempting to update this field after bucket is created will result in an
+     * error.
+     * 
+ * + * repeated string zone_affinity = 24 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return A list containing the zoneAffinity. + */ + public com.google.protobuf.ProtocolStringList getZoneAffinityList() { + return zoneAffinity_.getUnmodifiableView(); + } + /** + * + * + *
+     * Immutable. The zone or zones from which the bucket is intended to use zonal quota.
+     * Requests for data from outside the specified affinities are still allowed
+     * but won't be able to use zonal quota. The values are case-insensitive.
+     * Attempting to update this field after bucket is created will result in an
+     * error.
+     * 
+ * + * repeated string zone_affinity = 24 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The count of zoneAffinity. + */ + public int getZoneAffinityCount() { + return zoneAffinity_.size(); + } + /** + * + * + *
+     * Immutable. The zone or zones from which the bucket is intended to use zonal quota.
+     * Requests for data from outside the specified affinities are still allowed
+     * but won't be able to use zonal quota. The values are case-insensitive.
+     * Attempting to update this field after bucket is created will result in an
+     * error.
+     * 
+ * + * repeated string zone_affinity = 24 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param index The index of the element to return. + * @return The zoneAffinity at the given index. + */ + public java.lang.String getZoneAffinity(int index) { + return zoneAffinity_.get(index); + } + /** + * + * + *
+     * Immutable. The zone or zones from which the bucket is intended to use zonal quota.
+     * Requests for data from outside the specified affinities are still allowed
+     * but won't be able to use zonal quota. The values are case-insensitive.
+     * Attempting to update this field after bucket is created will result in an
+     * error.
+     * 
+ * + * repeated string zone_affinity = 24 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param index The index of the value to return. + * @return The bytes of the zoneAffinity at the given index. + */ + public com.google.protobuf.ByteString getZoneAffinityBytes(int index) { + return zoneAffinity_.getByteString(index); + } + /** + * + * + *
+     * Immutable. The zone or zones from which the bucket is intended to use zonal quota.
+     * Requests for data from outside the specified affinities are still allowed
+     * but won't be able to use zonal quota. The values are case-insensitive.
+     * Attempting to update this field after bucket is created will result in an
+     * error.
+     * 
+ * + * repeated string zone_affinity = 24 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param index The index to set the value at. + * @param value The zoneAffinity to set. + * @return This builder for chaining. + */ + public Builder setZoneAffinity(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureZoneAffinityIsMutable(); + zoneAffinity_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The zone or zones from which the bucket is intended to use zonal quota.
+     * Requests for data from outside the specified affinities are still allowed
+     * but won't be able to use zonal quota. The values are case-insensitive.
+     * Attempting to update this field after bucket is created will result in an
+     * error.
+     * 
+ * + * repeated string zone_affinity = 24 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The zoneAffinity to add. + * @return This builder for chaining. + */ + public Builder addZoneAffinity(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureZoneAffinityIsMutable(); + zoneAffinity_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The zone or zones from which the bucket is intended to use zonal quota.
+     * Requests for data from outside the specified affinities are still allowed
+     * but won't be able to use zonal quota. The values are case-insensitive.
+     * Attempting to update this field after bucket is created will result in an
+     * error.
+     * 
+ * + * repeated string zone_affinity = 24 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param values The zoneAffinity to add. + * @return This builder for chaining. + */ + public Builder addAllZoneAffinity(java.lang.Iterable values) { + ensureZoneAffinityIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, zoneAffinity_); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The zone or zones from which the bucket is intended to use zonal quota.
+     * Requests for data from outside the specified affinities are still allowed
+     * but won't be able to use zonal quota. The values are case-insensitive.
+     * Attempting to update this field after bucket is created will result in an
+     * error.
+     * 
+ * + * repeated string zone_affinity = 24 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearZoneAffinity() { + zoneAffinity_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The zone or zones from which the bucket is intended to use zonal quota.
+     * Requests for data from outside the specified affinities are still allowed
+     * but won't be able to use zonal quota. The values are case-insensitive.
+     * Attempting to update this field after bucket is created will result in an
+     * error.
+     * 
+ * + * repeated string zone_affinity = 24 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The bytes of the zoneAffinity to add. + * @return This builder for chaining. + */ + public Builder addZoneAffinityBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureZoneAffinityIsMutable(); + zoneAffinity_.add(value); + onChanged(); + return this; + } + + private boolean satisfiesPzs_; + /** + * + * + *
+     * Reserved for future use.
+     * 
+ * + * bool satisfies_pzs = 25; + * + * @return The satisfiesPzs. + */ + @java.lang.Override + public boolean getSatisfiesPzs() { + return satisfiesPzs_; + } + /** + * + * + *
+     * Reserved for future use.
+     * 
+ * + * bool satisfies_pzs = 25; + * + * @param value The satisfiesPzs to set. + * @return This builder for chaining. + */ + public Builder setSatisfiesPzs(boolean value) { + + satisfiesPzs_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Reserved for future use.
+     * 
+ * + * bool satisfies_pzs = 25; + * + * @return This builder for chaining. + */ + public Builder clearSatisfiesPzs() { + + satisfiesPzs_ = 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) + } + + // @@protoc_insertion_point(class_scope:google.storage.v2.Bucket) + private static final com.google.storage.v2.Bucket DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.v2.Bucket(); + } + + public static com.google.storage.v2.Bucket getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Bucket parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Bucket(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.storage.v2.Bucket getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BucketAccessControl.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BucketAccessControl.java new file mode 100644 index 0000000000..116695c159 --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BucketAccessControl.java @@ -0,0 +1,1903 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +package com.google.storage.v2; + +/** + * + * + *
+ * An access-control entry.
+ * 
+ * + * Protobuf type {@code google.storage.v2.BucketAccessControl} + */ +public final class BucketAccessControl extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.v2.BucketAccessControl) + BucketAccessControlOrBuilder { + private static final long serialVersionUID = 0L; + // Use BucketAccessControl.newBuilder() to construct. + private BucketAccessControl(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BucketAccessControl() { + role_ = ""; + id_ = ""; + entity_ = ""; + entityId_ = ""; + email_ = ""; + domain_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BucketAccessControl(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BucketAccessControl( + 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(); + + role_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + id_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + entity_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + entityId_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + email_ = s; + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + domain_ = s; + break; + } + case 58: + { + com.google.storage.v2.ProjectTeam.Builder subBuilder = null; + if (projectTeam_ != null) { + subBuilder = projectTeam_.toBuilder(); + } + projectTeam_ = + input.readMessage(com.google.storage.v2.ProjectTeam.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(projectTeam_); + projectTeam_ = 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_BucketAccessControl_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_BucketAccessControl_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.BucketAccessControl.class, + com.google.storage.v2.BucketAccessControl.Builder.class); + } + + public static final int ROLE_FIELD_NUMBER = 1; + private volatile java.lang.Object role_; + /** + * + * + *
+   * The access permission for the entity.
+   * 
+ * + * string role = 1; + * + * @return The role. + */ + @java.lang.Override + public java.lang.String getRole() { + java.lang.Object ref = role_; + 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(); + role_ = s; + return s; + } + } + /** + * + * + *
+   * The access permission for the entity.
+   * 
+ * + * string role = 1; + * + * @return The bytes for role. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRoleBytes() { + java.lang.Object ref = role_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + role_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ID_FIELD_NUMBER = 2; + private volatile java.lang.Object id_; + /** + * + * + *
+   * The ID of the access-control entry.
+   * 
+ * + * string id = 2; + * + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + java.lang.Object ref = id_; + 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(); + id_ = s; + return s; + } + } + /** + * + * + *
+   * The ID of the access-control entry.
+   * 
+ * + * string id = 2; + * + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENTITY_FIELD_NUMBER = 3; + private volatile java.lang.Object entity_; + /** + * + * + *
+   * The entity holding the permission, in one of the following forms:
+   * * `user-{userid}`
+   * * `user-{email}`
+   * * `group-{groupid}`
+   * * `group-{email}`
+   * * `domain-{domain}`
+   * * `project-{team-projectid}`
+   * * `allUsers`
+   * * `allAuthenticatedUsers`
+   * Examples:
+   * * The user `liz@example.com` would be `user-liz@example.com`.
+   * * The group `example@googlegroups.com` would be
+   * `group-example@googlegroups.com`
+   * * All members of the Google Apps for Business domain `example.com` would be
+   * `domain-example.com`
+   * 
+ * + * string entity = 3; + * + * @return The entity. + */ + @java.lang.Override + public java.lang.String getEntity() { + java.lang.Object ref = entity_; + 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(); + entity_ = s; + return s; + } + } + /** + * + * + *
+   * The entity holding the permission, in one of the following forms:
+   * * `user-{userid}`
+   * * `user-{email}`
+   * * `group-{groupid}`
+   * * `group-{email}`
+   * * `domain-{domain}`
+   * * `project-{team-projectid}`
+   * * `allUsers`
+   * * `allAuthenticatedUsers`
+   * Examples:
+   * * The user `liz@example.com` would be `user-liz@example.com`.
+   * * The group `example@googlegroups.com` would be
+   * `group-example@googlegroups.com`
+   * * All members of the Google Apps for Business domain `example.com` would be
+   * `domain-example.com`
+   * 
+ * + * string entity = 3; + * + * @return The bytes for entity. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEntityBytes() { + java.lang.Object ref = entity_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + entity_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENTITY_ID_FIELD_NUMBER = 4; + private volatile java.lang.Object entityId_; + /** + * + * + *
+   * The ID for the entity, if any.
+   * 
+ * + * string entity_id = 4; + * + * @return The entityId. + */ + @java.lang.Override + public java.lang.String getEntityId() { + java.lang.Object ref = entityId_; + 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(); + entityId_ = s; + return s; + } + } + /** + * + * + *
+   * The ID for the entity, if any.
+   * 
+ * + * string entity_id = 4; + * + * @return The bytes for entityId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEntityIdBytes() { + java.lang.Object ref = entityId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + entityId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EMAIL_FIELD_NUMBER = 5; + private volatile java.lang.Object email_; + /** + * + * + *
+   * The email address associated with the entity, if any.
+   * 
+ * + * string email = 5; + * + * @return The email. + */ + @java.lang.Override + public java.lang.String getEmail() { + java.lang.Object ref = email_; + 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(); + email_ = s; + return s; + } + } + /** + * + * + *
+   * The email address associated with the entity, if any.
+   * 
+ * + * string email = 5; + * + * @return The bytes for email. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEmailBytes() { + java.lang.Object ref = email_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + email_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DOMAIN_FIELD_NUMBER = 6; + private volatile java.lang.Object domain_; + /** + * + * + *
+   * The domain associated with the entity, if any.
+   * 
+ * + * string domain = 6; + * + * @return The domain. + */ + @java.lang.Override + public java.lang.String getDomain() { + java.lang.Object ref = domain_; + 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(); + domain_ = s; + return s; + } + } + /** + * + * + *
+   * The domain associated with the entity, if any.
+   * 
+ * + * string domain = 6; + * + * @return The bytes for domain. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDomainBytes() { + java.lang.Object ref = domain_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + domain_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_TEAM_FIELD_NUMBER = 7; + private com.google.storage.v2.ProjectTeam projectTeam_; + /** + * + * + *
+   * The project team associated with the entity, if any.
+   * 
+ * + * .google.storage.v2.ProjectTeam project_team = 7; + * + * @return Whether the projectTeam field is set. + */ + @java.lang.Override + public boolean hasProjectTeam() { + return projectTeam_ != null; + } + /** + * + * + *
+   * The project team associated with the entity, if any.
+   * 
+ * + * .google.storage.v2.ProjectTeam project_team = 7; + * + * @return The projectTeam. + */ + @java.lang.Override + public com.google.storage.v2.ProjectTeam getProjectTeam() { + return projectTeam_ == null + ? com.google.storage.v2.ProjectTeam.getDefaultInstance() + : projectTeam_; + } + /** + * + * + *
+   * The project team associated with the entity, if any.
+   * 
+ * + * .google.storage.v2.ProjectTeam project_team = 7; + */ + @java.lang.Override + public com.google.storage.v2.ProjectTeamOrBuilder getProjectTeamOrBuilder() { + return getProjectTeam(); + } + + 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 (!getRoleBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, role_); + } + if (!getIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, id_); + } + if (!getEntityBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, entity_); + } + if (!getEntityIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, entityId_); + } + if (!getEmailBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, email_); + } + if (!getDomainBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, domain_); + } + if (projectTeam_ != null) { + output.writeMessage(7, getProjectTeam()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getRoleBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, role_); + } + if (!getIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, id_); + } + if (!getEntityBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, entity_); + } + if (!getEntityIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, entityId_); + } + if (!getEmailBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, email_); + } + if (!getDomainBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, domain_); + } + if (projectTeam_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getProjectTeam()); + } + 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.BucketAccessControl)) { + return super.equals(obj); + } + com.google.storage.v2.BucketAccessControl other = + (com.google.storage.v2.BucketAccessControl) obj; + + if (!getRole().equals(other.getRole())) return false; + if (!getId().equals(other.getId())) return false; + if (!getEntity().equals(other.getEntity())) return false; + if (!getEntityId().equals(other.getEntityId())) return false; + if (!getEmail().equals(other.getEmail())) return false; + if (!getDomain().equals(other.getDomain())) return false; + if (hasProjectTeam() != other.hasProjectTeam()) return false; + if (hasProjectTeam()) { + if (!getProjectTeam().equals(other.getProjectTeam())) 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) + ROLE_FIELD_NUMBER; + hash = (53 * hash) + getRole().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + hash = (37 * hash) + ENTITY_FIELD_NUMBER; + hash = (53 * hash) + getEntity().hashCode(); + hash = (37 * hash) + ENTITY_ID_FIELD_NUMBER; + hash = (53 * hash) + getEntityId().hashCode(); + hash = (37 * hash) + EMAIL_FIELD_NUMBER; + hash = (53 * hash) + getEmail().hashCode(); + hash = (37 * hash) + DOMAIN_FIELD_NUMBER; + hash = (53 * hash) + getDomain().hashCode(); + if (hasProjectTeam()) { + hash = (37 * hash) + PROJECT_TEAM_FIELD_NUMBER; + hash = (53 * hash) + getProjectTeam().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.v2.BucketAccessControl parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.BucketAccessControl 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.BucketAccessControl parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.BucketAccessControl 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.BucketAccessControl parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.BucketAccessControl parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.BucketAccessControl parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.BucketAccessControl 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.BucketAccessControl parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.v2.BucketAccessControl 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.BucketAccessControl parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.BucketAccessControl 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.BucketAccessControl 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 access-control entry.
+   * 
+ * + * Protobuf type {@code google.storage.v2.BucketAccessControl} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.BucketAccessControl) + com.google.storage.v2.BucketAccessControlOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_BucketAccessControl_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_BucketAccessControl_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.BucketAccessControl.class, + com.google.storage.v2.BucketAccessControl.Builder.class); + } + + // Construct using com.google.storage.v2.BucketAccessControl.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + role_ = ""; + + id_ = ""; + + entity_ = ""; + + entityId_ = ""; + + email_ = ""; + + domain_ = ""; + + if (projectTeamBuilder_ == null) { + projectTeam_ = null; + } else { + projectTeam_ = null; + projectTeamBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_BucketAccessControl_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.BucketAccessControl getDefaultInstanceForType() { + return com.google.storage.v2.BucketAccessControl.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.BucketAccessControl build() { + com.google.storage.v2.BucketAccessControl result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.BucketAccessControl buildPartial() { + com.google.storage.v2.BucketAccessControl result = + new com.google.storage.v2.BucketAccessControl(this); + result.role_ = role_; + result.id_ = id_; + result.entity_ = entity_; + result.entityId_ = entityId_; + result.email_ = email_; + result.domain_ = domain_; + if (projectTeamBuilder_ == null) { + result.projectTeam_ = projectTeam_; + } else { + result.projectTeam_ = projectTeamBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.storage.v2.BucketAccessControl) { + return mergeFrom((com.google.storage.v2.BucketAccessControl) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.BucketAccessControl other) { + if (other == com.google.storage.v2.BucketAccessControl.getDefaultInstance()) return this; + if (!other.getRole().isEmpty()) { + role_ = other.role_; + onChanged(); + } + if (!other.getId().isEmpty()) { + id_ = other.id_; + onChanged(); + } + if (!other.getEntity().isEmpty()) { + entity_ = other.entity_; + onChanged(); + } + if (!other.getEntityId().isEmpty()) { + entityId_ = other.entityId_; + onChanged(); + } + if (!other.getEmail().isEmpty()) { + email_ = other.email_; + onChanged(); + } + if (!other.getDomain().isEmpty()) { + domain_ = other.domain_; + onChanged(); + } + if (other.hasProjectTeam()) { + mergeProjectTeam(other.getProjectTeam()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.storage.v2.BucketAccessControl parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.storage.v2.BucketAccessControl) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object role_ = ""; + /** + * + * + *
+     * The access permission for the entity.
+     * 
+ * + * string role = 1; + * + * @return The role. + */ + public java.lang.String getRole() { + java.lang.Object ref = role_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + role_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The access permission for the entity.
+     * 
+ * + * string role = 1; + * + * @return The bytes for role. + */ + public com.google.protobuf.ByteString getRoleBytes() { + java.lang.Object ref = role_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + role_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The access permission for the entity.
+     * 
+ * + * string role = 1; + * + * @param value The role to set. + * @return This builder for chaining. + */ + public Builder setRole(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + role_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The access permission for the entity.
+     * 
+ * + * string role = 1; + * + * @return This builder for chaining. + */ + public Builder clearRole() { + + role_ = getDefaultInstance().getRole(); + onChanged(); + return this; + } + /** + * + * + *
+     * The access permission for the entity.
+     * 
+ * + * string role = 1; + * + * @param value The bytes for role to set. + * @return This builder for chaining. + */ + public Builder setRoleBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + role_ = value; + onChanged(); + return this; + } + + private java.lang.Object id_ = ""; + /** + * + * + *
+     * The ID of the access-control entry.
+     * 
+ * + * string id = 2; + * + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The ID of the access-control entry.
+     * 
+ * + * string id = 2; + * + * @return The bytes for id. + */ + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The ID of the access-control entry.
+     * 
+ * + * string id = 2; + * + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + id_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The ID of the access-control entry.
+     * 
+ * + * string id = 2; + * + * @return This builder for chaining. + */ + public Builder clearId() { + + id_ = getDefaultInstance().getId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The ID of the access-control entry.
+     * 
+ * + * string id = 2; + * + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + id_ = value; + onChanged(); + return this; + } + + private java.lang.Object entity_ = ""; + /** + * + * + *
+     * The entity holding the permission, in one of the following forms:
+     * * `user-{userid}`
+     * * `user-{email}`
+     * * `group-{groupid}`
+     * * `group-{email}`
+     * * `domain-{domain}`
+     * * `project-{team-projectid}`
+     * * `allUsers`
+     * * `allAuthenticatedUsers`
+     * Examples:
+     * * The user `liz@example.com` would be `user-liz@example.com`.
+     * * The group `example@googlegroups.com` would be
+     * `group-example@googlegroups.com`
+     * * All members of the Google Apps for Business domain `example.com` would be
+     * `domain-example.com`
+     * 
+ * + * string entity = 3; + * + * @return The entity. + */ + public java.lang.String getEntity() { + java.lang.Object ref = entity_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + entity_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The entity holding the permission, in one of the following forms:
+     * * `user-{userid}`
+     * * `user-{email}`
+     * * `group-{groupid}`
+     * * `group-{email}`
+     * * `domain-{domain}`
+     * * `project-{team-projectid}`
+     * * `allUsers`
+     * * `allAuthenticatedUsers`
+     * Examples:
+     * * The user `liz@example.com` would be `user-liz@example.com`.
+     * * The group `example@googlegroups.com` would be
+     * `group-example@googlegroups.com`
+     * * All members of the Google Apps for Business domain `example.com` would be
+     * `domain-example.com`
+     * 
+ * + * string entity = 3; + * + * @return The bytes for entity. + */ + public com.google.protobuf.ByteString getEntityBytes() { + java.lang.Object ref = entity_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + entity_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The entity holding the permission, in one of the following forms:
+     * * `user-{userid}`
+     * * `user-{email}`
+     * * `group-{groupid}`
+     * * `group-{email}`
+     * * `domain-{domain}`
+     * * `project-{team-projectid}`
+     * * `allUsers`
+     * * `allAuthenticatedUsers`
+     * Examples:
+     * * The user `liz@example.com` would be `user-liz@example.com`.
+     * * The group `example@googlegroups.com` would be
+     * `group-example@googlegroups.com`
+     * * All members of the Google Apps for Business domain `example.com` would be
+     * `domain-example.com`
+     * 
+ * + * string entity = 3; + * + * @param value The entity to set. + * @return This builder for chaining. + */ + public Builder setEntity(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + entity_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The entity holding the permission, in one of the following forms:
+     * * `user-{userid}`
+     * * `user-{email}`
+     * * `group-{groupid}`
+     * * `group-{email}`
+     * * `domain-{domain}`
+     * * `project-{team-projectid}`
+     * * `allUsers`
+     * * `allAuthenticatedUsers`
+     * Examples:
+     * * The user `liz@example.com` would be `user-liz@example.com`.
+     * * The group `example@googlegroups.com` would be
+     * `group-example@googlegroups.com`
+     * * All members of the Google Apps for Business domain `example.com` would be
+     * `domain-example.com`
+     * 
+ * + * string entity = 3; + * + * @return This builder for chaining. + */ + public Builder clearEntity() { + + entity_ = getDefaultInstance().getEntity(); + onChanged(); + return this; + } + /** + * + * + *
+     * The entity holding the permission, in one of the following forms:
+     * * `user-{userid}`
+     * * `user-{email}`
+     * * `group-{groupid}`
+     * * `group-{email}`
+     * * `domain-{domain}`
+     * * `project-{team-projectid}`
+     * * `allUsers`
+     * * `allAuthenticatedUsers`
+     * Examples:
+     * * The user `liz@example.com` would be `user-liz@example.com`.
+     * * The group `example@googlegroups.com` would be
+     * `group-example@googlegroups.com`
+     * * All members of the Google Apps for Business domain `example.com` would be
+     * `domain-example.com`
+     * 
+ * + * string entity = 3; + * + * @param value The bytes for entity to set. + * @return This builder for chaining. + */ + public Builder setEntityBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + entity_ = value; + onChanged(); + return this; + } + + private java.lang.Object entityId_ = ""; + /** + * + * + *
+     * The ID for the entity, if any.
+     * 
+ * + * string entity_id = 4; + * + * @return The entityId. + */ + public java.lang.String getEntityId() { + java.lang.Object ref = entityId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + entityId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The ID for the entity, if any.
+     * 
+ * + * string entity_id = 4; + * + * @return The bytes for entityId. + */ + public com.google.protobuf.ByteString getEntityIdBytes() { + java.lang.Object ref = entityId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + entityId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The ID for the entity, if any.
+     * 
+ * + * string entity_id = 4; + * + * @param value The entityId to set. + * @return This builder for chaining. + */ + public Builder setEntityId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + entityId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The ID for the entity, if any.
+     * 
+ * + * string entity_id = 4; + * + * @return This builder for chaining. + */ + public Builder clearEntityId() { + + entityId_ = getDefaultInstance().getEntityId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The ID for the entity, if any.
+     * 
+ * + * string entity_id = 4; + * + * @param value The bytes for entityId to set. + * @return This builder for chaining. + */ + public Builder setEntityIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + entityId_ = value; + onChanged(); + return this; + } + + private java.lang.Object email_ = ""; + /** + * + * + *
+     * The email address associated with the entity, if any.
+     * 
+ * + * string email = 5; + * + * @return The email. + */ + public java.lang.String getEmail() { + java.lang.Object ref = email_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + email_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The email address associated with the entity, if any.
+     * 
+ * + * string email = 5; + * + * @return The bytes for email. + */ + public com.google.protobuf.ByteString getEmailBytes() { + java.lang.Object ref = email_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + email_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The email address associated with the entity, if any.
+     * 
+ * + * string email = 5; + * + * @param value The email to set. + * @return This builder for chaining. + */ + public Builder setEmail(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + email_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The email address associated with the entity, if any.
+     * 
+ * + * string email = 5; + * + * @return This builder for chaining. + */ + public Builder clearEmail() { + + email_ = getDefaultInstance().getEmail(); + onChanged(); + return this; + } + /** + * + * + *
+     * The email address associated with the entity, if any.
+     * 
+ * + * string email = 5; + * + * @param value The bytes for email to set. + * @return This builder for chaining. + */ + public Builder setEmailBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + email_ = value; + onChanged(); + return this; + } + + private java.lang.Object domain_ = ""; + /** + * + * + *
+     * The domain associated with the entity, if any.
+     * 
+ * + * string domain = 6; + * + * @return The domain. + */ + public java.lang.String getDomain() { + java.lang.Object ref = domain_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + domain_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The domain associated with the entity, if any.
+     * 
+ * + * string domain = 6; + * + * @return The bytes for domain. + */ + public com.google.protobuf.ByteString getDomainBytes() { + java.lang.Object ref = domain_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + domain_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The domain associated with the entity, if any.
+     * 
+ * + * string domain = 6; + * + * @param value The domain to set. + * @return This builder for chaining. + */ + public Builder setDomain(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + domain_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The domain associated with the entity, if any.
+     * 
+ * + * string domain = 6; + * + * @return This builder for chaining. + */ + public Builder clearDomain() { + + domain_ = getDefaultInstance().getDomain(); + onChanged(); + return this; + } + /** + * + * + *
+     * The domain associated with the entity, if any.
+     * 
+ * + * string domain = 6; + * + * @param value The bytes for domain to set. + * @return This builder for chaining. + */ + public Builder setDomainBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + domain_ = value; + onChanged(); + return this; + } + + private com.google.storage.v2.ProjectTeam projectTeam_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.ProjectTeam, + com.google.storage.v2.ProjectTeam.Builder, + com.google.storage.v2.ProjectTeamOrBuilder> + projectTeamBuilder_; + /** + * + * + *
+     * The project team associated with the entity, if any.
+     * 
+ * + * .google.storage.v2.ProjectTeam project_team = 7; + * + * @return Whether the projectTeam field is set. + */ + public boolean hasProjectTeam() { + return projectTeamBuilder_ != null || projectTeam_ != null; + } + /** + * + * + *
+     * The project team associated with the entity, if any.
+     * 
+ * + * .google.storage.v2.ProjectTeam project_team = 7; + * + * @return The projectTeam. + */ + public com.google.storage.v2.ProjectTeam getProjectTeam() { + if (projectTeamBuilder_ == null) { + return projectTeam_ == null + ? com.google.storage.v2.ProjectTeam.getDefaultInstance() + : projectTeam_; + } else { + return projectTeamBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The project team associated with the entity, if any.
+     * 
+ * + * .google.storage.v2.ProjectTeam project_team = 7; + */ + public Builder setProjectTeam(com.google.storage.v2.ProjectTeam value) { + if (projectTeamBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + projectTeam_ = value; + onChanged(); + } else { + projectTeamBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The project team associated with the entity, if any.
+     * 
+ * + * .google.storage.v2.ProjectTeam project_team = 7; + */ + public Builder setProjectTeam(com.google.storage.v2.ProjectTeam.Builder builderForValue) { + if (projectTeamBuilder_ == null) { + projectTeam_ = builderForValue.build(); + onChanged(); + } else { + projectTeamBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The project team associated with the entity, if any.
+     * 
+ * + * .google.storage.v2.ProjectTeam project_team = 7; + */ + public Builder mergeProjectTeam(com.google.storage.v2.ProjectTeam value) { + if (projectTeamBuilder_ == null) { + if (projectTeam_ != null) { + projectTeam_ = + com.google.storage.v2.ProjectTeam.newBuilder(projectTeam_) + .mergeFrom(value) + .buildPartial(); + } else { + projectTeam_ = value; + } + onChanged(); + } else { + projectTeamBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The project team associated with the entity, if any.
+     * 
+ * + * .google.storage.v2.ProjectTeam project_team = 7; + */ + public Builder clearProjectTeam() { + if (projectTeamBuilder_ == null) { + projectTeam_ = null; + onChanged(); + } else { + projectTeam_ = null; + projectTeamBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The project team associated with the entity, if any.
+     * 
+ * + * .google.storage.v2.ProjectTeam project_team = 7; + */ + public com.google.storage.v2.ProjectTeam.Builder getProjectTeamBuilder() { + + onChanged(); + return getProjectTeamFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The project team associated with the entity, if any.
+     * 
+ * + * .google.storage.v2.ProjectTeam project_team = 7; + */ + public com.google.storage.v2.ProjectTeamOrBuilder getProjectTeamOrBuilder() { + if (projectTeamBuilder_ != null) { + return projectTeamBuilder_.getMessageOrBuilder(); + } else { + return projectTeam_ == null + ? com.google.storage.v2.ProjectTeam.getDefaultInstance() + : projectTeam_; + } + } + /** + * + * + *
+     * The project team associated with the entity, if any.
+     * 
+ * + * .google.storage.v2.ProjectTeam project_team = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.ProjectTeam, + com.google.storage.v2.ProjectTeam.Builder, + com.google.storage.v2.ProjectTeamOrBuilder> + getProjectTeamFieldBuilder() { + if (projectTeamBuilder_ == null) { + projectTeamBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.ProjectTeam, + com.google.storage.v2.ProjectTeam.Builder, + com.google.storage.v2.ProjectTeamOrBuilder>( + getProjectTeam(), getParentForChildren(), isClean()); + projectTeam_ = null; + } + return projectTeamBuilder_; + } + + @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.BucketAccessControl) + } + + // @@protoc_insertion_point(class_scope:google.storage.v2.BucketAccessControl) + private static final com.google.storage.v2.BucketAccessControl DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.v2.BucketAccessControl(); + } + + public static com.google.storage.v2.BucketAccessControl getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BucketAccessControl parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BucketAccessControl(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.storage.v2.BucketAccessControl getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BucketAccessControlOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BucketAccessControlOrBuilder.java new file mode 100644 index 0000000000..073daa3bef --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BucketAccessControlOrBuilder.java @@ -0,0 +1,238 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +package com.google.storage.v2; + +public interface BucketAccessControlOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.BucketAccessControl) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The access permission for the entity.
+   * 
+ * + * string role = 1; + * + * @return The role. + */ + java.lang.String getRole(); + /** + * + * + *
+   * The access permission for the entity.
+   * 
+ * + * string role = 1; + * + * @return The bytes for role. + */ + com.google.protobuf.ByteString getRoleBytes(); + + /** + * + * + *
+   * The ID of the access-control entry.
+   * 
+ * + * string id = 2; + * + * @return The id. + */ + java.lang.String getId(); + /** + * + * + *
+   * The ID of the access-control entry.
+   * 
+ * + * string id = 2; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); + + /** + * + * + *
+   * The entity holding the permission, in one of the following forms:
+   * * `user-{userid}`
+   * * `user-{email}`
+   * * `group-{groupid}`
+   * * `group-{email}`
+   * * `domain-{domain}`
+   * * `project-{team-projectid}`
+   * * `allUsers`
+   * * `allAuthenticatedUsers`
+   * Examples:
+   * * The user `liz@example.com` would be `user-liz@example.com`.
+   * * The group `example@googlegroups.com` would be
+   * `group-example@googlegroups.com`
+   * * All members of the Google Apps for Business domain `example.com` would be
+   * `domain-example.com`
+   * 
+ * + * string entity = 3; + * + * @return The entity. + */ + java.lang.String getEntity(); + /** + * + * + *
+   * The entity holding the permission, in one of the following forms:
+   * * `user-{userid}`
+   * * `user-{email}`
+   * * `group-{groupid}`
+   * * `group-{email}`
+   * * `domain-{domain}`
+   * * `project-{team-projectid}`
+   * * `allUsers`
+   * * `allAuthenticatedUsers`
+   * Examples:
+   * * The user `liz@example.com` would be `user-liz@example.com`.
+   * * The group `example@googlegroups.com` would be
+   * `group-example@googlegroups.com`
+   * * All members of the Google Apps for Business domain `example.com` would be
+   * `domain-example.com`
+   * 
+ * + * string entity = 3; + * + * @return The bytes for entity. + */ + com.google.protobuf.ByteString getEntityBytes(); + + /** + * + * + *
+   * The ID for the entity, if any.
+   * 
+ * + * string entity_id = 4; + * + * @return The entityId. + */ + java.lang.String getEntityId(); + /** + * + * + *
+   * The ID for the entity, if any.
+   * 
+ * + * string entity_id = 4; + * + * @return The bytes for entityId. + */ + com.google.protobuf.ByteString getEntityIdBytes(); + + /** + * + * + *
+   * The email address associated with the entity, if any.
+   * 
+ * + * string email = 5; + * + * @return The email. + */ + java.lang.String getEmail(); + /** + * + * + *
+   * The email address associated with the entity, if any.
+   * 
+ * + * string email = 5; + * + * @return The bytes for email. + */ + com.google.protobuf.ByteString getEmailBytes(); + + /** + * + * + *
+   * The domain associated with the entity, if any.
+   * 
+ * + * string domain = 6; + * + * @return The domain. + */ + java.lang.String getDomain(); + /** + * + * + *
+   * The domain associated with the entity, if any.
+   * 
+ * + * string domain = 6; + * + * @return The bytes for domain. + */ + com.google.protobuf.ByteString getDomainBytes(); + + /** + * + * + *
+   * The project team associated with the entity, if any.
+   * 
+ * + * .google.storage.v2.ProjectTeam project_team = 7; + * + * @return Whether the projectTeam field is set. + */ + boolean hasProjectTeam(); + /** + * + * + *
+   * The project team associated with the entity, if any.
+   * 
+ * + * .google.storage.v2.ProjectTeam project_team = 7; + * + * @return The projectTeam. + */ + com.google.storage.v2.ProjectTeam getProjectTeam(); + /** + * + * + *
+   * The project team associated with the entity, if any.
+   * 
+ * + * .google.storage.v2.ProjectTeam project_team = 7; + */ + com.google.storage.v2.ProjectTeamOrBuilder getProjectTeamOrBuilder(); +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BucketOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BucketOrBuilder.java new file mode 100644 index 0000000000..5ca0553c49 --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BucketOrBuilder.java @@ -0,0 +1,1017 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +package com.google.storage.v2; + +public interface BucketOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.Bucket) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Immutable. The name of the bucket.
+   * Global buckets will be of the format `projects/{project}/buckets/{bucket}`.
+   * Other sorts of buckets in the future are not guaranteed to follow this
+   * pattern.
+   * For globally unique bucket names, a `_` may be substituted for the project
+   * ID.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Immutable. The name of the bucket.
+   * Global buckets will be of the format `projects/{project}/buckets/{bucket}`.
+   * Other sorts of buckets in the future are not guaranteed to follow this
+   * pattern.
+   * For globally unique bucket names, a `_` may be substituted for the project
+   * ID.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. The user-chosen part of the bucket name. The `{bucket}` portion of the
+   * `name` field. For globally unique buckets, this is equal to the "bucket
+   * name" of other Cloud Storage APIs. Example: "pub".
+   * 
+ * + * string bucket_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bucketId. + */ + java.lang.String getBucketId(); + /** + * + * + *
+   * Output only. The user-chosen part of the bucket name. The `{bucket}` portion of the
+   * `name` field. For globally unique buckets, this is equal to the "bucket
+   * name" of other Cloud Storage APIs. Example: "pub".
+   * 
+ * + * string bucket_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for bucketId. + */ + com.google.protobuf.ByteString getBucketIdBytes(); + + /** + * + * + *
+   * Immutable. The project which owns this bucket.
+   * Format: projects/{project_number}
+   * Example: `projects/123456`.
+   * 
+ * + * + * string project = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The project. + */ + java.lang.String getProject(); + /** + * + * + *
+   * Immutable. The project which owns this bucket.
+   * Format: projects/{project_number}
+   * Example: `projects/123456`.
+   * 
+ * + * + * string project = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for project. + */ + com.google.protobuf.ByteString getProjectBytes(); + + /** + * + * + *
+   * Output only. The metadata generation of this bucket.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * int64 metageneration = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The metageneration. + */ + long getMetageneration(); + + /** + * + * + *
+   * Immutable. The location of the bucket. Object data for objects in the bucket resides
+   * in physical storage within this region.  Defaults to `US`. See the
+   * [https://developers.google.com/storage/docs/concepts-techniques#specifyinglocations"][developer's
+   * guide] for the authoritative list. Attempting to update this field after
+   * the bucket is created will result in an error.
+   * 
+ * + * string location = 5 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The location. + */ + java.lang.String getLocation(); + /** + * + * + *
+   * Immutable. The location of the bucket. Object data for objects in the bucket resides
+   * in physical storage within this region.  Defaults to `US`. See the
+   * [https://developers.google.com/storage/docs/concepts-techniques#specifyinglocations"][developer's
+   * guide] for the authoritative list. Attempting to update this field after
+   * the bucket is created will result in an error.
+   * 
+ * + * string location = 5 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for location. + */ + com.google.protobuf.ByteString getLocationBytes(); + + /** + * + * + *
+   * Output only. The location type of the bucket (region, dual-region, multi-region, etc).
+   * 
+ * + * string location_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The locationType. + */ + java.lang.String getLocationType(); + /** + * + * + *
+   * Output only. The location type of the bucket (region, dual-region, multi-region, etc).
+   * 
+ * + * string location_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for locationType. + */ + com.google.protobuf.ByteString getLocationTypeBytes(); + + /** + * + * + *
+   * The bucket's default storage class, used whenever no storageClass is
+   * specified for a newly-created object. This defines how objects in the
+   * bucket are stored and determines the SLA and the cost of storage.
+   * If this value is not specified when the bucket is created, it will default
+   * to `STANDARD`. For more information, see
+   * https://developers.google.com/storage/docs/storage-classes.
+   * 
+ * + * string storage_class = 7; + * + * @return The storageClass. + */ + java.lang.String getStorageClass(); + /** + * + * + *
+   * The bucket's default storage class, used whenever no storageClass is
+   * specified for a newly-created object. This defines how objects in the
+   * bucket are stored and determines the SLA and the cost of storage.
+   * If this value is not specified when the bucket is created, it will default
+   * to `STANDARD`. For more information, see
+   * https://developers.google.com/storage/docs/storage-classes.
+   * 
+ * + * string storage_class = 7; + * + * @return The bytes for storageClass. + */ + com.google.protobuf.ByteString getStorageClassBytes(); + + /** + * + * + *
+   * Access controls on the bucket.
+   * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+   * requests to set, read, or modify acl is an error.
+   * 
+ * + * repeated .google.storage.v2.BucketAccessControl acl = 8; + */ + java.util.List getAclList(); + /** + * + * + *
+   * Access controls on the bucket.
+   * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+   * requests to set, read, or modify acl is an error.
+   * 
+ * + * repeated .google.storage.v2.BucketAccessControl acl = 8; + */ + com.google.storage.v2.BucketAccessControl getAcl(int index); + /** + * + * + *
+   * Access controls on the bucket.
+   * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+   * requests to set, read, or modify acl is an error.
+   * 
+ * + * repeated .google.storage.v2.BucketAccessControl acl = 8; + */ + int getAclCount(); + /** + * + * + *
+   * Access controls on the bucket.
+   * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+   * requests to set, read, or modify acl is an error.
+   * 
+ * + * repeated .google.storage.v2.BucketAccessControl acl = 8; + */ + java.util.List + getAclOrBuilderList(); + /** + * + * + *
+   * Access controls on the bucket.
+   * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+   * requests to set, read, or modify acl is an error.
+   * 
+ * + * repeated .google.storage.v2.BucketAccessControl acl = 8; + */ + com.google.storage.v2.BucketAccessControlOrBuilder getAclOrBuilder(int index); + + /** + * + * + *
+   * Default access controls to apply to new objects when no ACL is provided.
+   * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+   * requests to set, read, or modify acl is an error.
+   * 
+ * + * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; + */ + java.util.List getDefaultObjectAclList(); + /** + * + * + *
+   * Default access controls to apply to new objects when no ACL is provided.
+   * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+   * requests to set, read, or modify acl is an error.
+   * 
+ * + * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; + */ + com.google.storage.v2.ObjectAccessControl getDefaultObjectAcl(int index); + /** + * + * + *
+   * Default access controls to apply to new objects when no ACL is provided.
+   * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+   * requests to set, read, or modify acl is an error.
+   * 
+ * + * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; + */ + int getDefaultObjectAclCount(); + /** + * + * + *
+   * Default access controls to apply to new objects when no ACL is provided.
+   * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+   * requests to set, read, or modify acl is an error.
+   * 
+ * + * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; + */ + java.util.List + getDefaultObjectAclOrBuilderList(); + /** + * + * + *
+   * Default access controls to apply to new objects when no ACL is provided.
+   * If iamConfig.uniformBucketLevelAccess is enabled on this bucket,
+   * requests to set, read, or modify acl is an error.
+   * 
+ * + * repeated .google.storage.v2.ObjectAccessControl default_object_acl = 9; + */ + com.google.storage.v2.ObjectAccessControlOrBuilder getDefaultObjectAclOrBuilder(int index); + + /** + * + * + *
+   * The bucket's lifecycle config. See
+   * [https://developers.google.com/storage/docs/lifecycle]Lifecycle Management]
+   * for more information.
+   * 
+ * + * .google.storage.v2.Bucket.Lifecycle lifecycle = 10; + * + * @return Whether the lifecycle field is set. + */ + boolean hasLifecycle(); + /** + * + * + *
+   * The bucket's lifecycle config. See
+   * [https://developers.google.com/storage/docs/lifecycle]Lifecycle Management]
+   * for more information.
+   * 
+ * + * .google.storage.v2.Bucket.Lifecycle lifecycle = 10; + * + * @return The lifecycle. + */ + com.google.storage.v2.Bucket.Lifecycle getLifecycle(); + /** + * + * + *
+   * The bucket's lifecycle config. See
+   * [https://developers.google.com/storage/docs/lifecycle]Lifecycle Management]
+   * for more information.
+   * 
+ * + * .google.storage.v2.Bucket.Lifecycle lifecycle = 10; + */ + com.google.storage.v2.Bucket.LifecycleOrBuilder getLifecycleOrBuilder(); + + /** + * + * + *
+   * Output only. The creation time of the bucket in
+   * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The creation time of the bucket in
+   * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The creation time of the bucket in
+   * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * .google.protobuf.Timestamp create_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
+   * (CORS) config.
+   * 
+ * + * repeated .google.storage.v2.Bucket.Cors cors = 12; + */ + java.util.List getCorsList(); + /** + * + * + *
+   * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
+   * (CORS) config.
+   * 
+ * + * repeated .google.storage.v2.Bucket.Cors cors = 12; + */ + com.google.storage.v2.Bucket.Cors getCors(int index); + /** + * + * + *
+   * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
+   * (CORS) config.
+   * 
+ * + * repeated .google.storage.v2.Bucket.Cors cors = 12; + */ + int getCorsCount(); + /** + * + * + *
+   * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
+   * (CORS) config.
+   * 
+ * + * repeated .google.storage.v2.Bucket.Cors cors = 12; + */ + java.util.List getCorsOrBuilderList(); + /** + * + * + *
+   * The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing]
+   * (CORS) config.
+   * 
+ * + * repeated .google.storage.v2.Bucket.Cors cors = 12; + */ + com.google.storage.v2.Bucket.CorsOrBuilder getCorsOrBuilder(int index); + + /** + * + * + *
+   * Output only. The modification time of the bucket.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The modification time of the bucket.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The modification time of the bucket.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * .google.protobuf.Timestamp update_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * The default value for event-based hold on newly created objects in this
+   * bucket.  Event-based hold is a way to retain objects indefinitely until an
+   * event occurs, signified by the
+   * hold's release. After being released, such objects will be subject to
+   * bucket-level retention (if any).  One sample use case of this flag is for
+   * banks to hold loan documents for at least 3 years after loan is paid in
+   * full. Here, bucket-level retention is 3 years and the event is loan being
+   * paid in full. In this example, these objects will be held intact for any
+   * number of years until the event has occurred (event-based hold on the
+   * object is released) and then 3 more years after that. That means retention
+   * duration of the objects begins from the moment event-based hold
+   * transitioned from true to false.  Objects under event-based hold cannot be
+   * deleted, overwritten or archived until the hold is removed.
+   * 
+ * + * bool default_event_based_hold = 14; + * + * @return The defaultEventBasedHold. + */ + boolean getDefaultEventBasedHold(); + + /** + * + * + *
+   * User-provided labels, in key/value pairs.
+   * 
+ * + * map<string, string> labels = 15; + */ + int getLabelsCount(); + /** + * + * + *
+   * User-provided labels, in key/value pairs.
+   * 
+ * + * map<string, string> labels = 15; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * User-provided labels, in key/value pairs.
+   * 
+ * + * map<string, string> labels = 15; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * User-provided labels, in key/value pairs.
+   * 
+ * + * map<string, string> labels = 15; + */ + java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * User-provided labels, in key/value pairs.
+   * 
+ * + * map<string, string> labels = 15; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * The bucket's website config, controlling how the service behaves
+   * when accessing bucket contents as a web site. See the
+   * [https://cloud.google.com/storage/docs/static-website][Static Website
+   * Examples] for more information.
+   * 
+ * + * .google.storage.v2.Bucket.Website website = 16; + * + * @return Whether the website field is set. + */ + boolean hasWebsite(); + /** + * + * + *
+   * The bucket's website config, controlling how the service behaves
+   * when accessing bucket contents as a web site. See the
+   * [https://cloud.google.com/storage/docs/static-website][Static Website
+   * Examples] for more information.
+   * 
+ * + * .google.storage.v2.Bucket.Website website = 16; + * + * @return The website. + */ + com.google.storage.v2.Bucket.Website getWebsite(); + /** + * + * + *
+   * The bucket's website config, controlling how the service behaves
+   * when accessing bucket contents as a web site. See the
+   * [https://cloud.google.com/storage/docs/static-website][Static Website
+   * Examples] for more information.
+   * 
+ * + * .google.storage.v2.Bucket.Website website = 16; + */ + com.google.storage.v2.Bucket.WebsiteOrBuilder getWebsiteOrBuilder(); + + /** + * + * + *
+   * The bucket's versioning config.
+   * 
+ * + * .google.storage.v2.Bucket.Versioning versioning = 17; + * + * @return Whether the versioning field is set. + */ + boolean hasVersioning(); + /** + * + * + *
+   * The bucket's versioning config.
+   * 
+ * + * .google.storage.v2.Bucket.Versioning versioning = 17; + * + * @return The versioning. + */ + com.google.storage.v2.Bucket.Versioning getVersioning(); + /** + * + * + *
+   * The bucket's versioning config.
+   * 
+ * + * .google.storage.v2.Bucket.Versioning versioning = 17; + */ + com.google.storage.v2.Bucket.VersioningOrBuilder getVersioningOrBuilder(); + + /** + * + * + *
+   * The bucket's logging config, which defines the destination bucket
+   * and name prefix (if any) for the current bucket's logs.
+   * 
+ * + * .google.storage.v2.Bucket.Logging logging = 18; + * + * @return Whether the logging field is set. + */ + boolean hasLogging(); + /** + * + * + *
+   * The bucket's logging config, which defines the destination bucket
+   * and name prefix (if any) for the current bucket's logs.
+   * 
+ * + * .google.storage.v2.Bucket.Logging logging = 18; + * + * @return The logging. + */ + com.google.storage.v2.Bucket.Logging getLogging(); + /** + * + * + *
+   * The bucket's logging config, which defines the destination bucket
+   * and name prefix (if any) for the current bucket's logs.
+   * 
+ * + * .google.storage.v2.Bucket.Logging logging = 18; + */ + com.google.storage.v2.Bucket.LoggingOrBuilder getLoggingOrBuilder(); + + /** + * + * + *
+   * Output only. The owner of the bucket. This is always the project team's owner group.
+   * 
+ * + * .google.storage.v2.Owner owner = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the owner field is set. + */ + boolean hasOwner(); + /** + * + * + *
+   * Output only. The owner of the bucket. This is always the project team's owner group.
+   * 
+ * + * .google.storage.v2.Owner owner = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The owner. + */ + com.google.storage.v2.Owner getOwner(); + /** + * + * + *
+   * Output only. The owner of the bucket. This is always the project team's owner group.
+   * 
+ * + * .google.storage.v2.Owner owner = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + com.google.storage.v2.OwnerOrBuilder getOwnerOrBuilder(); + + /** + * + * + *
+   * Encryption config for a bucket.
+   * 
+ * + * .google.storage.v2.Bucket.Encryption encryption = 20; + * + * @return Whether the encryption field is set. + */ + boolean hasEncryption(); + /** + * + * + *
+   * Encryption config for a bucket.
+   * 
+ * + * .google.storage.v2.Bucket.Encryption encryption = 20; + * + * @return The encryption. + */ + com.google.storage.v2.Bucket.Encryption getEncryption(); + /** + * + * + *
+   * Encryption config for a bucket.
+   * 
+ * + * .google.storage.v2.Bucket.Encryption encryption = 20; + */ + com.google.storage.v2.Bucket.EncryptionOrBuilder getEncryptionOrBuilder(); + + /** + * + * + *
+   * The bucket's billing config.
+   * 
+ * + * .google.storage.v2.Bucket.Billing billing = 21; + * + * @return Whether the billing field is set. + */ + boolean hasBilling(); + /** + * + * + *
+   * The bucket's billing config.
+   * 
+ * + * .google.storage.v2.Bucket.Billing billing = 21; + * + * @return The billing. + */ + com.google.storage.v2.Bucket.Billing getBilling(); + /** + * + * + *
+   * The bucket's billing config.
+   * 
+ * + * .google.storage.v2.Bucket.Billing billing = 21; + */ + com.google.storage.v2.Bucket.BillingOrBuilder getBillingOrBuilder(); + + /** + * + * + *
+   * The bucket's retention policy. The retention policy enforces a minimum
+   * retention time for all objects contained in the bucket, based on their
+   * creation time. Any attempt to overwrite or delete objects younger than the
+   * retention period will result in a PERMISSION_DENIED error.  An unlocked
+   * retention policy can be modified or removed from the bucket via a
+   * storage.buckets.update operation. A locked retention policy cannot be
+   * removed or shortened in duration for the lifetime of the bucket.
+   * Attempting to remove or decrease period of a locked retention policy will
+   * result in a PERMISSION_DENIED error.
+   * 
+ * + * .google.storage.v2.Bucket.RetentionPolicy retention_policy = 22; + * + * @return Whether the retentionPolicy field is set. + */ + boolean hasRetentionPolicy(); + /** + * + * + *
+   * The bucket's retention policy. The retention policy enforces a minimum
+   * retention time for all objects contained in the bucket, based on their
+   * creation time. Any attempt to overwrite or delete objects younger than the
+   * retention period will result in a PERMISSION_DENIED error.  An unlocked
+   * retention policy can be modified or removed from the bucket via a
+   * storage.buckets.update operation. A locked retention policy cannot be
+   * removed or shortened in duration for the lifetime of the bucket.
+   * Attempting to remove or decrease period of a locked retention policy will
+   * result in a PERMISSION_DENIED error.
+   * 
+ * + * .google.storage.v2.Bucket.RetentionPolicy retention_policy = 22; + * + * @return The retentionPolicy. + */ + com.google.storage.v2.Bucket.RetentionPolicy getRetentionPolicy(); + /** + * + * + *
+   * The bucket's retention policy. The retention policy enforces a minimum
+   * retention time for all objects contained in the bucket, based on their
+   * creation time. Any attempt to overwrite or delete objects younger than the
+   * retention period will result in a PERMISSION_DENIED error.  An unlocked
+   * retention policy can be modified or removed from the bucket via a
+   * storage.buckets.update operation. A locked retention policy cannot be
+   * removed or shortened in duration for the lifetime of the bucket.
+   * Attempting to remove or decrease period of a locked retention policy will
+   * result in a PERMISSION_DENIED error.
+   * 
+ * + * .google.storage.v2.Bucket.RetentionPolicy retention_policy = 22; + */ + com.google.storage.v2.Bucket.RetentionPolicyOrBuilder getRetentionPolicyOrBuilder(); + + /** + * + * + *
+   * The bucket's IAM config.
+   * 
+ * + * .google.storage.v2.Bucket.IamConfig iam_config = 23; + * + * @return Whether the iamConfig field is set. + */ + boolean hasIamConfig(); + /** + * + * + *
+   * The bucket's IAM config.
+   * 
+ * + * .google.storage.v2.Bucket.IamConfig iam_config = 23; + * + * @return The iamConfig. + */ + com.google.storage.v2.Bucket.IamConfig getIamConfig(); + /** + * + * + *
+   * The bucket's IAM config.
+   * 
+ * + * .google.storage.v2.Bucket.IamConfig iam_config = 23; + */ + com.google.storage.v2.Bucket.IamConfigOrBuilder getIamConfigOrBuilder(); + + /** + * + * + *
+   * Immutable. The zone or zones from which the bucket is intended to use zonal quota.
+   * Requests for data from outside the specified affinities are still allowed
+   * but won't be able to use zonal quota. The values are case-insensitive.
+   * Attempting to update this field after bucket is created will result in an
+   * error.
+   * 
+ * + * repeated string zone_affinity = 24 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return A list containing the zoneAffinity. + */ + java.util.List getZoneAffinityList(); + /** + * + * + *
+   * Immutable. The zone or zones from which the bucket is intended to use zonal quota.
+   * Requests for data from outside the specified affinities are still allowed
+   * but won't be able to use zonal quota. The values are case-insensitive.
+   * Attempting to update this field after bucket is created will result in an
+   * error.
+   * 
+ * + * repeated string zone_affinity = 24 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The count of zoneAffinity. + */ + int getZoneAffinityCount(); + /** + * + * + *
+   * Immutable. The zone or zones from which the bucket is intended to use zonal quota.
+   * Requests for data from outside the specified affinities are still allowed
+   * but won't be able to use zonal quota. The values are case-insensitive.
+   * Attempting to update this field after bucket is created will result in an
+   * error.
+   * 
+ * + * repeated string zone_affinity = 24 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param index The index of the element to return. + * @return The zoneAffinity at the given index. + */ + java.lang.String getZoneAffinity(int index); + /** + * + * + *
+   * Immutable. The zone or zones from which the bucket is intended to use zonal quota.
+   * Requests for data from outside the specified affinities are still allowed
+   * but won't be able to use zonal quota. The values are case-insensitive.
+   * Attempting to update this field after bucket is created will result in an
+   * error.
+   * 
+ * + * repeated string zone_affinity = 24 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param index The index of the value to return. + * @return The bytes of the zoneAffinity at the given index. + */ + com.google.protobuf.ByteString getZoneAffinityBytes(int index); + + /** + * + * + *
+   * Reserved for future use.
+   * 
+ * + * bool satisfies_pzs = 25; + * + * @return The satisfiesPzs. + */ + boolean getSatisfiesPzs(); +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ChecksummedData.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ChecksummedData.java new file mode 100644 index 0000000000..e28d8e7a85 --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ChecksummedData.java @@ -0,0 +1,685 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +package com.google.storage.v2; + +/** + * + * + *
+ * Message used to convey content being read or written, along with an optional
+ * checksum.
+ * 
+ * + * Protobuf type {@code google.storage.v2.ChecksummedData} + */ +public final class ChecksummedData extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.v2.ChecksummedData) + ChecksummedDataOrBuilder { + private static final long serialVersionUID = 0L; + // Use ChecksummedData.newBuilder() to construct. + private ChecksummedData(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ChecksummedData() { + content_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ChecksummedData(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ChecksummedData( + 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: + { + content_ = input.readBytes(); + break; + } + case 21: + { + bitField0_ |= 0x00000001; + crc32C_ = input.readFixed32(); + 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_ChecksummedData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ChecksummedData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.ChecksummedData.class, + com.google.storage.v2.ChecksummedData.Builder.class); + } + + private int bitField0_; + public static final int CONTENT_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString content_; + /** + * + * + *
+   * The data.
+   * 
+ * + * bytes content = 1; + * + * @return The content. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContent() { + return content_; + } + + public static final int CRC32C_FIELD_NUMBER = 2; + private int crc32C_; + /** + * + * + *
+   * If set, the CRC32C digest of the content field.
+   * 
+ * + * fixed32 crc32c = 2; + * + * @return Whether the crc32c field is set. + */ + @java.lang.Override + public boolean hasCrc32C() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * If set, the CRC32C digest of the content field.
+   * 
+ * + * fixed32 crc32c = 2; + * + * @return The crc32c. + */ + @java.lang.Override + public int getCrc32C() { + return crc32C_; + } + + 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 (!content_.isEmpty()) { + output.writeBytes(1, content_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeFixed32(2, crc32C_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!content_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(1, content_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeFixed32Size(2, crc32C_); + } + 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.ChecksummedData)) { + return super.equals(obj); + } + com.google.storage.v2.ChecksummedData other = (com.google.storage.v2.ChecksummedData) obj; + + if (!getContent().equals(other.getContent())) return false; + if (hasCrc32C() != other.hasCrc32C()) return false; + if (hasCrc32C()) { + if (getCrc32C() != other.getCrc32C()) 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) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + if (hasCrc32C()) { + hash = (37 * hash) + CRC32C_FIELD_NUMBER; + hash = (53 * hash) + getCrc32C(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.v2.ChecksummedData parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.ChecksummedData 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.ChecksummedData parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.ChecksummedData 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.ChecksummedData parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.ChecksummedData parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.ChecksummedData parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.ChecksummedData 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.ChecksummedData parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.v2.ChecksummedData 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.ChecksummedData parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.ChecksummedData 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.ChecksummedData 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; + } + /** + * + * + *
+   * Message used to convey content being read or written, along with an optional
+   * checksum.
+   * 
+ * + * Protobuf type {@code google.storage.v2.ChecksummedData} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.ChecksummedData) + com.google.storage.v2.ChecksummedDataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ChecksummedData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ChecksummedData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.ChecksummedData.class, + com.google.storage.v2.ChecksummedData.Builder.class); + } + + // Construct using com.google.storage.v2.ChecksummedData.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + content_ = com.google.protobuf.ByteString.EMPTY; + + crc32C_ = 0; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ChecksummedData_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.ChecksummedData getDefaultInstanceForType() { + return com.google.storage.v2.ChecksummedData.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.ChecksummedData build() { + com.google.storage.v2.ChecksummedData result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.ChecksummedData buildPartial() { + com.google.storage.v2.ChecksummedData result = + new com.google.storage.v2.ChecksummedData(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.content_ = content_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.crc32C_ = crc32C_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.storage.v2.ChecksummedData) { + return mergeFrom((com.google.storage.v2.ChecksummedData) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.ChecksummedData other) { + if (other == com.google.storage.v2.ChecksummedData.getDefaultInstance()) return this; + if (other.getContent() != com.google.protobuf.ByteString.EMPTY) { + setContent(other.getContent()); + } + if (other.hasCrc32C()) { + setCrc32C(other.getCrc32C()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.storage.v2.ChecksummedData parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.storage.v2.ChecksummedData) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.ByteString content_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+     * The data.
+     * 
+ * + * bytes content = 1; + * + * @return The content. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContent() { + return content_; + } + /** + * + * + *
+     * The data.
+     * 
+ * + * bytes content = 1; + * + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + content_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The data.
+     * 
+ * + * bytes content = 1; + * + * @return This builder for chaining. + */ + public Builder clearContent() { + + content_ = getDefaultInstance().getContent(); + onChanged(); + return this; + } + + private int crc32C_; + /** + * + * + *
+     * If set, the CRC32C digest of the content field.
+     * 
+ * + * fixed32 crc32c = 2; + * + * @return Whether the crc32c field is set. + */ + @java.lang.Override + public boolean hasCrc32C() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * If set, the CRC32C digest of the content field.
+     * 
+ * + * fixed32 crc32c = 2; + * + * @return The crc32c. + */ + @java.lang.Override + public int getCrc32C() { + return crc32C_; + } + /** + * + * + *
+     * If set, the CRC32C digest of the content field.
+     * 
+ * + * fixed32 crc32c = 2; + * + * @param value The crc32c to set. + * @return This builder for chaining. + */ + public Builder setCrc32C(int value) { + bitField0_ |= 0x00000001; + crc32C_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If set, the CRC32C digest of the content field.
+     * 
+ * + * fixed32 crc32c = 2; + * + * @return This builder for chaining. + */ + public Builder clearCrc32C() { + bitField0_ = (bitField0_ & ~0x00000001); + crc32C_ = 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.ChecksummedData) + } + + // @@protoc_insertion_point(class_scope:google.storage.v2.ChecksummedData) + private static final com.google.storage.v2.ChecksummedData DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.v2.ChecksummedData(); + } + + public static com.google.storage.v2.ChecksummedData getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ChecksummedData parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ChecksummedData(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.storage.v2.ChecksummedData getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ChecksummedDataOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ChecksummedDataOrBuilder.java new file mode 100644 index 0000000000..15bded53ed --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ChecksummedDataOrBuilder.java @@ -0,0 +1,63 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +package com.google.storage.v2; + +public interface ChecksummedDataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.ChecksummedData) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The data.
+   * 
+ * + * bytes content = 1; + * + * @return The content. + */ + com.google.protobuf.ByteString getContent(); + + /** + * + * + *
+   * If set, the CRC32C digest of the content field.
+   * 
+ * + * fixed32 crc32c = 2; + * + * @return Whether the crc32c field is set. + */ + boolean hasCrc32C(); + /** + * + * + *
+   * If set, the CRC32C digest of the content field.
+   * 
+ * + * fixed32 crc32c = 2; + * + * @return The crc32c. + */ + int getCrc32C(); +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CommonObjectRequestParams.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CommonObjectRequestParams.java new file mode 100644 index 0000000000..6d39781474 --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CommonObjectRequestParams.java @@ -0,0 +1,833 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +package com.google.storage.v2; + +/** + * + * + *
+ * Parameters that can be passed to any object request.
+ * 
+ * + * Protobuf type {@code google.storage.v2.CommonObjectRequestParams} + */ +public final class CommonObjectRequestParams extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.v2.CommonObjectRequestParams) + CommonObjectRequestParamsOrBuilder { + private static final long serialVersionUID = 0L; + // Use CommonObjectRequestParams.newBuilder() to construct. + private CommonObjectRequestParams(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CommonObjectRequestParams() { + encryptionAlgorithm_ = ""; + encryptionKeyBytes_ = com.google.protobuf.ByteString.EMPTY; + encryptionKeySha256Bytes_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CommonObjectRequestParams(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CommonObjectRequestParams( + 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(); + + encryptionAlgorithm_ = s; + break; + } + case 34: + { + encryptionKeyBytes_ = input.readBytes(); + break; + } + case 42: + { + encryptionKeySha256Bytes_ = input.readBytes(); + 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_CommonObjectRequestParams_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_CommonObjectRequestParams_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.CommonObjectRequestParams.class, + com.google.storage.v2.CommonObjectRequestParams.Builder.class); + } + + public static final int ENCRYPTION_ALGORITHM_FIELD_NUMBER = 1; + private volatile java.lang.Object encryptionAlgorithm_; + /** + * + * + *
+   * Encryption algorithm used with Customer-Supplied Encryption Keys feature.
+   * 
+ * + * string encryption_algorithm = 1; + * + * @return The encryptionAlgorithm. + */ + @java.lang.Override + public java.lang.String getEncryptionAlgorithm() { + java.lang.Object ref = encryptionAlgorithm_; + 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(); + encryptionAlgorithm_ = s; + return s; + } + } + /** + * + * + *
+   * Encryption algorithm used with Customer-Supplied Encryption Keys feature.
+   * 
+ * + * string encryption_algorithm = 1; + * + * @return The bytes for encryptionAlgorithm. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEncryptionAlgorithmBytes() { + java.lang.Object ref = encryptionAlgorithm_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + encryptionAlgorithm_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENCRYPTION_KEY_BYTES_FIELD_NUMBER = 4; + private com.google.protobuf.ByteString encryptionKeyBytes_; + /** + * + * + *
+   * Encryption key used with Customer-Supplied Encryption Keys feature.
+   * In raw bytes format (not base64-encoded).
+   * 
+ * + * bytes encryption_key_bytes = 4; + * + * @return The encryptionKeyBytes. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEncryptionKeyBytes() { + return encryptionKeyBytes_; + } + + public static final int ENCRYPTION_KEY_SHA256_BYTES_FIELD_NUMBER = 5; + private com.google.protobuf.ByteString encryptionKeySha256Bytes_; + /** + * + * + *
+   * SHA256 hash of encryption key used with Customer-Supplied Encryption Keys
+   * feature.
+   * 
+ * + * bytes encryption_key_sha256_bytes = 5; + * + * @return The encryptionKeySha256Bytes. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEncryptionKeySha256Bytes() { + return encryptionKeySha256Bytes_; + } + + 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 (!getEncryptionAlgorithmBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, encryptionAlgorithm_); + } + if (!encryptionKeyBytes_.isEmpty()) { + output.writeBytes(4, encryptionKeyBytes_); + } + if (!encryptionKeySha256Bytes_.isEmpty()) { + output.writeBytes(5, encryptionKeySha256Bytes_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getEncryptionAlgorithmBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, encryptionAlgorithm_); + } + if (!encryptionKeyBytes_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(4, encryptionKeyBytes_); + } + if (!encryptionKeySha256Bytes_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(5, encryptionKeySha256Bytes_); + } + 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.CommonObjectRequestParams)) { + return super.equals(obj); + } + com.google.storage.v2.CommonObjectRequestParams other = + (com.google.storage.v2.CommonObjectRequestParams) obj; + + if (!getEncryptionAlgorithm().equals(other.getEncryptionAlgorithm())) return false; + if (!getEncryptionKeyBytes().equals(other.getEncryptionKeyBytes())) return false; + if (!getEncryptionKeySha256Bytes().equals(other.getEncryptionKeySha256Bytes())) 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) + ENCRYPTION_ALGORITHM_FIELD_NUMBER; + hash = (53 * hash) + getEncryptionAlgorithm().hashCode(); + hash = (37 * hash) + ENCRYPTION_KEY_BYTES_FIELD_NUMBER; + hash = (53 * hash) + getEncryptionKeyBytes().hashCode(); + hash = (37 * hash) + ENCRYPTION_KEY_SHA256_BYTES_FIELD_NUMBER; + hash = (53 * hash) + getEncryptionKeySha256Bytes().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.v2.CommonObjectRequestParams parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.CommonObjectRequestParams 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.CommonObjectRequestParams parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.CommonObjectRequestParams 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.CommonObjectRequestParams parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.CommonObjectRequestParams parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.CommonObjectRequestParams parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.CommonObjectRequestParams 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.CommonObjectRequestParams parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.v2.CommonObjectRequestParams 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.CommonObjectRequestParams parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.CommonObjectRequestParams 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.CommonObjectRequestParams 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; + } + /** + * + * + *
+   * Parameters that can be passed to any object request.
+   * 
+ * + * Protobuf type {@code google.storage.v2.CommonObjectRequestParams} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.CommonObjectRequestParams) + com.google.storage.v2.CommonObjectRequestParamsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_CommonObjectRequestParams_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_CommonObjectRequestParams_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.CommonObjectRequestParams.class, + com.google.storage.v2.CommonObjectRequestParams.Builder.class); + } + + // Construct using com.google.storage.v2.CommonObjectRequestParams.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + encryptionAlgorithm_ = ""; + + encryptionKeyBytes_ = com.google.protobuf.ByteString.EMPTY; + + encryptionKeySha256Bytes_ = com.google.protobuf.ByteString.EMPTY; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_CommonObjectRequestParams_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.CommonObjectRequestParams getDefaultInstanceForType() { + return com.google.storage.v2.CommonObjectRequestParams.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.CommonObjectRequestParams build() { + com.google.storage.v2.CommonObjectRequestParams result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.CommonObjectRequestParams buildPartial() { + com.google.storage.v2.CommonObjectRequestParams result = + new com.google.storage.v2.CommonObjectRequestParams(this); + result.encryptionAlgorithm_ = encryptionAlgorithm_; + result.encryptionKeyBytes_ = encryptionKeyBytes_; + result.encryptionKeySha256Bytes_ = encryptionKeySha256Bytes_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.storage.v2.CommonObjectRequestParams) { + return mergeFrom((com.google.storage.v2.CommonObjectRequestParams) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.CommonObjectRequestParams other) { + if (other == com.google.storage.v2.CommonObjectRequestParams.getDefaultInstance()) + return this; + if (!other.getEncryptionAlgorithm().isEmpty()) { + encryptionAlgorithm_ = other.encryptionAlgorithm_; + onChanged(); + } + if (other.getEncryptionKeyBytes() != com.google.protobuf.ByteString.EMPTY) { + setEncryptionKeyBytes(other.getEncryptionKeyBytes()); + } + if (other.getEncryptionKeySha256Bytes() != com.google.protobuf.ByteString.EMPTY) { + setEncryptionKeySha256Bytes(other.getEncryptionKeySha256Bytes()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.storage.v2.CommonObjectRequestParams parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.storage.v2.CommonObjectRequestParams) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object encryptionAlgorithm_ = ""; + /** + * + * + *
+     * Encryption algorithm used with Customer-Supplied Encryption Keys feature.
+     * 
+ * + * string encryption_algorithm = 1; + * + * @return The encryptionAlgorithm. + */ + public java.lang.String getEncryptionAlgorithm() { + java.lang.Object ref = encryptionAlgorithm_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + encryptionAlgorithm_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Encryption algorithm used with Customer-Supplied Encryption Keys feature.
+     * 
+ * + * string encryption_algorithm = 1; + * + * @return The bytes for encryptionAlgorithm. + */ + public com.google.protobuf.ByteString getEncryptionAlgorithmBytes() { + java.lang.Object ref = encryptionAlgorithm_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + encryptionAlgorithm_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Encryption algorithm used with Customer-Supplied Encryption Keys feature.
+     * 
+ * + * string encryption_algorithm = 1; + * + * @param value The encryptionAlgorithm to set. + * @return This builder for chaining. + */ + public Builder setEncryptionAlgorithm(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + encryptionAlgorithm_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Encryption algorithm used with Customer-Supplied Encryption Keys feature.
+     * 
+ * + * string encryption_algorithm = 1; + * + * @return This builder for chaining. + */ + public Builder clearEncryptionAlgorithm() { + + encryptionAlgorithm_ = getDefaultInstance().getEncryptionAlgorithm(); + onChanged(); + return this; + } + /** + * + * + *
+     * Encryption algorithm used with Customer-Supplied Encryption Keys feature.
+     * 
+ * + * string encryption_algorithm = 1; + * + * @param value The bytes for encryptionAlgorithm to set. + * @return This builder for chaining. + */ + public Builder setEncryptionAlgorithmBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + encryptionAlgorithm_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString encryptionKeyBytes_ = + com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+     * Encryption key used with Customer-Supplied Encryption Keys feature.
+     * In raw bytes format (not base64-encoded).
+     * 
+ * + * bytes encryption_key_bytes = 4; + * + * @return The encryptionKeyBytes. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEncryptionKeyBytes() { + return encryptionKeyBytes_; + } + /** + * + * + *
+     * Encryption key used with Customer-Supplied Encryption Keys feature.
+     * In raw bytes format (not base64-encoded).
+     * 
+ * + * bytes encryption_key_bytes = 4; + * + * @param value The encryptionKeyBytes to set. + * @return This builder for chaining. + */ + public Builder setEncryptionKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + encryptionKeyBytes_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Encryption key used with Customer-Supplied Encryption Keys feature.
+     * In raw bytes format (not base64-encoded).
+     * 
+ * + * bytes encryption_key_bytes = 4; + * + * @return This builder for chaining. + */ + public Builder clearEncryptionKeyBytes() { + + encryptionKeyBytes_ = getDefaultInstance().getEncryptionKeyBytes(); + onChanged(); + return this; + } + + private com.google.protobuf.ByteString encryptionKeySha256Bytes_ = + com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+     * SHA256 hash of encryption key used with Customer-Supplied Encryption Keys
+     * feature.
+     * 
+ * + * bytes encryption_key_sha256_bytes = 5; + * + * @return The encryptionKeySha256Bytes. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEncryptionKeySha256Bytes() { + return encryptionKeySha256Bytes_; + } + /** + * + * + *
+     * SHA256 hash of encryption key used with Customer-Supplied Encryption Keys
+     * feature.
+     * 
+ * + * bytes encryption_key_sha256_bytes = 5; + * + * @param value The encryptionKeySha256Bytes to set. + * @return This builder for chaining. + */ + public Builder setEncryptionKeySha256Bytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + encryptionKeySha256Bytes_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * SHA256 hash of encryption key used with Customer-Supplied Encryption Keys
+     * feature.
+     * 
+ * + * bytes encryption_key_sha256_bytes = 5; + * + * @return This builder for chaining. + */ + public Builder clearEncryptionKeySha256Bytes() { + + encryptionKeySha256Bytes_ = getDefaultInstance().getEncryptionKeySha256Bytes(); + 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.CommonObjectRequestParams) + } + + // @@protoc_insertion_point(class_scope:google.storage.v2.CommonObjectRequestParams) + private static final com.google.storage.v2.CommonObjectRequestParams DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.v2.CommonObjectRequestParams(); + } + + public static com.google.storage.v2.CommonObjectRequestParams getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CommonObjectRequestParams parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CommonObjectRequestParams(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.storage.v2.CommonObjectRequestParams getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CommonObjectRequestParamsOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CommonObjectRequestParamsOrBuilder.java new file mode 100644 index 0000000000..753fbeaa98 --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CommonObjectRequestParamsOrBuilder.java @@ -0,0 +1,78 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +package com.google.storage.v2; + +public interface CommonObjectRequestParamsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.CommonObjectRequestParams) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Encryption algorithm used with Customer-Supplied Encryption Keys feature.
+   * 
+ * + * string encryption_algorithm = 1; + * + * @return The encryptionAlgorithm. + */ + java.lang.String getEncryptionAlgorithm(); + /** + * + * + *
+   * Encryption algorithm used with Customer-Supplied Encryption Keys feature.
+   * 
+ * + * string encryption_algorithm = 1; + * + * @return The bytes for encryptionAlgorithm. + */ + com.google.protobuf.ByteString getEncryptionAlgorithmBytes(); + + /** + * + * + *
+   * Encryption key used with Customer-Supplied Encryption Keys feature.
+   * In raw bytes format (not base64-encoded).
+   * 
+ * + * bytes encryption_key_bytes = 4; + * + * @return The encryptionKeyBytes. + */ + com.google.protobuf.ByteString getEncryptionKeyBytes(); + + /** + * + * + *
+   * SHA256 hash of encryption key used with Customer-Supplied Encryption Keys
+   * feature.
+   * 
+ * + * bytes encryption_key_sha256_bytes = 5; + * + * @return The encryptionKeySha256Bytes. + */ + com.google.protobuf.ByteString getEncryptionKeySha256Bytes(); +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CommonRequestParams.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CommonRequestParams.java new file mode 100644 index 0000000000..7fb71c024f --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CommonRequestParams.java @@ -0,0 +1,655 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +package com.google.storage.v2; + +/** + * + * + *
+ * Parameters that can be passed to any request.
+ * 
+ * + * Protobuf type {@code google.storage.v2.CommonRequestParams} + */ +public final class CommonRequestParams extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.v2.CommonRequestParams) + CommonRequestParamsOrBuilder { + private static final long serialVersionUID = 0L; + // Use CommonRequestParams.newBuilder() to construct. + private CommonRequestParams(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CommonRequestParams() { + userProject_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CommonRequestParams(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CommonRequestParams( + 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(); + + userProject_ = 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_CommonRequestParams_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_CommonRequestParams_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.CommonRequestParams.class, + com.google.storage.v2.CommonRequestParams.Builder.class); + } + + public static final int USER_PROJECT_FIELD_NUMBER = 1; + private volatile java.lang.Object userProject_; + /** + * + * + *
+   * Required. Required when using buckets with Requestor Pays feature enabled.
+   * Example: `projects/123456`.
+   * 
+ * + * + * string user_project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The userProject. + */ + @java.lang.Override + public java.lang.String getUserProject() { + java.lang.Object ref = userProject_; + 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(); + userProject_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Required when using buckets with Requestor Pays feature enabled.
+   * Example: `projects/123456`.
+   * 
+ * + * + * string user_project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for userProject. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUserProjectBytes() { + java.lang.Object ref = userProject_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userProject_ = 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 (!getUserProjectBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, userProject_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getUserProjectBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, userProject_); + } + 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.CommonRequestParams)) { + return super.equals(obj); + } + com.google.storage.v2.CommonRequestParams other = + (com.google.storage.v2.CommonRequestParams) obj; + + if (!getUserProject().equals(other.getUserProject())) 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) + USER_PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getUserProject().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.v2.CommonRequestParams parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.CommonRequestParams 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.CommonRequestParams parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.CommonRequestParams 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.CommonRequestParams parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.CommonRequestParams parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.CommonRequestParams parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.CommonRequestParams 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.CommonRequestParams parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.v2.CommonRequestParams 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.CommonRequestParams parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.CommonRequestParams 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.CommonRequestParams 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; + } + /** + * + * + *
+   * Parameters that can be passed to any request.
+   * 
+ * + * Protobuf type {@code google.storage.v2.CommonRequestParams} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.CommonRequestParams) + com.google.storage.v2.CommonRequestParamsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_CommonRequestParams_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_CommonRequestParams_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.CommonRequestParams.class, + com.google.storage.v2.CommonRequestParams.Builder.class); + } + + // Construct using com.google.storage.v2.CommonRequestParams.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + userProject_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_CommonRequestParams_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.CommonRequestParams getDefaultInstanceForType() { + return com.google.storage.v2.CommonRequestParams.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.CommonRequestParams build() { + com.google.storage.v2.CommonRequestParams result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.CommonRequestParams buildPartial() { + com.google.storage.v2.CommonRequestParams result = + new com.google.storage.v2.CommonRequestParams(this); + result.userProject_ = userProject_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.storage.v2.CommonRequestParams) { + return mergeFrom((com.google.storage.v2.CommonRequestParams) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.CommonRequestParams other) { + if (other == com.google.storage.v2.CommonRequestParams.getDefaultInstance()) return this; + if (!other.getUserProject().isEmpty()) { + userProject_ = other.userProject_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.storage.v2.CommonRequestParams parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.storage.v2.CommonRequestParams) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object userProject_ = ""; + /** + * + * + *
+     * Required. Required when using buckets with Requestor Pays feature enabled.
+     * Example: `projects/123456`.
+     * 
+ * + * + * string user_project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The userProject. + */ + public java.lang.String getUserProject() { + java.lang.Object ref = userProject_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + userProject_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Required when using buckets with Requestor Pays feature enabled.
+     * Example: `projects/123456`.
+     * 
+ * + * + * string user_project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for userProject. + */ + public com.google.protobuf.ByteString getUserProjectBytes() { + java.lang.Object ref = userProject_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userProject_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Required when using buckets with Requestor Pays feature enabled.
+     * Example: `projects/123456`.
+     * 
+ * + * + * string user_project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The userProject to set. + * @return This builder for chaining. + */ + public Builder setUserProject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + userProject_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Required when using buckets with Requestor Pays feature enabled.
+     * Example: `projects/123456`.
+     * 
+ * + * + * string user_project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearUserProject() { + + userProject_ = getDefaultInstance().getUserProject(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Required when using buckets with Requestor Pays feature enabled.
+     * Example: `projects/123456`.
+     * 
+ * + * + * string user_project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for userProject to set. + * @return This builder for chaining. + */ + public Builder setUserProjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + userProject_ = 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.CommonRequestParams) + } + + // @@protoc_insertion_point(class_scope:google.storage.v2.CommonRequestParams) + private static final com.google.storage.v2.CommonRequestParams DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.v2.CommonRequestParams(); + } + + public static com.google.storage.v2.CommonRequestParams getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CommonRequestParams parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CommonRequestParams(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.storage.v2.CommonRequestParams getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CommonRequestParamsOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CommonRequestParamsOrBuilder.java new file mode 100644 index 0000000000..54558051aa --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CommonRequestParamsOrBuilder.java @@ -0,0 +1,56 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +package com.google.storage.v2; + +public interface CommonRequestParamsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.CommonRequestParams) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Required when using buckets with Requestor Pays feature enabled.
+   * Example: `projects/123456`.
+   * 
+ * + * + * string user_project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The userProject. + */ + java.lang.String getUserProject(); + /** + * + * + *
+   * Required. Required when using buckets with Requestor Pays feature enabled.
+   * Example: `projects/123456`.
+   * 
+ * + * + * string user_project = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for userProject. + */ + com.google.protobuf.ByteString getUserProjectBytes(); +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ContentRange.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ContentRange.java new file mode 100644 index 0000000000..9d50a9dd6a --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ContentRange.java @@ -0,0 +1,721 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +package com.google.storage.v2; + +/** + * + * + *
+ * Specifies a requested range of bytes to download.
+ * 
+ * + * Protobuf type {@code google.storage.v2.ContentRange} + */ +public final class ContentRange extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.v2.ContentRange) + ContentRangeOrBuilder { + private static final long serialVersionUID = 0L; + // Use ContentRange.newBuilder() to construct. + private ContentRange(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ContentRange() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ContentRange(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ContentRange( + 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: + { + start_ = input.readInt64(); + break; + } + case 16: + { + end_ = input.readInt64(); + break; + } + case 24: + { + completeLength_ = 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_ContentRange_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ContentRange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.ContentRange.class, + com.google.storage.v2.ContentRange.Builder.class); + } + + public static final int START_FIELD_NUMBER = 1; + private long start_; + /** + * + * + *
+   * The starting offset of the object data.
+   * 
+ * + * int64 start = 1; + * + * @return The start. + */ + @java.lang.Override + public long getStart() { + return start_; + } + + public static final int END_FIELD_NUMBER = 2; + private long end_; + /** + * + * + *
+   * The ending offset of the object data.
+   * 
+ * + * int64 end = 2; + * + * @return The end. + */ + @java.lang.Override + public long getEnd() { + return end_; + } + + public static final int COMPLETE_LENGTH_FIELD_NUMBER = 3; + private long completeLength_; + /** + * + * + *
+   * The complete length of the object data.
+   * 
+ * + * int64 complete_length = 3; + * + * @return The completeLength. + */ + @java.lang.Override + public long getCompleteLength() { + return completeLength_; + } + + 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 (start_ != 0L) { + output.writeInt64(1, start_); + } + if (end_ != 0L) { + output.writeInt64(2, end_); + } + if (completeLength_ != 0L) { + output.writeInt64(3, completeLength_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (start_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, start_); + } + if (end_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, end_); + } + if (completeLength_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, completeLength_); + } + 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.ContentRange)) { + return super.equals(obj); + } + com.google.storage.v2.ContentRange other = (com.google.storage.v2.ContentRange) obj; + + if (getStart() != other.getStart()) return false; + if (getEnd() != other.getEnd()) return false; + if (getCompleteLength() != other.getCompleteLength()) 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) + START_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getStart()); + hash = (37 * hash) + END_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getEnd()); + hash = (37 * hash) + COMPLETE_LENGTH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getCompleteLength()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.v2.ContentRange parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.ContentRange 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.ContentRange parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.ContentRange 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.ContentRange parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.ContentRange parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.ContentRange parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.ContentRange 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.ContentRange parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.v2.ContentRange 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.ContentRange parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.ContentRange 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.ContentRange 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; + } + /** + * + * + *
+   * Specifies a requested range of bytes to download.
+   * 
+ * + * Protobuf type {@code google.storage.v2.ContentRange} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.ContentRange) + com.google.storage.v2.ContentRangeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ContentRange_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ContentRange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.ContentRange.class, + com.google.storage.v2.ContentRange.Builder.class); + } + + // Construct using com.google.storage.v2.ContentRange.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + start_ = 0L; + + end_ = 0L; + + completeLength_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ContentRange_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.ContentRange getDefaultInstanceForType() { + return com.google.storage.v2.ContentRange.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.ContentRange build() { + com.google.storage.v2.ContentRange result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.ContentRange buildPartial() { + com.google.storage.v2.ContentRange result = new com.google.storage.v2.ContentRange(this); + result.start_ = start_; + result.end_ = end_; + result.completeLength_ = completeLength_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.storage.v2.ContentRange) { + return mergeFrom((com.google.storage.v2.ContentRange) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.ContentRange other) { + if (other == com.google.storage.v2.ContentRange.getDefaultInstance()) return this; + if (other.getStart() != 0L) { + setStart(other.getStart()); + } + if (other.getEnd() != 0L) { + setEnd(other.getEnd()); + } + if (other.getCompleteLength() != 0L) { + setCompleteLength(other.getCompleteLength()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.storage.v2.ContentRange parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.storage.v2.ContentRange) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long start_; + /** + * + * + *
+     * The starting offset of the object data.
+     * 
+ * + * int64 start = 1; + * + * @return The start. + */ + @java.lang.Override + public long getStart() { + return start_; + } + /** + * + * + *
+     * The starting offset of the object data.
+     * 
+ * + * int64 start = 1; + * + * @param value The start to set. + * @return This builder for chaining. + */ + public Builder setStart(long value) { + + start_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The starting offset of the object data.
+     * 
+ * + * int64 start = 1; + * + * @return This builder for chaining. + */ + public Builder clearStart() { + + start_ = 0L; + onChanged(); + return this; + } + + private long end_; + /** + * + * + *
+     * The ending offset of the object data.
+     * 
+ * + * int64 end = 2; + * + * @return The end. + */ + @java.lang.Override + public long getEnd() { + return end_; + } + /** + * + * + *
+     * The ending offset of the object data.
+     * 
+ * + * int64 end = 2; + * + * @param value The end to set. + * @return This builder for chaining. + */ + public Builder setEnd(long value) { + + end_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The ending offset of the object data.
+     * 
+ * + * int64 end = 2; + * + * @return This builder for chaining. + */ + public Builder clearEnd() { + + end_ = 0L; + onChanged(); + return this; + } + + private long completeLength_; + /** + * + * + *
+     * The complete length of the object data.
+     * 
+ * + * int64 complete_length = 3; + * + * @return The completeLength. + */ + @java.lang.Override + public long getCompleteLength() { + return completeLength_; + } + /** + * + * + *
+     * The complete length of the object data.
+     * 
+ * + * int64 complete_length = 3; + * + * @param value The completeLength to set. + * @return This builder for chaining. + */ + public Builder setCompleteLength(long value) { + + completeLength_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The complete length of the object data.
+     * 
+ * + * int64 complete_length = 3; + * + * @return This builder for chaining. + */ + public Builder clearCompleteLength() { + + completeLength_ = 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.ContentRange) + } + + // @@protoc_insertion_point(class_scope:google.storage.v2.ContentRange) + private static final com.google.storage.v2.ContentRange DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.v2.ContentRange(); + } + + public static com.google.storage.v2.ContentRange getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ContentRange parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ContentRange(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.storage.v2.ContentRange getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ContentRangeOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ContentRangeOrBuilder.java new file mode 100644 index 0000000000..969abe6d3b --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ContentRangeOrBuilder.java @@ -0,0 +1,64 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +package com.google.storage.v2; + +public interface ContentRangeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.ContentRange) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The starting offset of the object data.
+   * 
+ * + * int64 start = 1; + * + * @return The start. + */ + long getStart(); + + /** + * + * + *
+   * The ending offset of the object data.
+   * 
+ * + * int64 end = 2; + * + * @return The end. + */ + long getEnd(); + + /** + * + * + *
+   * The complete length of the object data.
+   * 
+ * + * int64 complete_length = 3; + * + * @return The completeLength. + */ + long getCompleteLength(); +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/Object.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/Object.java new file mode 100644 index 0000000000..368eaf5101 --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/Object.java @@ -0,0 +1,7437 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +package com.google.storage.v2; + +/** + * + * + *
+ * An object.
+ * 
+ * + * Protobuf type {@code google.storage.v2.Object} + */ +public final class Object extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.v2.Object) + ObjectOrBuilder { + private static final long serialVersionUID = 0L; + // Use Object.newBuilder() to construct. + private Object(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Object() { + name_ = ""; + bucket_ = ""; + storageClass_ = ""; + contentEncoding_ = ""; + contentDisposition_ = ""; + cacheControl_ = ""; + acl_ = java.util.Collections.emptyList(); + contentLanguage_ = ""; + contentType_ = ""; + kmsKey_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Object(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Object( + 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(); + + bucket_ = s; + break; + } + case 24: + { + generation_ = input.readInt64(); + break; + } + case 32: + { + metageneration_ = input.readInt64(); + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + storageClass_ = s; + break; + } + case 48: + { + size_ = input.readInt64(); + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + + contentEncoding_ = s; + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + + contentDisposition_ = s; + break; + } + case 74: + { + java.lang.String s = input.readStringRequireUtf8(); + + cacheControl_ = s; + break; + } + case 82: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + acl_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + acl_.add( + input.readMessage( + com.google.storage.v2.ObjectAccessControl.parser(), extensionRegistry)); + break; + } + case 90: + { + java.lang.String s = input.readStringRequireUtf8(); + + contentLanguage_ = s; + break; + } + case 98: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (deleteTime_ != null) { + subBuilder = deleteTime_.toBuilder(); + } + deleteTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(deleteTime_); + deleteTime_ = subBuilder.buildPartial(); + } + + break; + } + case 106: + { + java.lang.String s = input.readStringRequireUtf8(); + + contentType_ = s; + break; + } + case 114: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 120: + { + componentCount_ = input.readInt32(); + break; + } + case 130: + { + com.google.storage.v2.ObjectChecksums.Builder subBuilder = null; + if (checksums_ != null) { + subBuilder = checksums_.toBuilder(); + } + checksums_ = + input.readMessage( + com.google.storage.v2.ObjectChecksums.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(checksums_); + checksums_ = subBuilder.buildPartial(); + } + + break; + } + case 138: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + case 146: + { + java.lang.String s = input.readStringRequireUtf8(); + + kmsKey_ = s; + break; + } + case 154: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateStorageClassTime_ != null) { + subBuilder = updateStorageClassTime_.toBuilder(); + } + updateStorageClassTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateStorageClassTime_); + updateStorageClassTime_ = subBuilder.buildPartial(); + } + + break; + } + case 160: + { + temporaryHold_ = input.readBool(); + break; + } + case 170: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (retentionExpireTime_ != null) { + subBuilder = retentionExpireTime_.toBuilder(); + } + retentionExpireTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(retentionExpireTime_); + retentionExpireTime_ = subBuilder.buildPartial(); + } + + break; + } + case 178: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + metadata_ = + com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000002; + } + com.google.protobuf.MapEntry metadata__ = + input.readMessage( + MetadataDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + metadata_.getMutableMap().put(metadata__.getKey(), metadata__.getValue()); + break; + } + case 184: + { + bitField0_ |= 0x00000001; + eventBasedHold_ = input.readBool(); + break; + } + case 194: + { + com.google.storage.v2.Owner.Builder subBuilder = null; + if (owner_ != null) { + subBuilder = owner_.toBuilder(); + } + owner_ = input.readMessage(com.google.storage.v2.Owner.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(owner_); + owner_ = subBuilder.buildPartial(); + } + + break; + } + case 202: + { + com.google.storage.v2.Object.CustomerEncryption.Builder subBuilder = null; + if (customerEncryption_ != null) { + subBuilder = customerEncryption_.toBuilder(); + } + customerEncryption_ = + input.readMessage( + com.google.storage.v2.Object.CustomerEncryption.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(customerEncryption_); + customerEncryption_ = subBuilder.buildPartial(); + } + + break; + } + case 210: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (customTime_ != null) { + subBuilder = customTime_.toBuilder(); + } + customTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(customTime_); + customTime_ = 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_ & 0x00000001) != 0)) { + acl_ = java.util.Collections.unmodifiableList(acl_); + } + 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_Object_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 22: + return internalGetMetadata(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_Object_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.Object.class, com.google.storage.v2.Object.Builder.class); + } + + public interface CustomerEncryptionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.Object.CustomerEncryption) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The encryption algorithm.
+     * 
+ * + * string encryption_algorithm = 1; + * + * @return The encryptionAlgorithm. + */ + java.lang.String getEncryptionAlgorithm(); + /** + * + * + *
+     * The encryption algorithm.
+     * 
+ * + * string encryption_algorithm = 1; + * + * @return The bytes for encryptionAlgorithm. + */ + com.google.protobuf.ByteString getEncryptionAlgorithmBytes(); + + /** + * + * + *
+     * SHA256 hash value of the encryption key.
+     * 
+ * + * string key_sha256 = 2; + * + * @return The keySha256. + */ + java.lang.String getKeySha256(); + /** + * + * + *
+     * SHA256 hash value of the encryption key.
+     * 
+ * + * string key_sha256 = 2; + * + * @return The bytes for keySha256. + */ + com.google.protobuf.ByteString getKeySha256Bytes(); + } + /** + * + * + *
+   * Describes the customer-specified mechanism used to store the data at rest.
+   * 
+ * + * Protobuf type {@code google.storage.v2.Object.CustomerEncryption} + */ + public static final class CustomerEncryption extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.v2.Object.CustomerEncryption) + CustomerEncryptionOrBuilder { + private static final long serialVersionUID = 0L; + // Use CustomerEncryption.newBuilder() to construct. + private CustomerEncryption(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CustomerEncryption() { + encryptionAlgorithm_ = ""; + keySha256_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CustomerEncryption(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CustomerEncryption( + 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(); + + encryptionAlgorithm_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + keySha256_ = 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_Object_CustomerEncryption_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_Object_CustomerEncryption_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.Object.CustomerEncryption.class, + com.google.storage.v2.Object.CustomerEncryption.Builder.class); + } + + public static final int ENCRYPTION_ALGORITHM_FIELD_NUMBER = 1; + private volatile java.lang.Object encryptionAlgorithm_; + /** + * + * + *
+     * The encryption algorithm.
+     * 
+ * + * string encryption_algorithm = 1; + * + * @return The encryptionAlgorithm. + */ + @java.lang.Override + public java.lang.String getEncryptionAlgorithm() { + java.lang.Object ref = encryptionAlgorithm_; + 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(); + encryptionAlgorithm_ = s; + return s; + } + } + /** + * + * + *
+     * The encryption algorithm.
+     * 
+ * + * string encryption_algorithm = 1; + * + * @return The bytes for encryptionAlgorithm. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEncryptionAlgorithmBytes() { + java.lang.Object ref = encryptionAlgorithm_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + encryptionAlgorithm_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KEY_SHA256_FIELD_NUMBER = 2; + private volatile java.lang.Object keySha256_; + /** + * + * + *
+     * SHA256 hash value of the encryption key.
+     * 
+ * + * string key_sha256 = 2; + * + * @return The keySha256. + */ + @java.lang.Override + public java.lang.String getKeySha256() { + java.lang.Object ref = keySha256_; + 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(); + keySha256_ = s; + return s; + } + } + /** + * + * + *
+     * SHA256 hash value of the encryption key.
+     * 
+ * + * string key_sha256 = 2; + * + * @return The bytes for keySha256. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKeySha256Bytes() { + java.lang.Object ref = keySha256_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + keySha256_ = 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 (!getEncryptionAlgorithmBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, encryptionAlgorithm_); + } + if (!getKeySha256Bytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, keySha256_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getEncryptionAlgorithmBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, encryptionAlgorithm_); + } + if (!getKeySha256Bytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, keySha256_); + } + 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.Object.CustomerEncryption)) { + return super.equals(obj); + } + com.google.storage.v2.Object.CustomerEncryption other = + (com.google.storage.v2.Object.CustomerEncryption) obj; + + if (!getEncryptionAlgorithm().equals(other.getEncryptionAlgorithm())) return false; + if (!getKeySha256().equals(other.getKeySha256())) 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) + ENCRYPTION_ALGORITHM_FIELD_NUMBER; + hash = (53 * hash) + getEncryptionAlgorithm().hashCode(); + hash = (37 * hash) + KEY_SHA256_FIELD_NUMBER; + hash = (53 * hash) + getKeySha256().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.v2.Object.CustomerEncryption parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.Object.CustomerEncryption 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.Object.CustomerEncryption parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.Object.CustomerEncryption 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.Object.CustomerEncryption parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.Object.CustomerEncryption parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.Object.CustomerEncryption parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.Object.CustomerEncryption 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.Object.CustomerEncryption parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.v2.Object.CustomerEncryption 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.Object.CustomerEncryption parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.Object.CustomerEncryption 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.Object.CustomerEncryption prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Describes the customer-specified mechanism used to store the data at rest.
+     * 
+ * + * Protobuf type {@code google.storage.v2.Object.CustomerEncryption} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.Object.CustomerEncryption) + com.google.storage.v2.Object.CustomerEncryptionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_Object_CustomerEncryption_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_Object_CustomerEncryption_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.Object.CustomerEncryption.class, + com.google.storage.v2.Object.CustomerEncryption.Builder.class); + } + + // Construct using com.google.storage.v2.Object.CustomerEncryption.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + encryptionAlgorithm_ = ""; + + keySha256_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_Object_CustomerEncryption_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.Object.CustomerEncryption getDefaultInstanceForType() { + return com.google.storage.v2.Object.CustomerEncryption.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.Object.CustomerEncryption build() { + com.google.storage.v2.Object.CustomerEncryption result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.Object.CustomerEncryption buildPartial() { + com.google.storage.v2.Object.CustomerEncryption result = + new com.google.storage.v2.Object.CustomerEncryption(this); + result.encryptionAlgorithm_ = encryptionAlgorithm_; + result.keySha256_ = keySha256_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.storage.v2.Object.CustomerEncryption) { + return mergeFrom((com.google.storage.v2.Object.CustomerEncryption) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.Object.CustomerEncryption other) { + if (other == com.google.storage.v2.Object.CustomerEncryption.getDefaultInstance()) + return this; + if (!other.getEncryptionAlgorithm().isEmpty()) { + encryptionAlgorithm_ = other.encryptionAlgorithm_; + onChanged(); + } + if (!other.getKeySha256().isEmpty()) { + keySha256_ = other.keySha256_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.storage.v2.Object.CustomerEncryption parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.storage.v2.Object.CustomerEncryption) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object encryptionAlgorithm_ = ""; + /** + * + * + *
+       * The encryption algorithm.
+       * 
+ * + * string encryption_algorithm = 1; + * + * @return The encryptionAlgorithm. + */ + public java.lang.String getEncryptionAlgorithm() { + java.lang.Object ref = encryptionAlgorithm_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + encryptionAlgorithm_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The encryption algorithm.
+       * 
+ * + * string encryption_algorithm = 1; + * + * @return The bytes for encryptionAlgorithm. + */ + public com.google.protobuf.ByteString getEncryptionAlgorithmBytes() { + java.lang.Object ref = encryptionAlgorithm_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + encryptionAlgorithm_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The encryption algorithm.
+       * 
+ * + * string encryption_algorithm = 1; + * + * @param value The encryptionAlgorithm to set. + * @return This builder for chaining. + */ + public Builder setEncryptionAlgorithm(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + encryptionAlgorithm_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * The encryption algorithm.
+       * 
+ * + * string encryption_algorithm = 1; + * + * @return This builder for chaining. + */ + public Builder clearEncryptionAlgorithm() { + + encryptionAlgorithm_ = getDefaultInstance().getEncryptionAlgorithm(); + onChanged(); + return this; + } + /** + * + * + *
+       * The encryption algorithm.
+       * 
+ * + * string encryption_algorithm = 1; + * + * @param value The bytes for encryptionAlgorithm to set. + * @return This builder for chaining. + */ + public Builder setEncryptionAlgorithmBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + encryptionAlgorithm_ = value; + onChanged(); + return this; + } + + private java.lang.Object keySha256_ = ""; + /** + * + * + *
+       * SHA256 hash value of the encryption key.
+       * 
+ * + * string key_sha256 = 2; + * + * @return The keySha256. + */ + public java.lang.String getKeySha256() { + java.lang.Object ref = keySha256_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + keySha256_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * SHA256 hash value of the encryption key.
+       * 
+ * + * string key_sha256 = 2; + * + * @return The bytes for keySha256. + */ + public com.google.protobuf.ByteString getKeySha256Bytes() { + java.lang.Object ref = keySha256_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + keySha256_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * SHA256 hash value of the encryption key.
+       * 
+ * + * string key_sha256 = 2; + * + * @param value The keySha256 to set. + * @return This builder for chaining. + */ + public Builder setKeySha256(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + keySha256_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * SHA256 hash value of the encryption key.
+       * 
+ * + * string key_sha256 = 2; + * + * @return This builder for chaining. + */ + public Builder clearKeySha256() { + + keySha256_ = getDefaultInstance().getKeySha256(); + onChanged(); + return this; + } + /** + * + * + *
+       * SHA256 hash value of the encryption key.
+       * 
+ * + * string key_sha256 = 2; + * + * @param value The bytes for keySha256 to set. + * @return This builder for chaining. + */ + public Builder setKeySha256Bytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + keySha256_ = 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.Object.CustomerEncryption) + } + + // @@protoc_insertion_point(class_scope:google.storage.v2.Object.CustomerEncryption) + private static final com.google.storage.v2.Object.CustomerEncryption DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.v2.Object.CustomerEncryption(); + } + + public static com.google.storage.v2.Object.CustomerEncryption getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CustomerEncryption parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CustomerEncryption(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.storage.v2.Object.CustomerEncryption getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Immutable. The name of this object. Nearly any sequence of unicode characters is
+   * valid. See
+   * [Guidelines](https://cloud.google.com/storage/docs/naming-objects).
+   * Example: `test.txt`
+   * The `name` field by itself does not uniquely identify a Cloud Storage
+   * object. A Cloud Storage object is uniquely identified by the tuple of
+   * (bucket, object, generation).
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Immutable. The name of this object. Nearly any sequence of unicode characters is
+   * valid. See
+   * [Guidelines](https://cloud.google.com/storage/docs/naming-objects).
+   * Example: `test.txt`
+   * The `name` field by itself does not uniquely identify a Cloud Storage
+   * object. A Cloud Storage object is uniquely identified by the tuple of
+   * (bucket, object, generation).
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BUCKET_FIELD_NUMBER = 2; + private volatile java.lang.Object bucket_; + /** + * + * + *
+   * Immutable. The name of the bucket containing this object.
+   * Example: `projects/_/buckets/foo`.
+   * 
+ * + * + * string bucket = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The bucket. + */ + @java.lang.Override + public java.lang.String getBucket() { + java.lang.Object ref = bucket_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + bucket_ = s; + return s; + } + } + /** + * + * + *
+   * Immutable. The name of the bucket containing this object.
+   * Example: `projects/_/buckets/foo`.
+   * 
+ * + * + * string bucket = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for bucket. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBucketBytes() { + java.lang.Object ref = bucket_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + bucket_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GENERATION_FIELD_NUMBER = 3; + private long generation_; + /** + * + * + *
+   * Immutable. The content generation of this object. Used for object versioning.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * int64 generation = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The generation. + */ + @java.lang.Override + public long getGeneration() { + return generation_; + } + + public static final int METAGENERATION_FIELD_NUMBER = 4; + private long metageneration_; + /** + * + * + *
+   * Output only. The version of the metadata for this generation of this object. Used for
+   * preconditions and for detecting changes in metadata. A metageneration
+   * number is only meaningful in the context of a particular generation of a
+   * particular object.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * int64 metageneration = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The metageneration. + */ + @java.lang.Override + public long getMetageneration() { + return metageneration_; + } + + public static final int STORAGE_CLASS_FIELD_NUMBER = 5; + private volatile java.lang.Object storageClass_; + /** + * + * + *
+   * Storage class of the object.
+   * 
+ * + * string storage_class = 5; + * + * @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; + } + } + /** + * + * + *
+   * Storage class of the object.
+   * 
+ * + * string storage_class = 5; + * + * @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; + } + } + + public static final int SIZE_FIELD_NUMBER = 6; + private long size_; + /** + * + * + *
+   * Output only. Content-Length of the object data in bytes, matching
+   * [https://tools.ietf.org/html/rfc7230#section-3.3.2][RFC 7230 §3.3.2].
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * int64 size = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The size. + */ + @java.lang.Override + public long getSize() { + return size_; + } + + public static final int CONTENT_ENCODING_FIELD_NUMBER = 7; + private volatile java.lang.Object contentEncoding_; + /** + * + * + *
+   * Content-Encoding of the object data, matching
+   * [https://tools.ietf.org/html/rfc7231#section-3.1.2.2][RFC 7231 §3.1.2.2]
+   * 
+ * + * string content_encoding = 7; + * + * @return The contentEncoding. + */ + @java.lang.Override + public java.lang.String getContentEncoding() { + java.lang.Object ref = contentEncoding_; + 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(); + contentEncoding_ = s; + return s; + } + } + /** + * + * + *
+   * Content-Encoding of the object data, matching
+   * [https://tools.ietf.org/html/rfc7231#section-3.1.2.2][RFC 7231 §3.1.2.2]
+   * 
+ * + * string content_encoding = 7; + * + * @return The bytes for contentEncoding. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContentEncodingBytes() { + java.lang.Object ref = contentEncoding_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + contentEncoding_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTENT_DISPOSITION_FIELD_NUMBER = 8; + private volatile java.lang.Object contentDisposition_; + /** + * + * + *
+   * Content-Disposition of the object data, matching
+   * [https://tools.ietf.org/html/rfc6266][RFC 6266].
+   * 
+ * + * string content_disposition = 8; + * + * @return The contentDisposition. + */ + @java.lang.Override + public java.lang.String getContentDisposition() { + java.lang.Object ref = contentDisposition_; + 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(); + contentDisposition_ = s; + return s; + } + } + /** + * + * + *
+   * Content-Disposition of the object data, matching
+   * [https://tools.ietf.org/html/rfc6266][RFC 6266].
+   * 
+ * + * string content_disposition = 8; + * + * @return The bytes for contentDisposition. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContentDispositionBytes() { + java.lang.Object ref = contentDisposition_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + contentDisposition_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CACHE_CONTROL_FIELD_NUMBER = 9; + private volatile java.lang.Object cacheControl_; + /** + * + * + *
+   * Cache-Control directive for the object data, matching
+   * [https://tools.ietf.org/html/rfc7234#section-5.2"][RFC 7234 §5.2].
+   * If omitted, and the object is accessible to all anonymous users, the
+   * default will be `public, max-age=3600`.
+   * 
+ * + * string cache_control = 9; + * + * @return The cacheControl. + */ + @java.lang.Override + public java.lang.String getCacheControl() { + java.lang.Object ref = cacheControl_; + 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(); + cacheControl_ = s; + return s; + } + } + /** + * + * + *
+   * Cache-Control directive for the object data, matching
+   * [https://tools.ietf.org/html/rfc7234#section-5.2"][RFC 7234 §5.2].
+   * If omitted, and the object is accessible to all anonymous users, the
+   * default will be `public, max-age=3600`.
+   * 
+ * + * string cache_control = 9; + * + * @return The bytes for cacheControl. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCacheControlBytes() { + java.lang.Object ref = cacheControl_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cacheControl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ACL_FIELD_NUMBER = 10; + private java.util.List acl_; + /** + * + * + *
+   * Access controls on the object.
+   * If iamConfig.uniformBucketLevelAccess is enabled on the parent
+   * bucket, requests to set, read, or modify acl is an error.
+   * 
+ * + * repeated .google.storage.v2.ObjectAccessControl acl = 10; + */ + @java.lang.Override + public java.util.List getAclList() { + return acl_; + } + /** + * + * + *
+   * Access controls on the object.
+   * If iamConfig.uniformBucketLevelAccess is enabled on the parent
+   * bucket, requests to set, read, or modify acl is an error.
+   * 
+ * + * repeated .google.storage.v2.ObjectAccessControl acl = 10; + */ + @java.lang.Override + public java.util.List + getAclOrBuilderList() { + return acl_; + } + /** + * + * + *
+   * Access controls on the object.
+   * If iamConfig.uniformBucketLevelAccess is enabled on the parent
+   * bucket, requests to set, read, or modify acl is an error.
+   * 
+ * + * repeated .google.storage.v2.ObjectAccessControl acl = 10; + */ + @java.lang.Override + public int getAclCount() { + return acl_.size(); + } + /** + * + * + *
+   * Access controls on the object.
+   * If iamConfig.uniformBucketLevelAccess is enabled on the parent
+   * bucket, requests to set, read, or modify acl is an error.
+   * 
+ * + * repeated .google.storage.v2.ObjectAccessControl acl = 10; + */ + @java.lang.Override + public com.google.storage.v2.ObjectAccessControl getAcl(int index) { + return acl_.get(index); + } + /** + * + * + *
+   * Access controls on the object.
+   * If iamConfig.uniformBucketLevelAccess is enabled on the parent
+   * bucket, requests to set, read, or modify acl is an error.
+   * 
+ * + * repeated .google.storage.v2.ObjectAccessControl acl = 10; + */ + @java.lang.Override + public com.google.storage.v2.ObjectAccessControlOrBuilder getAclOrBuilder(int index) { + return acl_.get(index); + } + + public static final int CONTENT_LANGUAGE_FIELD_NUMBER = 11; + private volatile java.lang.Object contentLanguage_; + /** + * + * + *
+   * Content-Language of the object data, matching
+   * [https://tools.ietf.org/html/rfc7231#section-3.1.3.2][RFC 7231 §3.1.3.2].
+   * 
+ * + * string content_language = 11; + * + * @return The contentLanguage. + */ + @java.lang.Override + public java.lang.String getContentLanguage() { + java.lang.Object ref = contentLanguage_; + 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(); + contentLanguage_ = s; + return s; + } + } + /** + * + * + *
+   * Content-Language of the object data, matching
+   * [https://tools.ietf.org/html/rfc7231#section-3.1.3.2][RFC 7231 §3.1.3.2].
+   * 
+ * + * string content_language = 11; + * + * @return The bytes for contentLanguage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContentLanguageBytes() { + java.lang.Object ref = contentLanguage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + contentLanguage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DELETE_TIME_FIELD_NUMBER = 12; + private com.google.protobuf.Timestamp deleteTime_; + /** + * + * + *
+   * Output only. The deletion time of the object. Will be returned if and only if this
+   * version of the object has been deleted.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + @java.lang.Override + public boolean hasDeleteTime() { + return deleteTime_ != null; + } + /** + * + * + *
+   * Output only. The deletion time of the object. Will be returned if and only if this
+   * version of the object has been deleted.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The deleteTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getDeleteTime() { + return deleteTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : deleteTime_; + } + /** + * + * + *
+   * Output only. The deletion time of the object. Will be returned if and only if this
+   * version of the object has been deleted.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { + return getDeleteTime(); + } + + public static final int CONTENT_TYPE_FIELD_NUMBER = 13; + private volatile java.lang.Object contentType_; + /** + * + * + *
+   * Content-Type of the object data, matching
+   * [https://tools.ietf.org/html/rfc7231#section-3.1.1.5][RFC 7231 §3.1.1.5].
+   * If an object is stored without a Content-Type, it is served as
+   * `application/octet-stream`.
+   * 
+ * + * string content_type = 13; + * + * @return The contentType. + */ + @java.lang.Override + public java.lang.String getContentType() { + java.lang.Object ref = contentType_; + 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(); + contentType_ = s; + return s; + } + } + /** + * + * + *
+   * Content-Type of the object data, matching
+   * [https://tools.ietf.org/html/rfc7231#section-3.1.1.5][RFC 7231 §3.1.1.5].
+   * If an object is stored without a Content-Type, it is served as
+   * `application/octet-stream`.
+   * 
+ * + * string content_type = 13; + * + * @return The bytes for contentType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContentTypeBytes() { + java.lang.Object ref = contentType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + contentType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 14; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The creation time of the object.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * .google.protobuf.Timestamp create_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. The creation time of the object.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * .google.protobuf.Timestamp create_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. The creation time of the object.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * .google.protobuf.Timestamp create_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int COMPONENT_COUNT_FIELD_NUMBER = 15; + private int componentCount_; + /** + * + * + *
+   * Output only. Number of underlying components that make up this object. Components are
+   * accumulated by compose operations.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * int32 component_count = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The componentCount. + */ + @java.lang.Override + public int getComponentCount() { + return componentCount_; + } + + public static final int CHECKSUMS_FIELD_NUMBER = 16; + private com.google.storage.v2.ObjectChecksums checksums_; + /** + * + * + *
+   * Output only. Hashes for the data part of this object.
+   * 
+ * + * + * .google.storage.v2.ObjectChecksums checksums = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the checksums field is set. + */ + @java.lang.Override + public boolean hasChecksums() { + return checksums_ != null; + } + /** + * + * + *
+   * Output only. Hashes for the data part of this object.
+   * 
+ * + * + * .google.storage.v2.ObjectChecksums checksums = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The checksums. + */ + @java.lang.Override + public com.google.storage.v2.ObjectChecksums getChecksums() { + return checksums_ == null + ? com.google.storage.v2.ObjectChecksums.getDefaultInstance() + : checksums_; + } + /** + * + * + *
+   * Output only. Hashes for the data part of this object.
+   * 
+ * + * + * .google.storage.v2.ObjectChecksums checksums = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.storage.v2.ObjectChecksumsOrBuilder getChecksumsOrBuilder() { + return getChecksums(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 17; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The modification time of the object metadata.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * .google.protobuf.Timestamp update_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. The modification time of the object metadata.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * .google.protobuf.Timestamp update_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. The modification time of the object metadata.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * .google.protobuf.Timestamp update_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int KMS_KEY_FIELD_NUMBER = 18; + private volatile java.lang.Object kmsKey_; + /** + * + * + *
+   * Cloud KMS Key used to encrypt this object, if the object is encrypted by
+   * such a key.
+   * 
+ * + * string kms_key = 18 [(.google.api.resource_reference) = { ... } + * + * @return The kmsKey. + */ + @java.lang.Override + public java.lang.String getKmsKey() { + java.lang.Object ref = kmsKey_; + 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(); + kmsKey_ = s; + return s; + } + } + /** + * + * + *
+   * Cloud KMS Key used to encrypt this object, if the object is encrypted by
+   * such a key.
+   * 
+ * + * string kms_key = 18 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for kmsKey. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKmsKeyBytes() { + java.lang.Object ref = kmsKey_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UPDATE_STORAGE_CLASS_TIME_FIELD_NUMBER = 19; + private com.google.protobuf.Timestamp updateStorageClassTime_; + /** + * + * + *
+   * Output only. The time at which the object's storage class was last changed. When the
+   * object is initially created, it will be set to time_created.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * + * .google.protobuf.Timestamp update_storage_class_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateStorageClassTime field is set. + */ + @java.lang.Override + public boolean hasUpdateStorageClassTime() { + return updateStorageClassTime_ != null; + } + /** + * + * + *
+   * Output only. The time at which the object's storage class was last changed. When the
+   * object is initially created, it will be set to time_created.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * + * .google.protobuf.Timestamp update_storage_class_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateStorageClassTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateStorageClassTime() { + return updateStorageClassTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateStorageClassTime_; + } + /** + * + * + *
+   * Output only. The time at which the object's storage class was last changed. When the
+   * object is initially created, it will be set to time_created.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * + * .google.protobuf.Timestamp update_storage_class_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateStorageClassTimeOrBuilder() { + return getUpdateStorageClassTime(); + } + + public static final int TEMPORARY_HOLD_FIELD_NUMBER = 20; + private boolean temporaryHold_; + /** + * + * + *
+   * Whether an object is under temporary hold. While this flag is set to true,
+   * the object is protected against deletion and overwrites.  A common use case
+   * of this flag is regulatory investigations where objects need to be retained
+   * while the investigation is ongoing. Note that unlike event-based hold,
+   * temporary hold does not impact retention expiration time of an object.
+   * 
+ * + * bool temporary_hold = 20; + * + * @return The temporaryHold. + */ + @java.lang.Override + public boolean getTemporaryHold() { + return temporaryHold_; + } + + public static final int RETENTION_EXPIRE_TIME_FIELD_NUMBER = 21; + private com.google.protobuf.Timestamp retentionExpireTime_; + /** + * + * + *
+   * A server-determined value that specifies the earliest time that the
+   * object's retention period expires. This value is in
+   * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+   * Note 1: This field is not provided for objects with an active event-based
+   * hold, since retention expiration is unknown until the hold is removed.
+   * Note 2: This value can be provided even when temporary hold is set (so that
+   * the user can reason about policy without having to first unset the
+   * temporary hold).
+   * 
+ * + * .google.protobuf.Timestamp retention_expire_time = 21; + * + * @return Whether the retentionExpireTime field is set. + */ + @java.lang.Override + public boolean hasRetentionExpireTime() { + return retentionExpireTime_ != null; + } + /** + * + * + *
+   * A server-determined value that specifies the earliest time that the
+   * object's retention period expires. This value is in
+   * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+   * Note 1: This field is not provided for objects with an active event-based
+   * hold, since retention expiration is unknown until the hold is removed.
+   * Note 2: This value can be provided even when temporary hold is set (so that
+   * the user can reason about policy without having to first unset the
+   * temporary hold).
+   * 
+ * + * .google.protobuf.Timestamp retention_expire_time = 21; + * + * @return The retentionExpireTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getRetentionExpireTime() { + return retentionExpireTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : retentionExpireTime_; + } + /** + * + * + *
+   * A server-determined value that specifies the earliest time that the
+   * object's retention period expires. This value is in
+   * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+   * Note 1: This field is not provided for objects with an active event-based
+   * hold, since retention expiration is unknown until the hold is removed.
+   * Note 2: This value can be provided even when temporary hold is set (so that
+   * the user can reason about policy without having to first unset the
+   * temporary hold).
+   * 
+ * + * .google.protobuf.Timestamp retention_expire_time = 21; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getRetentionExpireTimeOrBuilder() { + return getRetentionExpireTime(); + } + + public static final int METADATA_FIELD_NUMBER = 22; + + private static final class MetadataDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_Object_MetadataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField metadata_; + + private com.google.protobuf.MapField internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField(MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + * + * + *
+   * User-provided metadata, in key/value pairs.
+   * 
+ * + * map<string, string> metadata = 22; + */ + @java.lang.Override + public boolean containsMetadata(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetMetadata().getMap().containsKey(key); + } + /** Use {@link #getMetadataMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + * + * + *
+   * User-provided metadata, in key/value pairs.
+   * 
+ * + * map<string, string> metadata = 22; + */ + @java.lang.Override + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + * + * + *
+   * User-provided metadata, in key/value pairs.
+   * 
+ * + * map<string, string> metadata = 22; + */ + @java.lang.Override + public java.lang.String getMetadataOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * User-provided metadata, in key/value pairs.
+   * 
+ * + * map<string, string> metadata = 22; + */ + @java.lang.Override + public java.lang.String getMetadataOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int EVENT_BASED_HOLD_FIELD_NUMBER = 23; + private boolean eventBasedHold_; + /** + * + * + *
+   * Whether an object is under event-based hold.
+   * An event-based hold is a way to force the retention of an object until
+   * after some event occurs. Once the hold is released by explicitly setting
+   * this field to false, the object will become subject to any bucket-level
+   * retention policy, except that the retention duration will be calculated
+   * from the time the event based hold was lifted, rather than the time the
+   * object was created.
+   * In a WriteObject request, not setting this field implies that the value
+   * should be taken from the parent bucket's "default_event_based_hold" field.
+   * In a response, this field will always be set to true or false.
+   * 
+ * + * bool event_based_hold = 23; + * + * @return Whether the eventBasedHold field is set. + */ + @java.lang.Override + public boolean hasEventBasedHold() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Whether an object is under event-based hold.
+   * An event-based hold is a way to force the retention of an object until
+   * after some event occurs. Once the hold is released by explicitly setting
+   * this field to false, the object will become subject to any bucket-level
+   * retention policy, except that the retention duration will be calculated
+   * from the time the event based hold was lifted, rather than the time the
+   * object was created.
+   * In a WriteObject request, not setting this field implies that the value
+   * should be taken from the parent bucket's "default_event_based_hold" field.
+   * In a response, this field will always be set to true or false.
+   * 
+ * + * bool event_based_hold = 23; + * + * @return The eventBasedHold. + */ + @java.lang.Override + public boolean getEventBasedHold() { + return eventBasedHold_; + } + + public static final int OWNER_FIELD_NUMBER = 24; + private com.google.storage.v2.Owner owner_; + /** + * + * + *
+   * Output only. The owner of the object. This will always be the uploader of the object.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * .google.storage.v2.Owner owner = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the owner field is set. + */ + @java.lang.Override + public boolean hasOwner() { + return owner_ != null; + } + /** + * + * + *
+   * Output only. The owner of the object. This will always be the uploader of the object.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * .google.storage.v2.Owner owner = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The owner. + */ + @java.lang.Override + public com.google.storage.v2.Owner getOwner() { + return owner_ == null ? com.google.storage.v2.Owner.getDefaultInstance() : owner_; + } + /** + * + * + *
+   * Output only. The owner of the object. This will always be the uploader of the object.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * .google.storage.v2.Owner owner = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + @java.lang.Override + public com.google.storage.v2.OwnerOrBuilder getOwnerOrBuilder() { + return getOwner(); + } + + public static final int CUSTOMER_ENCRYPTION_FIELD_NUMBER = 25; + private com.google.storage.v2.Object.CustomerEncryption customerEncryption_; + /** + * + * + *
+   * Metadata of customer-supplied encryption key, if the object is encrypted by
+   * such a key.
+   * 
+ * + * .google.storage.v2.Object.CustomerEncryption customer_encryption = 25; + * + * @return Whether the customerEncryption field is set. + */ + @java.lang.Override + public boolean hasCustomerEncryption() { + return customerEncryption_ != null; + } + /** + * + * + *
+   * Metadata of customer-supplied encryption key, if the object is encrypted by
+   * such a key.
+   * 
+ * + * .google.storage.v2.Object.CustomerEncryption customer_encryption = 25; + * + * @return The customerEncryption. + */ + @java.lang.Override + public com.google.storage.v2.Object.CustomerEncryption getCustomerEncryption() { + return customerEncryption_ == null + ? com.google.storage.v2.Object.CustomerEncryption.getDefaultInstance() + : customerEncryption_; + } + /** + * + * + *
+   * Metadata of customer-supplied encryption key, if the object is encrypted by
+   * such a key.
+   * 
+ * + * .google.storage.v2.Object.CustomerEncryption customer_encryption = 25; + */ + @java.lang.Override + public com.google.storage.v2.Object.CustomerEncryptionOrBuilder getCustomerEncryptionOrBuilder() { + return getCustomerEncryption(); + } + + public static final int CUSTOM_TIME_FIELD_NUMBER = 26; + private com.google.protobuf.Timestamp customTime_; + /** + * + * + *
+   * A user-specified timestamp set on an object.
+   * 
+ * + * .google.protobuf.Timestamp custom_time = 26; + * + * @return Whether the customTime field is set. + */ + @java.lang.Override + public boolean hasCustomTime() { + return customTime_ != null; + } + /** + * + * + *
+   * A user-specified timestamp set on an object.
+   * 
+ * + * .google.protobuf.Timestamp custom_time = 26; + * + * @return The customTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCustomTime() { + return customTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : customTime_; + } + /** + * + * + *
+   * A user-specified timestamp set on an object.
+   * 
+ * + * .google.protobuf.Timestamp custom_time = 26; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCustomTimeOrBuilder() { + return getCustomTime(); + } + + 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getBucketBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, bucket_); + } + if (generation_ != 0L) { + output.writeInt64(3, generation_); + } + if (metageneration_ != 0L) { + output.writeInt64(4, metageneration_); + } + if (!getStorageClassBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, storageClass_); + } + if (size_ != 0L) { + output.writeInt64(6, size_); + } + if (!getContentEncodingBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, contentEncoding_); + } + if (!getContentDispositionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, contentDisposition_); + } + if (!getCacheControlBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, cacheControl_); + } + for (int i = 0; i < acl_.size(); i++) { + output.writeMessage(10, acl_.get(i)); + } + if (!getContentLanguageBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, contentLanguage_); + } + if (deleteTime_ != null) { + output.writeMessage(12, getDeleteTime()); + } + if (!getContentTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 13, contentType_); + } + if (createTime_ != null) { + output.writeMessage(14, getCreateTime()); + } + if (componentCount_ != 0) { + output.writeInt32(15, componentCount_); + } + if (checksums_ != null) { + output.writeMessage(16, getChecksums()); + } + if (updateTime_ != null) { + output.writeMessage(17, getUpdateTime()); + } + if (!getKmsKeyBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 18, kmsKey_); + } + if (updateStorageClassTime_ != null) { + output.writeMessage(19, getUpdateStorageClassTime()); + } + if (temporaryHold_ != false) { + output.writeBool(20, temporaryHold_); + } + if (retentionExpireTime_ != null) { + output.writeMessage(21, getRetentionExpireTime()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetMetadata(), MetadataDefaultEntryHolder.defaultEntry, 22); + if (((bitField0_ & 0x00000001) != 0)) { + output.writeBool(23, eventBasedHold_); + } + if (owner_ != null) { + output.writeMessage(24, getOwner()); + } + if (customerEncryption_ != null) { + output.writeMessage(25, getCustomerEncryption()); + } + if (customTime_ != null) { + output.writeMessage(26, getCustomTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getBucketBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, bucket_); + } + if (generation_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, generation_); + } + if (metageneration_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, metageneration_); + } + if (!getStorageClassBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, storageClass_); + } + if (size_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(6, size_); + } + if (!getContentEncodingBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, contentEncoding_); + } + if (!getContentDispositionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, contentDisposition_); + } + if (!getCacheControlBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, cacheControl_); + } + for (int i = 0; i < acl_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, acl_.get(i)); + } + if (!getContentLanguageBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, contentLanguage_); + } + if (deleteTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getDeleteTime()); + } + if (!getContentTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, contentType_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, getCreateTime()); + } + if (componentCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(15, componentCount_); + } + if (checksums_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(16, getChecksums()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(17, getUpdateTime()); + } + if (!getKmsKeyBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(18, kmsKey_); + } + if (updateStorageClassTime_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(19, getUpdateStorageClassTime()); + } + if (temporaryHold_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(20, temporaryHold_); + } + if (retentionExpireTime_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(21, getRetentionExpireTime()); + } + for (java.util.Map.Entry entry : + internalGetMetadata().getMap().entrySet()) { + com.google.protobuf.MapEntry metadata__ = + MetadataDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(22, metadata__); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(23, eventBasedHold_); + } + if (owner_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(24, getOwner()); + } + if (customerEncryption_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(25, getCustomerEncryption()); + } + if (customTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(26, getCustomTime()); + } + 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.Object)) { + return super.equals(obj); + } + com.google.storage.v2.Object other = (com.google.storage.v2.Object) obj; + + if (!getName().equals(other.getName())) return false; + if (!getBucket().equals(other.getBucket())) return false; + if (getGeneration() != other.getGeneration()) return false; + if (getMetageneration() != other.getMetageneration()) return false; + if (!getStorageClass().equals(other.getStorageClass())) return false; + if (getSize() != other.getSize()) return false; + if (!getContentEncoding().equals(other.getContentEncoding())) return false; + if (!getContentDisposition().equals(other.getContentDisposition())) return false; + if (!getCacheControl().equals(other.getCacheControl())) return false; + if (!getAclList().equals(other.getAclList())) return false; + if (!getContentLanguage().equals(other.getContentLanguage())) return false; + if (hasDeleteTime() != other.hasDeleteTime()) return false; + if (hasDeleteTime()) { + if (!getDeleteTime().equals(other.getDeleteTime())) return false; + } + if (!getContentType().equals(other.getContentType())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (getComponentCount() != other.getComponentCount()) return false; + if (hasChecksums() != other.hasChecksums()) return false; + if (hasChecksums()) { + if (!getChecksums().equals(other.getChecksums())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (!getKmsKey().equals(other.getKmsKey())) return false; + if (hasUpdateStorageClassTime() != other.hasUpdateStorageClassTime()) return false; + if (hasUpdateStorageClassTime()) { + if (!getUpdateStorageClassTime().equals(other.getUpdateStorageClassTime())) return false; + } + if (getTemporaryHold() != other.getTemporaryHold()) return false; + if (hasRetentionExpireTime() != other.hasRetentionExpireTime()) return false; + if (hasRetentionExpireTime()) { + if (!getRetentionExpireTime().equals(other.getRetentionExpireTime())) return false; + } + if (!internalGetMetadata().equals(other.internalGetMetadata())) return false; + if (hasEventBasedHold() != other.hasEventBasedHold()) return false; + if (hasEventBasedHold()) { + if (getEventBasedHold() != other.getEventBasedHold()) return false; + } + if (hasOwner() != other.hasOwner()) return false; + if (hasOwner()) { + if (!getOwner().equals(other.getOwner())) return false; + } + if (hasCustomerEncryption() != other.hasCustomerEncryption()) return false; + if (hasCustomerEncryption()) { + if (!getCustomerEncryption().equals(other.getCustomerEncryption())) return false; + } + if (hasCustomTime() != other.hasCustomTime()) return false; + if (hasCustomTime()) { + if (!getCustomTime().equals(other.getCustomTime())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + BUCKET_FIELD_NUMBER; + hash = (53 * hash) + getBucket().hashCode(); + hash = (37 * hash) + GENERATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getGeneration()); + hash = (37 * hash) + METAGENERATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getMetageneration()); + hash = (37 * hash) + STORAGE_CLASS_FIELD_NUMBER; + hash = (53 * hash) + getStorageClass().hashCode(); + hash = (37 * hash) + SIZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getSize()); + hash = (37 * hash) + CONTENT_ENCODING_FIELD_NUMBER; + hash = (53 * hash) + getContentEncoding().hashCode(); + hash = (37 * hash) + CONTENT_DISPOSITION_FIELD_NUMBER; + hash = (53 * hash) + getContentDisposition().hashCode(); + hash = (37 * hash) + CACHE_CONTROL_FIELD_NUMBER; + hash = (53 * hash) + getCacheControl().hashCode(); + if (getAclCount() > 0) { + hash = (37 * hash) + ACL_FIELD_NUMBER; + hash = (53 * hash) + getAclList().hashCode(); + } + hash = (37 * hash) + CONTENT_LANGUAGE_FIELD_NUMBER; + hash = (53 * hash) + getContentLanguage().hashCode(); + if (hasDeleteTime()) { + hash = (37 * hash) + DELETE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getDeleteTime().hashCode(); + } + hash = (37 * hash) + CONTENT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getContentType().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + hash = (37 * hash) + COMPONENT_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getComponentCount(); + if (hasChecksums()) { + hash = (37 * hash) + CHECKSUMS_FIELD_NUMBER; + hash = (53 * hash) + getChecksums().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + hash = (37 * hash) + KMS_KEY_FIELD_NUMBER; + hash = (53 * hash) + getKmsKey().hashCode(); + if (hasUpdateStorageClassTime()) { + hash = (37 * hash) + UPDATE_STORAGE_CLASS_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateStorageClassTime().hashCode(); + } + hash = (37 * hash) + TEMPORARY_HOLD_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getTemporaryHold()); + if (hasRetentionExpireTime()) { + hash = (37 * hash) + RETENTION_EXPIRE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getRetentionExpireTime().hashCode(); + } + if (!internalGetMetadata().getMap().isEmpty()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetMetadata().hashCode(); + } + if (hasEventBasedHold()) { + hash = (37 * hash) + EVENT_BASED_HOLD_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEventBasedHold()); + } + if (hasOwner()) { + hash = (37 * hash) + OWNER_FIELD_NUMBER; + hash = (53 * hash) + getOwner().hashCode(); + } + if (hasCustomerEncryption()) { + hash = (37 * hash) + CUSTOMER_ENCRYPTION_FIELD_NUMBER; + hash = (53 * hash) + getCustomerEncryption().hashCode(); + } + if (hasCustomTime()) { + hash = (37 * hash) + CUSTOM_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCustomTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.v2.Object parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.Object 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.Object parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.Object 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.Object parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.Object parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.Object parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.Object 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.Object parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.v2.Object 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.Object parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.Object 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.Object 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 object.
+   * 
+ * + * Protobuf type {@code google.storage.v2.Object} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.Object) + com.google.storage.v2.ObjectOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto.internal_static_google_storage_v2_Object_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 22: + return internalGetMetadata(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 22: + return internalGetMutableMetadata(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_Object_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.Object.class, com.google.storage.v2.Object.Builder.class); + } + + // Construct using com.google.storage.v2.Object.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getAclFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + bucket_ = ""; + + generation_ = 0L; + + metageneration_ = 0L; + + storageClass_ = ""; + + size_ = 0L; + + contentEncoding_ = ""; + + contentDisposition_ = ""; + + cacheControl_ = ""; + + if (aclBuilder_ == null) { + acl_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + aclBuilder_.clear(); + } + contentLanguage_ = ""; + + if (deleteTimeBuilder_ == null) { + deleteTime_ = null; + } else { + deleteTime_ = null; + deleteTimeBuilder_ = null; + } + contentType_ = ""; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + componentCount_ = 0; + + if (checksumsBuilder_ == null) { + checksums_ = null; + } else { + checksums_ = null; + checksumsBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + kmsKey_ = ""; + + if (updateStorageClassTimeBuilder_ == null) { + updateStorageClassTime_ = null; + } else { + updateStorageClassTime_ = null; + updateStorageClassTimeBuilder_ = null; + } + temporaryHold_ = false; + + if (retentionExpireTimeBuilder_ == null) { + retentionExpireTime_ = null; + } else { + retentionExpireTime_ = null; + retentionExpireTimeBuilder_ = null; + } + internalGetMutableMetadata().clear(); + eventBasedHold_ = false; + bitField0_ = (bitField0_ & ~0x00000004); + if (ownerBuilder_ == null) { + owner_ = null; + } else { + owner_ = null; + ownerBuilder_ = null; + } + if (customerEncryptionBuilder_ == null) { + customerEncryption_ = null; + } else { + customerEncryption_ = null; + customerEncryptionBuilder_ = null; + } + if (customTimeBuilder_ == null) { + customTime_ = null; + } else { + customTime_ = null; + customTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto.internal_static_google_storage_v2_Object_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.Object getDefaultInstanceForType() { + return com.google.storage.v2.Object.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.Object build() { + com.google.storage.v2.Object result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.Object buildPartial() { + com.google.storage.v2.Object result = new com.google.storage.v2.Object(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.name_ = name_; + result.bucket_ = bucket_; + result.generation_ = generation_; + result.metageneration_ = metageneration_; + result.storageClass_ = storageClass_; + result.size_ = size_; + result.contentEncoding_ = contentEncoding_; + result.contentDisposition_ = contentDisposition_; + result.cacheControl_ = cacheControl_; + if (aclBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + acl_ = java.util.Collections.unmodifiableList(acl_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.acl_ = acl_; + } else { + result.acl_ = aclBuilder_.build(); + } + result.contentLanguage_ = contentLanguage_; + if (deleteTimeBuilder_ == null) { + result.deleteTime_ = deleteTime_; + } else { + result.deleteTime_ = deleteTimeBuilder_.build(); + } + result.contentType_ = contentType_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + result.componentCount_ = componentCount_; + if (checksumsBuilder_ == null) { + result.checksums_ = checksums_; + } else { + result.checksums_ = checksumsBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + result.kmsKey_ = kmsKey_; + if (updateStorageClassTimeBuilder_ == null) { + result.updateStorageClassTime_ = updateStorageClassTime_; + } else { + result.updateStorageClassTime_ = updateStorageClassTimeBuilder_.build(); + } + result.temporaryHold_ = temporaryHold_; + if (retentionExpireTimeBuilder_ == null) { + result.retentionExpireTime_ = retentionExpireTime_; + } else { + result.retentionExpireTime_ = retentionExpireTimeBuilder_.build(); + } + result.metadata_ = internalGetMetadata(); + result.metadata_.makeImmutable(); + if (((from_bitField0_ & 0x00000004) != 0)) { + result.eventBasedHold_ = eventBasedHold_; + to_bitField0_ |= 0x00000001; + } + if (ownerBuilder_ == null) { + result.owner_ = owner_; + } else { + result.owner_ = ownerBuilder_.build(); + } + if (customerEncryptionBuilder_ == null) { + result.customerEncryption_ = customerEncryption_; + } else { + result.customerEncryption_ = customerEncryptionBuilder_.build(); + } + if (customTimeBuilder_ == null) { + result.customTime_ = customTime_; + } else { + result.customTime_ = customTimeBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.storage.v2.Object) { + return mergeFrom((com.google.storage.v2.Object) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.Object other) { + if (other == com.google.storage.v2.Object.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getBucket().isEmpty()) { + bucket_ = other.bucket_; + onChanged(); + } + if (other.getGeneration() != 0L) { + setGeneration(other.getGeneration()); + } + if (other.getMetageneration() != 0L) { + setMetageneration(other.getMetageneration()); + } + if (!other.getStorageClass().isEmpty()) { + storageClass_ = other.storageClass_; + onChanged(); + } + if (other.getSize() != 0L) { + setSize(other.getSize()); + } + if (!other.getContentEncoding().isEmpty()) { + contentEncoding_ = other.contentEncoding_; + onChanged(); + } + if (!other.getContentDisposition().isEmpty()) { + contentDisposition_ = other.contentDisposition_; + onChanged(); + } + if (!other.getCacheControl().isEmpty()) { + cacheControl_ = other.cacheControl_; + onChanged(); + } + if (aclBuilder_ == null) { + if (!other.acl_.isEmpty()) { + if (acl_.isEmpty()) { + acl_ = other.acl_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAclIsMutable(); + acl_.addAll(other.acl_); + } + onChanged(); + } + } else { + if (!other.acl_.isEmpty()) { + if (aclBuilder_.isEmpty()) { + aclBuilder_.dispose(); + aclBuilder_ = null; + acl_ = other.acl_; + bitField0_ = (bitField0_ & ~0x00000001); + aclBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getAclFieldBuilder() + : null; + } else { + aclBuilder_.addAllMessages(other.acl_); + } + } + } + if (!other.getContentLanguage().isEmpty()) { + contentLanguage_ = other.contentLanguage_; + onChanged(); + } + if (other.hasDeleteTime()) { + mergeDeleteTime(other.getDeleteTime()); + } + if (!other.getContentType().isEmpty()) { + contentType_ = other.contentType_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.getComponentCount() != 0) { + setComponentCount(other.getComponentCount()); + } + if (other.hasChecksums()) { + mergeChecksums(other.getChecksums()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (!other.getKmsKey().isEmpty()) { + kmsKey_ = other.kmsKey_; + onChanged(); + } + if (other.hasUpdateStorageClassTime()) { + mergeUpdateStorageClassTime(other.getUpdateStorageClassTime()); + } + if (other.getTemporaryHold() != false) { + setTemporaryHold(other.getTemporaryHold()); + } + if (other.hasRetentionExpireTime()) { + mergeRetentionExpireTime(other.getRetentionExpireTime()); + } + internalGetMutableMetadata().mergeFrom(other.internalGetMetadata()); + if (other.hasEventBasedHold()) { + setEventBasedHold(other.getEventBasedHold()); + } + if (other.hasOwner()) { + mergeOwner(other.getOwner()); + } + if (other.hasCustomerEncryption()) { + mergeCustomerEncryption(other.getCustomerEncryption()); + } + if (other.hasCustomTime()) { + mergeCustomTime(other.getCustomTime()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.storage.v2.Object parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.storage.v2.Object) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Immutable. The name of this object. Nearly any sequence of unicode characters is
+     * valid. See
+     * [Guidelines](https://cloud.google.com/storage/docs/naming-objects).
+     * Example: `test.txt`
+     * The `name` field by itself does not uniquely identify a Cloud Storage
+     * object. A Cloud Storage object is uniquely identified by the tuple of
+     * (bucket, object, generation).
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Immutable. The name of this object. Nearly any sequence of unicode characters is
+     * valid. See
+     * [Guidelines](https://cloud.google.com/storage/docs/naming-objects).
+     * Example: `test.txt`
+     * The `name` field by itself does not uniquely identify a Cloud Storage
+     * object. A Cloud Storage object is uniquely identified by the tuple of
+     * (bucket, object, generation).
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Immutable. The name of this object. Nearly any sequence of unicode characters is
+     * valid. See
+     * [Guidelines](https://cloud.google.com/storage/docs/naming-objects).
+     * Example: `test.txt`
+     * The `name` field by itself does not uniquely identify a Cloud Storage
+     * object. A Cloud Storage object is uniquely identified by the tuple of
+     * (bucket, object, generation).
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The name of this object. Nearly any sequence of unicode characters is
+     * valid. See
+     * [Guidelines](https://cloud.google.com/storage/docs/naming-objects).
+     * Example: `test.txt`
+     * The `name` field by itself does not uniquely identify a Cloud Storage
+     * object. A Cloud Storage object is uniquely identified by the tuple of
+     * (bucket, object, generation).
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The name of this object. Nearly any sequence of unicode characters is
+     * valid. See
+     * [Guidelines](https://cloud.google.com/storage/docs/naming-objects).
+     * Example: `test.txt`
+     * The `name` field by itself does not uniquely identify a Cloud Storage
+     * object. A Cloud Storage object is uniquely identified by the tuple of
+     * (bucket, object, generation).
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object bucket_ = ""; + /** + * + * + *
+     * Immutable. The name of the bucket containing this object.
+     * Example: `projects/_/buckets/foo`.
+     * 
+ * + * + * string bucket = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The bucket. + */ + public java.lang.String getBucket() { + java.lang.Object ref = bucket_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + bucket_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Immutable. The name of the bucket containing this object.
+     * Example: `projects/_/buckets/foo`.
+     * 
+ * + * + * string bucket = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for bucket. + */ + public com.google.protobuf.ByteString getBucketBytes() { + java.lang.Object ref = bucket_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + bucket_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Immutable. The name of the bucket containing this object.
+     * Example: `projects/_/buckets/foo`.
+     * 
+ * + * + * string bucket = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @param value The bucket to set. + * @return This builder for chaining. + */ + public Builder setBucket(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + bucket_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The name of the bucket containing this object.
+     * Example: `projects/_/buckets/foo`.
+     * 
+ * + * + * string bucket = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearBucket() { + + bucket_ = getDefaultInstance().getBucket(); + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The name of the bucket containing this object.
+     * Example: `projects/_/buckets/foo`.
+     * 
+ * + * + * string bucket = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for bucket to set. + * @return This builder for chaining. + */ + public Builder setBucketBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + bucket_ = value; + onChanged(); + return this; + } + + private long generation_; + /** + * + * + *
+     * Immutable. The content generation of this object. Used for object versioning.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * int64 generation = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The generation. + */ + @java.lang.Override + public long getGeneration() { + return generation_; + } + /** + * + * + *
+     * Immutable. The content generation of this object. Used for object versioning.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * int64 generation = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @param value The generation to set. + * @return This builder for chaining. + */ + public Builder setGeneration(long value) { + + generation_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Immutable. The content generation of this object. Used for object versioning.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * int64 generation = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return This builder for chaining. + */ + public Builder clearGeneration() { + + generation_ = 0L; + onChanged(); + return this; + } + + private long metageneration_; + /** + * + * + *
+     * Output only. The version of the metadata for this generation of this object. Used for
+     * preconditions and for detecting changes in metadata. A metageneration
+     * number is only meaningful in the context of a particular generation of a
+     * particular object.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * int64 metageneration = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The metageneration. + */ + @java.lang.Override + public long getMetageneration() { + return metageneration_; + } + /** + * + * + *
+     * Output only. The version of the metadata for this generation of this object. Used for
+     * preconditions and for detecting changes in metadata. A metageneration
+     * number is only meaningful in the context of a particular generation of a
+     * particular object.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * int64 metageneration = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The metageneration to set. + * @return This builder for chaining. + */ + public Builder setMetageneration(long value) { + + metageneration_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The version of the metadata for this generation of this object. Used for
+     * preconditions and for detecting changes in metadata. A metageneration
+     * number is only meaningful in the context of a particular generation of a
+     * particular object.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * int64 metageneration = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearMetageneration() { + + metageneration_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object storageClass_ = ""; + /** + * + * + *
+     * Storage class of the object.
+     * 
+ * + * string storage_class = 5; + * + * @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; + } + } + /** + * + * + *
+     * Storage class of the object.
+     * 
+ * + * string storage_class = 5; + * + * @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; + } + } + /** + * + * + *
+     * Storage class of the object.
+     * 
+ * + * string storage_class = 5; + * + * @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; + } + /** + * + * + *
+     * Storage class of the object.
+     * 
+ * + * string storage_class = 5; + * + * @return This builder for chaining. + */ + public Builder clearStorageClass() { + + storageClass_ = getDefaultInstance().getStorageClass(); + onChanged(); + return this; + } + /** + * + * + *
+     * Storage class of the object.
+     * 
+ * + * string storage_class = 5; + * + * @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; + } + + private long size_; + /** + * + * + *
+     * Output only. Content-Length of the object data in bytes, matching
+     * [https://tools.ietf.org/html/rfc7230#section-3.3.2][RFC 7230 §3.3.2].
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * int64 size = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The size. + */ + @java.lang.Override + public long getSize() { + return size_; + } + /** + * + * + *
+     * Output only. Content-Length of the object data in bytes, matching
+     * [https://tools.ietf.org/html/rfc7230#section-3.3.2][RFC 7230 §3.3.2].
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * int64 size = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The size to set. + * @return This builder for chaining. + */ + public Builder setSize(long value) { + + size_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Content-Length of the object data in bytes, matching
+     * [https://tools.ietf.org/html/rfc7230#section-3.3.2][RFC 7230 §3.3.2].
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * int64 size = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearSize() { + + size_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object contentEncoding_ = ""; + /** + * + * + *
+     * Content-Encoding of the object data, matching
+     * [https://tools.ietf.org/html/rfc7231#section-3.1.2.2][RFC 7231 §3.1.2.2]
+     * 
+ * + * string content_encoding = 7; + * + * @return The contentEncoding. + */ + public java.lang.String getContentEncoding() { + java.lang.Object ref = contentEncoding_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + contentEncoding_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Content-Encoding of the object data, matching
+     * [https://tools.ietf.org/html/rfc7231#section-3.1.2.2][RFC 7231 §3.1.2.2]
+     * 
+ * + * string content_encoding = 7; + * + * @return The bytes for contentEncoding. + */ + public com.google.protobuf.ByteString getContentEncodingBytes() { + java.lang.Object ref = contentEncoding_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + contentEncoding_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Content-Encoding of the object data, matching
+     * [https://tools.ietf.org/html/rfc7231#section-3.1.2.2][RFC 7231 §3.1.2.2]
+     * 
+ * + * string content_encoding = 7; + * + * @param value The contentEncoding to set. + * @return This builder for chaining. + */ + public Builder setContentEncoding(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + contentEncoding_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Content-Encoding of the object data, matching
+     * [https://tools.ietf.org/html/rfc7231#section-3.1.2.2][RFC 7231 §3.1.2.2]
+     * 
+ * + * string content_encoding = 7; + * + * @return This builder for chaining. + */ + public Builder clearContentEncoding() { + + contentEncoding_ = getDefaultInstance().getContentEncoding(); + onChanged(); + return this; + } + /** + * + * + *
+     * Content-Encoding of the object data, matching
+     * [https://tools.ietf.org/html/rfc7231#section-3.1.2.2][RFC 7231 §3.1.2.2]
+     * 
+ * + * string content_encoding = 7; + * + * @param value The bytes for contentEncoding to set. + * @return This builder for chaining. + */ + public Builder setContentEncodingBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + contentEncoding_ = value; + onChanged(); + return this; + } + + private java.lang.Object contentDisposition_ = ""; + /** + * + * + *
+     * Content-Disposition of the object data, matching
+     * [https://tools.ietf.org/html/rfc6266][RFC 6266].
+     * 
+ * + * string content_disposition = 8; + * + * @return The contentDisposition. + */ + public java.lang.String getContentDisposition() { + java.lang.Object ref = contentDisposition_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + contentDisposition_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Content-Disposition of the object data, matching
+     * [https://tools.ietf.org/html/rfc6266][RFC 6266].
+     * 
+ * + * string content_disposition = 8; + * + * @return The bytes for contentDisposition. + */ + public com.google.protobuf.ByteString getContentDispositionBytes() { + java.lang.Object ref = contentDisposition_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + contentDisposition_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Content-Disposition of the object data, matching
+     * [https://tools.ietf.org/html/rfc6266][RFC 6266].
+     * 
+ * + * string content_disposition = 8; + * + * @param value The contentDisposition to set. + * @return This builder for chaining. + */ + public Builder setContentDisposition(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + contentDisposition_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Content-Disposition of the object data, matching
+     * [https://tools.ietf.org/html/rfc6266][RFC 6266].
+     * 
+ * + * string content_disposition = 8; + * + * @return This builder for chaining. + */ + public Builder clearContentDisposition() { + + contentDisposition_ = getDefaultInstance().getContentDisposition(); + onChanged(); + return this; + } + /** + * + * + *
+     * Content-Disposition of the object data, matching
+     * [https://tools.ietf.org/html/rfc6266][RFC 6266].
+     * 
+ * + * string content_disposition = 8; + * + * @param value The bytes for contentDisposition to set. + * @return This builder for chaining. + */ + public Builder setContentDispositionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + contentDisposition_ = value; + onChanged(); + return this; + } + + private java.lang.Object cacheControl_ = ""; + /** + * + * + *
+     * Cache-Control directive for the object data, matching
+     * [https://tools.ietf.org/html/rfc7234#section-5.2"][RFC 7234 §5.2].
+     * If omitted, and the object is accessible to all anonymous users, the
+     * default will be `public, max-age=3600`.
+     * 
+ * + * string cache_control = 9; + * + * @return The cacheControl. + */ + public java.lang.String getCacheControl() { + java.lang.Object ref = cacheControl_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cacheControl_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Cache-Control directive for the object data, matching
+     * [https://tools.ietf.org/html/rfc7234#section-5.2"][RFC 7234 §5.2].
+     * If omitted, and the object is accessible to all anonymous users, the
+     * default will be `public, max-age=3600`.
+     * 
+ * + * string cache_control = 9; + * + * @return The bytes for cacheControl. + */ + public com.google.protobuf.ByteString getCacheControlBytes() { + java.lang.Object ref = cacheControl_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cacheControl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Cache-Control directive for the object data, matching
+     * [https://tools.ietf.org/html/rfc7234#section-5.2"][RFC 7234 §5.2].
+     * If omitted, and the object is accessible to all anonymous users, the
+     * default will be `public, max-age=3600`.
+     * 
+ * + * string cache_control = 9; + * + * @param value The cacheControl to set. + * @return This builder for chaining. + */ + public Builder setCacheControl(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + cacheControl_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Cache-Control directive for the object data, matching
+     * [https://tools.ietf.org/html/rfc7234#section-5.2"][RFC 7234 §5.2].
+     * If omitted, and the object is accessible to all anonymous users, the
+     * default will be `public, max-age=3600`.
+     * 
+ * + * string cache_control = 9; + * + * @return This builder for chaining. + */ + public Builder clearCacheControl() { + + cacheControl_ = getDefaultInstance().getCacheControl(); + onChanged(); + return this; + } + /** + * + * + *
+     * Cache-Control directive for the object data, matching
+     * [https://tools.ietf.org/html/rfc7234#section-5.2"][RFC 7234 §5.2].
+     * If omitted, and the object is accessible to all anonymous users, the
+     * default will be `public, max-age=3600`.
+     * 
+ * + * string cache_control = 9; + * + * @param value The bytes for cacheControl to set. + * @return This builder for chaining. + */ + public Builder setCacheControlBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + cacheControl_ = value; + onChanged(); + return this; + } + + private java.util.List acl_ = + java.util.Collections.emptyList(); + + private void ensureAclIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + acl_ = new java.util.ArrayList(acl_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.storage.v2.ObjectAccessControl, + com.google.storage.v2.ObjectAccessControl.Builder, + com.google.storage.v2.ObjectAccessControlOrBuilder> + aclBuilder_; + + /** + * + * + *
+     * Access controls on the object.
+     * If iamConfig.uniformBucketLevelAccess is enabled on the parent
+     * bucket, requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.ObjectAccessControl acl = 10; + */ + public java.util.List getAclList() { + if (aclBuilder_ == null) { + return java.util.Collections.unmodifiableList(acl_); + } else { + return aclBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Access controls on the object.
+     * If iamConfig.uniformBucketLevelAccess is enabled on the parent
+     * bucket, requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.ObjectAccessControl acl = 10; + */ + public int getAclCount() { + if (aclBuilder_ == null) { + return acl_.size(); + } else { + return aclBuilder_.getCount(); + } + } + /** + * + * + *
+     * Access controls on the object.
+     * If iamConfig.uniformBucketLevelAccess is enabled on the parent
+     * bucket, requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.ObjectAccessControl acl = 10; + */ + public com.google.storage.v2.ObjectAccessControl getAcl(int index) { + if (aclBuilder_ == null) { + return acl_.get(index); + } else { + return aclBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Access controls on the object.
+     * If iamConfig.uniformBucketLevelAccess is enabled on the parent
+     * bucket, requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.ObjectAccessControl acl = 10; + */ + public Builder setAcl(int index, com.google.storage.v2.ObjectAccessControl value) { + if (aclBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAclIsMutable(); + acl_.set(index, value); + onChanged(); + } else { + aclBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Access controls on the object.
+     * If iamConfig.uniformBucketLevelAccess is enabled on the parent
+     * bucket, requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.ObjectAccessControl acl = 10; + */ + public Builder setAcl( + int index, com.google.storage.v2.ObjectAccessControl.Builder builderForValue) { + if (aclBuilder_ == null) { + ensureAclIsMutable(); + acl_.set(index, builderForValue.build()); + onChanged(); + } else { + aclBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Access controls on the object.
+     * If iamConfig.uniformBucketLevelAccess is enabled on the parent
+     * bucket, requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.ObjectAccessControl acl = 10; + */ + public Builder addAcl(com.google.storage.v2.ObjectAccessControl value) { + if (aclBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAclIsMutable(); + acl_.add(value); + onChanged(); + } else { + aclBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Access controls on the object.
+     * If iamConfig.uniformBucketLevelAccess is enabled on the parent
+     * bucket, requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.ObjectAccessControl acl = 10; + */ + public Builder addAcl(int index, com.google.storage.v2.ObjectAccessControl value) { + if (aclBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAclIsMutable(); + acl_.add(index, value); + onChanged(); + } else { + aclBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Access controls on the object.
+     * If iamConfig.uniformBucketLevelAccess is enabled on the parent
+     * bucket, requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.ObjectAccessControl acl = 10; + */ + public Builder addAcl(com.google.storage.v2.ObjectAccessControl.Builder builderForValue) { + if (aclBuilder_ == null) { + ensureAclIsMutable(); + acl_.add(builderForValue.build()); + onChanged(); + } else { + aclBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Access controls on the object.
+     * If iamConfig.uniformBucketLevelAccess is enabled on the parent
+     * bucket, requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.ObjectAccessControl acl = 10; + */ + public Builder addAcl( + int index, com.google.storage.v2.ObjectAccessControl.Builder builderForValue) { + if (aclBuilder_ == null) { + ensureAclIsMutable(); + acl_.add(index, builderForValue.build()); + onChanged(); + } else { + aclBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Access controls on the object.
+     * If iamConfig.uniformBucketLevelAccess is enabled on the parent
+     * bucket, requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.ObjectAccessControl acl = 10; + */ + public Builder addAllAcl( + java.lang.Iterable values) { + if (aclBuilder_ == null) { + ensureAclIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, acl_); + onChanged(); + } else { + aclBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Access controls on the object.
+     * If iamConfig.uniformBucketLevelAccess is enabled on the parent
+     * bucket, requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.ObjectAccessControl acl = 10; + */ + public Builder clearAcl() { + if (aclBuilder_ == null) { + acl_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + aclBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Access controls on the object.
+     * If iamConfig.uniformBucketLevelAccess is enabled on the parent
+     * bucket, requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.ObjectAccessControl acl = 10; + */ + public Builder removeAcl(int index) { + if (aclBuilder_ == null) { + ensureAclIsMutable(); + acl_.remove(index); + onChanged(); + } else { + aclBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Access controls on the object.
+     * If iamConfig.uniformBucketLevelAccess is enabled on the parent
+     * bucket, requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.ObjectAccessControl acl = 10; + */ + public com.google.storage.v2.ObjectAccessControl.Builder getAclBuilder(int index) { + return getAclFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Access controls on the object.
+     * If iamConfig.uniformBucketLevelAccess is enabled on the parent
+     * bucket, requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.ObjectAccessControl acl = 10; + */ + public com.google.storage.v2.ObjectAccessControlOrBuilder getAclOrBuilder(int index) { + if (aclBuilder_ == null) { + return acl_.get(index); + } else { + return aclBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Access controls on the object.
+     * If iamConfig.uniformBucketLevelAccess is enabled on the parent
+     * bucket, requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.ObjectAccessControl acl = 10; + */ + public java.util.List + getAclOrBuilderList() { + if (aclBuilder_ != null) { + return aclBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(acl_); + } + } + /** + * + * + *
+     * Access controls on the object.
+     * If iamConfig.uniformBucketLevelAccess is enabled on the parent
+     * bucket, requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.ObjectAccessControl acl = 10; + */ + public com.google.storage.v2.ObjectAccessControl.Builder addAclBuilder() { + return getAclFieldBuilder() + .addBuilder(com.google.storage.v2.ObjectAccessControl.getDefaultInstance()); + } + /** + * + * + *
+     * Access controls on the object.
+     * If iamConfig.uniformBucketLevelAccess is enabled on the parent
+     * bucket, requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.ObjectAccessControl acl = 10; + */ + public com.google.storage.v2.ObjectAccessControl.Builder addAclBuilder(int index) { + return getAclFieldBuilder() + .addBuilder(index, com.google.storage.v2.ObjectAccessControl.getDefaultInstance()); + } + /** + * + * + *
+     * Access controls on the object.
+     * If iamConfig.uniformBucketLevelAccess is enabled on the parent
+     * bucket, requests to set, read, or modify acl is an error.
+     * 
+ * + * repeated .google.storage.v2.ObjectAccessControl acl = 10; + */ + public java.util.List getAclBuilderList() { + return getAclFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.storage.v2.ObjectAccessControl, + com.google.storage.v2.ObjectAccessControl.Builder, + com.google.storage.v2.ObjectAccessControlOrBuilder> + getAclFieldBuilder() { + if (aclBuilder_ == null) { + aclBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.storage.v2.ObjectAccessControl, + com.google.storage.v2.ObjectAccessControl.Builder, + com.google.storage.v2.ObjectAccessControlOrBuilder>( + acl_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + acl_ = null; + } + return aclBuilder_; + } + + private java.lang.Object contentLanguage_ = ""; + /** + * + * + *
+     * Content-Language of the object data, matching
+     * [https://tools.ietf.org/html/rfc7231#section-3.1.3.2][RFC 7231 §3.1.3.2].
+     * 
+ * + * string content_language = 11; + * + * @return The contentLanguage. + */ + public java.lang.String getContentLanguage() { + java.lang.Object ref = contentLanguage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + contentLanguage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Content-Language of the object data, matching
+     * [https://tools.ietf.org/html/rfc7231#section-3.1.3.2][RFC 7231 §3.1.3.2].
+     * 
+ * + * string content_language = 11; + * + * @return The bytes for contentLanguage. + */ + public com.google.protobuf.ByteString getContentLanguageBytes() { + java.lang.Object ref = contentLanguage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + contentLanguage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Content-Language of the object data, matching
+     * [https://tools.ietf.org/html/rfc7231#section-3.1.3.2][RFC 7231 §3.1.3.2].
+     * 
+ * + * string content_language = 11; + * + * @param value The contentLanguage to set. + * @return This builder for chaining. + */ + public Builder setContentLanguage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + contentLanguage_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Content-Language of the object data, matching
+     * [https://tools.ietf.org/html/rfc7231#section-3.1.3.2][RFC 7231 §3.1.3.2].
+     * 
+ * + * string content_language = 11; + * + * @return This builder for chaining. + */ + public Builder clearContentLanguage() { + + contentLanguage_ = getDefaultInstance().getContentLanguage(); + onChanged(); + return this; + } + /** + * + * + *
+     * Content-Language of the object data, matching
+     * [https://tools.ietf.org/html/rfc7231#section-3.1.3.2][RFC 7231 §3.1.3.2].
+     * 
+ * + * string content_language = 11; + * + * @param value The bytes for contentLanguage to set. + * @return This builder for chaining. + */ + public Builder setContentLanguageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + contentLanguage_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp deleteTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + deleteTimeBuilder_; + /** + * + * + *
+     * Output only. The deletion time of the object. Will be returned if and only if this
+     * version of the object has been deleted.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + public boolean hasDeleteTime() { + return deleteTimeBuilder_ != null || deleteTime_ != null; + } + /** + * + * + *
+     * Output only. The deletion time of the object. Will be returned if and only if this
+     * version of the object has been deleted.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The deleteTime. + */ + public com.google.protobuf.Timestamp getDeleteTime() { + if (deleteTimeBuilder_ == null) { + return deleteTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : deleteTime_; + } else { + return deleteTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The deletion time of the object. Will be returned if and only if this
+     * version of the object has been deleted.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDeleteTime(com.google.protobuf.Timestamp value) { + if (deleteTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deleteTime_ = value; + onChanged(); + } else { + deleteTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The deletion time of the object. Will be returned if and only if this
+     * version of the object has been deleted.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDeleteTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (deleteTimeBuilder_ == null) { + deleteTime_ = builderForValue.build(); + onChanged(); + } else { + deleteTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The deletion time of the object. Will be returned if and only if this
+     * version of the object has been deleted.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeDeleteTime(com.google.protobuf.Timestamp value) { + if (deleteTimeBuilder_ == null) { + if (deleteTime_ != null) { + deleteTime_ = + com.google.protobuf.Timestamp.newBuilder(deleteTime_).mergeFrom(value).buildPartial(); + } else { + deleteTime_ = value; + } + onChanged(); + } else { + deleteTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The deletion time of the object. Will be returned if and only if this
+     * version of the object has been deleted.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearDeleteTime() { + if (deleteTimeBuilder_ == null) { + deleteTime_ = null; + onChanged(); + } else { + deleteTime_ = null; + deleteTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The deletion time of the object. Will be returned if and only if this
+     * version of the object has been deleted.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getDeleteTimeBuilder() { + + onChanged(); + return getDeleteTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The deletion time of the object. Will be returned if and only if this
+     * version of the object has been deleted.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder() { + if (deleteTimeBuilder_ != null) { + return deleteTimeBuilder_.getMessageOrBuilder(); + } else { + return deleteTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : deleteTime_; + } + } + /** + * + * + *
+     * Output only. The deletion time of the object. Will be returned if and only if this
+     * version of the object has been deleted.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp delete_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getDeleteTimeFieldBuilder() { + if (deleteTimeBuilder_ == null) { + deleteTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getDeleteTime(), getParentForChildren(), isClean()); + deleteTime_ = null; + } + return deleteTimeBuilder_; + } + + private java.lang.Object contentType_ = ""; + /** + * + * + *
+     * Content-Type of the object data, matching
+     * [https://tools.ietf.org/html/rfc7231#section-3.1.1.5][RFC 7231 §3.1.1.5].
+     * If an object is stored without a Content-Type, it is served as
+     * `application/octet-stream`.
+     * 
+ * + * string content_type = 13; + * + * @return The contentType. + */ + public java.lang.String getContentType() { + java.lang.Object ref = contentType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + contentType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Content-Type of the object data, matching
+     * [https://tools.ietf.org/html/rfc7231#section-3.1.1.5][RFC 7231 §3.1.1.5].
+     * If an object is stored without a Content-Type, it is served as
+     * `application/octet-stream`.
+     * 
+ * + * string content_type = 13; + * + * @return The bytes for contentType. + */ + public com.google.protobuf.ByteString getContentTypeBytes() { + java.lang.Object ref = contentType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + contentType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Content-Type of the object data, matching
+     * [https://tools.ietf.org/html/rfc7231#section-3.1.1.5][RFC 7231 §3.1.1.5].
+     * If an object is stored without a Content-Type, it is served as
+     * `application/octet-stream`.
+     * 
+ * + * string content_type = 13; + * + * @param value The contentType to set. + * @return This builder for chaining. + */ + public Builder setContentType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + contentType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Content-Type of the object data, matching
+     * [https://tools.ietf.org/html/rfc7231#section-3.1.1.5][RFC 7231 §3.1.1.5].
+     * If an object is stored without a Content-Type, it is served as
+     * `application/octet-stream`.
+     * 
+ * + * string content_type = 13; + * + * @return This builder for chaining. + */ + public Builder clearContentType() { + + contentType_ = getDefaultInstance().getContentType(); + onChanged(); + return this; + } + /** + * + * + *
+     * Content-Type of the object data, matching
+     * [https://tools.ietf.org/html/rfc7231#section-3.1.1.5][RFC 7231 §3.1.1.5].
+     * If an object is stored without a Content-Type, it is served as
+     * `application/octet-stream`.
+     * 
+ * + * string content_type = 13; + * + * @param value The bytes for contentType to set. + * @return This builder for chaining. + */ + public Builder setContentTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + contentType_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. The creation time of the object.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. The creation time of the object.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The creation time of the object.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The creation time of the object.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The creation time of the object.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The creation time of the object.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The creation time of the object.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The creation time of the object.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. The creation time of the object.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private int componentCount_; + /** + * + * + *
+     * Output only. Number of underlying components that make up this object. Components are
+     * accumulated by compose operations.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * int32 component_count = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The componentCount. + */ + @java.lang.Override + public int getComponentCount() { + return componentCount_; + } + /** + * + * + *
+     * Output only. Number of underlying components that make up this object. Components are
+     * accumulated by compose operations.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * int32 component_count = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The componentCount to set. + * @return This builder for chaining. + */ + public Builder setComponentCount(int value) { + + componentCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Number of underlying components that make up this object. Components are
+     * accumulated by compose operations.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * int32 component_count = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearComponentCount() { + + componentCount_ = 0; + onChanged(); + return this; + } + + private com.google.storage.v2.ObjectChecksums checksums_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.ObjectChecksums, + com.google.storage.v2.ObjectChecksums.Builder, + com.google.storage.v2.ObjectChecksumsOrBuilder> + checksumsBuilder_; + /** + * + * + *
+     * Output only. Hashes for the data part of this object.
+     * 
+ * + * + * .google.storage.v2.ObjectChecksums checksums = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the checksums field is set. + */ + public boolean hasChecksums() { + return checksumsBuilder_ != null || checksums_ != null; + } + /** + * + * + *
+     * Output only. Hashes for the data part of this object.
+     * 
+ * + * + * .google.storage.v2.ObjectChecksums checksums = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The checksums. + */ + public com.google.storage.v2.ObjectChecksums getChecksums() { + if (checksumsBuilder_ == null) { + return checksums_ == null + ? com.google.storage.v2.ObjectChecksums.getDefaultInstance() + : checksums_; + } else { + return checksumsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Hashes for the data part of this object.
+     * 
+ * + * + * .google.storage.v2.ObjectChecksums checksums = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setChecksums(com.google.storage.v2.ObjectChecksums value) { + if (checksumsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + checksums_ = value; + onChanged(); + } else { + checksumsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Hashes for the data part of this object.
+     * 
+ * + * + * .google.storage.v2.ObjectChecksums checksums = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setChecksums(com.google.storage.v2.ObjectChecksums.Builder builderForValue) { + if (checksumsBuilder_ == null) { + checksums_ = builderForValue.build(); + onChanged(); + } else { + checksumsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Hashes for the data part of this object.
+     * 
+ * + * + * .google.storage.v2.ObjectChecksums checksums = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeChecksums(com.google.storage.v2.ObjectChecksums value) { + if (checksumsBuilder_ == null) { + if (checksums_ != null) { + checksums_ = + com.google.storage.v2.ObjectChecksums.newBuilder(checksums_) + .mergeFrom(value) + .buildPartial(); + } else { + checksums_ = value; + } + onChanged(); + } else { + checksumsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Hashes for the data part of this object.
+     * 
+ * + * + * .google.storage.v2.ObjectChecksums checksums = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearChecksums() { + if (checksumsBuilder_ == null) { + checksums_ = null; + onChanged(); + } else { + checksums_ = null; + checksumsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Hashes for the data part of this object.
+     * 
+ * + * + * .google.storage.v2.ObjectChecksums checksums = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.storage.v2.ObjectChecksums.Builder getChecksumsBuilder() { + + onChanged(); + return getChecksumsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Hashes for the data part of this object.
+     * 
+ * + * + * .google.storage.v2.ObjectChecksums checksums = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.storage.v2.ObjectChecksumsOrBuilder getChecksumsOrBuilder() { + if (checksumsBuilder_ != null) { + return checksumsBuilder_.getMessageOrBuilder(); + } else { + return checksums_ == null + ? com.google.storage.v2.ObjectChecksums.getDefaultInstance() + : checksums_; + } + } + /** + * + * + *
+     * Output only. Hashes for the data part of this object.
+     * 
+ * + * + * .google.storage.v2.ObjectChecksums checksums = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.ObjectChecksums, + com.google.storage.v2.ObjectChecksums.Builder, + com.google.storage.v2.ObjectChecksumsOrBuilder> + getChecksumsFieldBuilder() { + if (checksumsBuilder_ == null) { + checksumsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.ObjectChecksums, + com.google.storage.v2.ObjectChecksums.Builder, + com.google.storage.v2.ObjectChecksumsOrBuilder>( + getChecksums(), getParentForChildren(), isClean()); + checksums_ = null; + } + return checksumsBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. The modification time of the object metadata.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. The modification time of the object metadata.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The modification time of the object metadata.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The modification time of the object metadata.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The modification time of the object metadata.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The modification time of the object metadata.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The modification time of the object metadata.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The modification time of the object metadata.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. The modification time of the object metadata.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private java.lang.Object kmsKey_ = ""; + /** + * + * + *
+     * Cloud KMS Key used to encrypt this object, if the object is encrypted by
+     * such a key.
+     * 
+ * + * string kms_key = 18 [(.google.api.resource_reference) = { ... } + * + * @return The kmsKey. + */ + public java.lang.String getKmsKey() { + java.lang.Object ref = kmsKey_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKey_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Cloud KMS Key used to encrypt this object, if the object is encrypted by
+     * such a key.
+     * 
+ * + * string kms_key = 18 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for kmsKey. + */ + public com.google.protobuf.ByteString getKmsKeyBytes() { + java.lang.Object ref = kmsKey_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Cloud KMS Key used to encrypt this object, if the object is encrypted by
+     * such a key.
+     * 
+ * + * string kms_key = 18 [(.google.api.resource_reference) = { ... } + * + * @param value The kmsKey to set. + * @return This builder for chaining. + */ + public Builder setKmsKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + kmsKey_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Cloud KMS Key used to encrypt this object, if the object is encrypted by
+     * such a key.
+     * 
+ * + * string kms_key = 18 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearKmsKey() { + + kmsKey_ = getDefaultInstance().getKmsKey(); + onChanged(); + return this; + } + /** + * + * + *
+     * Cloud KMS Key used to encrypt this object, if the object is encrypted by
+     * such a key.
+     * 
+ * + * string kms_key = 18 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for kmsKey to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + kmsKey_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp updateStorageClassTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateStorageClassTimeBuilder_; + /** + * + * + *
+     * Output only. The time at which the object's storage class was last changed. When the
+     * object is initially created, it will be set to time_created.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp update_storage_class_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateStorageClassTime field is set. + */ + public boolean hasUpdateStorageClassTime() { + return updateStorageClassTimeBuilder_ != null || updateStorageClassTime_ != null; + } + /** + * + * + *
+     * Output only. The time at which the object's storage class was last changed. When the
+     * object is initially created, it will be set to time_created.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp update_storage_class_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateStorageClassTime. + */ + public com.google.protobuf.Timestamp getUpdateStorageClassTime() { + if (updateStorageClassTimeBuilder_ == null) { + return updateStorageClassTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateStorageClassTime_; + } else { + return updateStorageClassTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time at which the object's storage class was last changed. When the
+     * object is initially created, it will be set to time_created.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp update_storage_class_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateStorageClassTime(com.google.protobuf.Timestamp value) { + if (updateStorageClassTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateStorageClassTime_ = value; + onChanged(); + } else { + updateStorageClassTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time at which the object's storage class was last changed. When the
+     * object is initially created, it will be set to time_created.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp update_storage_class_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateStorageClassTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateStorageClassTimeBuilder_ == null) { + updateStorageClassTime_ = builderForValue.build(); + onChanged(); + } else { + updateStorageClassTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The time at which the object's storage class was last changed. When the
+     * object is initially created, it will be set to time_created.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp update_storage_class_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateStorageClassTime(com.google.protobuf.Timestamp value) { + if (updateStorageClassTimeBuilder_ == null) { + if (updateStorageClassTime_ != null) { + updateStorageClassTime_ = + com.google.protobuf.Timestamp.newBuilder(updateStorageClassTime_) + .mergeFrom(value) + .buildPartial(); + } else { + updateStorageClassTime_ = value; + } + onChanged(); + } else { + updateStorageClassTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time at which the object's storage class was last changed. When the
+     * object is initially created, it will be set to time_created.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp update_storage_class_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateStorageClassTime() { + if (updateStorageClassTimeBuilder_ == null) { + updateStorageClassTime_ = null; + onChanged(); + } else { + updateStorageClassTime_ = null; + updateStorageClassTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The time at which the object's storage class was last changed. When the
+     * object is initially created, it will be set to time_created.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp update_storage_class_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateStorageClassTimeBuilder() { + + onChanged(); + return getUpdateStorageClassTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time at which the object's storage class was last changed. When the
+     * object is initially created, it will be set to time_created.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp update_storage_class_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateStorageClassTimeOrBuilder() { + if (updateStorageClassTimeBuilder_ != null) { + return updateStorageClassTimeBuilder_.getMessageOrBuilder(); + } else { + return updateStorageClassTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateStorageClassTime_; + } + } + /** + * + * + *
+     * Output only. The time at which the object's storage class was last changed. When the
+     * object is initially created, it will be set to time_created.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * + * .google.protobuf.Timestamp update_storage_class_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateStorageClassTimeFieldBuilder() { + if (updateStorageClassTimeBuilder_ == null) { + updateStorageClassTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateStorageClassTime(), getParentForChildren(), isClean()); + updateStorageClassTime_ = null; + } + return updateStorageClassTimeBuilder_; + } + + private boolean temporaryHold_; + /** + * + * + *
+     * Whether an object is under temporary hold. While this flag is set to true,
+     * the object is protected against deletion and overwrites.  A common use case
+     * of this flag is regulatory investigations where objects need to be retained
+     * while the investigation is ongoing. Note that unlike event-based hold,
+     * temporary hold does not impact retention expiration time of an object.
+     * 
+ * + * bool temporary_hold = 20; + * + * @return The temporaryHold. + */ + @java.lang.Override + public boolean getTemporaryHold() { + return temporaryHold_; + } + /** + * + * + *
+     * Whether an object is under temporary hold. While this flag is set to true,
+     * the object is protected against deletion and overwrites.  A common use case
+     * of this flag is regulatory investigations where objects need to be retained
+     * while the investigation is ongoing. Note that unlike event-based hold,
+     * temporary hold does not impact retention expiration time of an object.
+     * 
+ * + * bool temporary_hold = 20; + * + * @param value The temporaryHold to set. + * @return This builder for chaining. + */ + public Builder setTemporaryHold(boolean value) { + + temporaryHold_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether an object is under temporary hold. While this flag is set to true,
+     * the object is protected against deletion and overwrites.  A common use case
+     * of this flag is regulatory investigations where objects need to be retained
+     * while the investigation is ongoing. Note that unlike event-based hold,
+     * temporary hold does not impact retention expiration time of an object.
+     * 
+ * + * bool temporary_hold = 20; + * + * @return This builder for chaining. + */ + public Builder clearTemporaryHold() { + + temporaryHold_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp retentionExpireTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + retentionExpireTimeBuilder_; + /** + * + * + *
+     * A server-determined value that specifies the earliest time that the
+     * object's retention period expires. This value is in
+     * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+     * Note 1: This field is not provided for objects with an active event-based
+     * hold, since retention expiration is unknown until the hold is removed.
+     * Note 2: This value can be provided even when temporary hold is set (so that
+     * the user can reason about policy without having to first unset the
+     * temporary hold).
+     * 
+ * + * .google.protobuf.Timestamp retention_expire_time = 21; + * + * @return Whether the retentionExpireTime field is set. + */ + public boolean hasRetentionExpireTime() { + return retentionExpireTimeBuilder_ != null || retentionExpireTime_ != null; + } + /** + * + * + *
+     * A server-determined value that specifies the earliest time that the
+     * object's retention period expires. This value is in
+     * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+     * Note 1: This field is not provided for objects with an active event-based
+     * hold, since retention expiration is unknown until the hold is removed.
+     * Note 2: This value can be provided even when temporary hold is set (so that
+     * the user can reason about policy without having to first unset the
+     * temporary hold).
+     * 
+ * + * .google.protobuf.Timestamp retention_expire_time = 21; + * + * @return The retentionExpireTime. + */ + public com.google.protobuf.Timestamp getRetentionExpireTime() { + if (retentionExpireTimeBuilder_ == null) { + return retentionExpireTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : retentionExpireTime_; + } else { + return retentionExpireTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * A server-determined value that specifies the earliest time that the
+     * object's retention period expires. This value is in
+     * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+     * Note 1: This field is not provided for objects with an active event-based
+     * hold, since retention expiration is unknown until the hold is removed.
+     * Note 2: This value can be provided even when temporary hold is set (so that
+     * the user can reason about policy without having to first unset the
+     * temporary hold).
+     * 
+ * + * .google.protobuf.Timestamp retention_expire_time = 21; + */ + public Builder setRetentionExpireTime(com.google.protobuf.Timestamp value) { + if (retentionExpireTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + retentionExpireTime_ = value; + onChanged(); + } else { + retentionExpireTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * A server-determined value that specifies the earliest time that the
+     * object's retention period expires. This value is in
+     * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+     * Note 1: This field is not provided for objects with an active event-based
+     * hold, since retention expiration is unknown until the hold is removed.
+     * Note 2: This value can be provided even when temporary hold is set (so that
+     * the user can reason about policy without having to first unset the
+     * temporary hold).
+     * 
+ * + * .google.protobuf.Timestamp retention_expire_time = 21; + */ + public Builder setRetentionExpireTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (retentionExpireTimeBuilder_ == null) { + retentionExpireTime_ = builderForValue.build(); + onChanged(); + } else { + retentionExpireTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * A server-determined value that specifies the earliest time that the
+     * object's retention period expires. This value is in
+     * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+     * Note 1: This field is not provided for objects with an active event-based
+     * hold, since retention expiration is unknown until the hold is removed.
+     * Note 2: This value can be provided even when temporary hold is set (so that
+     * the user can reason about policy without having to first unset the
+     * temporary hold).
+     * 
+ * + * .google.protobuf.Timestamp retention_expire_time = 21; + */ + public Builder mergeRetentionExpireTime(com.google.protobuf.Timestamp value) { + if (retentionExpireTimeBuilder_ == null) { + if (retentionExpireTime_ != null) { + retentionExpireTime_ = + com.google.protobuf.Timestamp.newBuilder(retentionExpireTime_) + .mergeFrom(value) + .buildPartial(); + } else { + retentionExpireTime_ = value; + } + onChanged(); + } else { + retentionExpireTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * A server-determined value that specifies the earliest time that the
+     * object's retention period expires. This value is in
+     * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+     * Note 1: This field is not provided for objects with an active event-based
+     * hold, since retention expiration is unknown until the hold is removed.
+     * Note 2: This value can be provided even when temporary hold is set (so that
+     * the user can reason about policy without having to first unset the
+     * temporary hold).
+     * 
+ * + * .google.protobuf.Timestamp retention_expire_time = 21; + */ + public Builder clearRetentionExpireTime() { + if (retentionExpireTimeBuilder_ == null) { + retentionExpireTime_ = null; + onChanged(); + } else { + retentionExpireTime_ = null; + retentionExpireTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * A server-determined value that specifies the earliest time that the
+     * object's retention period expires. This value is in
+     * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+     * Note 1: This field is not provided for objects with an active event-based
+     * hold, since retention expiration is unknown until the hold is removed.
+     * Note 2: This value can be provided even when temporary hold is set (so that
+     * the user can reason about policy without having to first unset the
+     * temporary hold).
+     * 
+ * + * .google.protobuf.Timestamp retention_expire_time = 21; + */ + public com.google.protobuf.Timestamp.Builder getRetentionExpireTimeBuilder() { + + onChanged(); + return getRetentionExpireTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A server-determined value that specifies the earliest time that the
+     * object's retention period expires. This value is in
+     * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+     * Note 1: This field is not provided for objects with an active event-based
+     * hold, since retention expiration is unknown until the hold is removed.
+     * Note 2: This value can be provided even when temporary hold is set (so that
+     * the user can reason about policy without having to first unset the
+     * temporary hold).
+     * 
+ * + * .google.protobuf.Timestamp retention_expire_time = 21; + */ + public com.google.protobuf.TimestampOrBuilder getRetentionExpireTimeOrBuilder() { + if (retentionExpireTimeBuilder_ != null) { + return retentionExpireTimeBuilder_.getMessageOrBuilder(); + } else { + return retentionExpireTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : retentionExpireTime_; + } + } + /** + * + * + *
+     * A server-determined value that specifies the earliest time that the
+     * object's retention period expires. This value is in
+     * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+     * Note 1: This field is not provided for objects with an active event-based
+     * hold, since retention expiration is unknown until the hold is removed.
+     * Note 2: This value can be provided even when temporary hold is set (so that
+     * the user can reason about policy without having to first unset the
+     * temporary hold).
+     * 
+ * + * .google.protobuf.Timestamp retention_expire_time = 21; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getRetentionExpireTimeFieldBuilder() { + if (retentionExpireTimeBuilder_ == null) { + retentionExpireTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getRetentionExpireTime(), getParentForChildren(), isClean()); + retentionExpireTime_ = null; + } + return retentionExpireTimeBuilder_; + } + + private com.google.protobuf.MapField metadata_; + + private com.google.protobuf.MapField internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField(MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + + private com.google.protobuf.MapField + internalGetMutableMetadata() { + onChanged(); + ; + if (metadata_ == null) { + metadata_ = + com.google.protobuf.MapField.newMapField(MetadataDefaultEntryHolder.defaultEntry); + } + if (!metadata_.isMutable()) { + metadata_ = metadata_.copy(); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + * + * + *
+     * User-provided metadata, in key/value pairs.
+     * 
+ * + * map<string, string> metadata = 22; + */ + @java.lang.Override + public boolean containsMetadata(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetMetadata().getMap().containsKey(key); + } + /** Use {@link #getMetadataMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + * + * + *
+     * User-provided metadata, in key/value pairs.
+     * 
+ * + * map<string, string> metadata = 22; + */ + @java.lang.Override + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + * + * + *
+     * User-provided metadata, in key/value pairs.
+     * 
+ * + * map<string, string> metadata = 22; + */ + @java.lang.Override + public java.lang.String getMetadataOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * User-provided metadata, in key/value pairs.
+     * 
+ * + * map<string, string> metadata = 22; + */ + @java.lang.Override + public java.lang.String getMetadataOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearMetadata() { + internalGetMutableMetadata().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * User-provided metadata, in key/value pairs.
+     * 
+ * + * map<string, string> metadata = 22; + */ + public Builder removeMetadata(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableMetadata().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableMetadata() { + return internalGetMutableMetadata().getMutableMap(); + } + /** + * + * + *
+     * User-provided metadata, in key/value pairs.
+     * 
+ * + * map<string, string> metadata = 22; + */ + public Builder putMetadata(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableMetadata().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * User-provided metadata, in key/value pairs.
+     * 
+ * + * map<string, string> metadata = 22; + */ + public Builder putAllMetadata(java.util.Map values) { + internalGetMutableMetadata().getMutableMap().putAll(values); + return this; + } + + private boolean eventBasedHold_; + /** + * + * + *
+     * Whether an object is under event-based hold.
+     * An event-based hold is a way to force the retention of an object until
+     * after some event occurs. Once the hold is released by explicitly setting
+     * this field to false, the object will become subject to any bucket-level
+     * retention policy, except that the retention duration will be calculated
+     * from the time the event based hold was lifted, rather than the time the
+     * object was created.
+     * In a WriteObject request, not setting this field implies that the value
+     * should be taken from the parent bucket's "default_event_based_hold" field.
+     * In a response, this field will always be set to true or false.
+     * 
+ * + * bool event_based_hold = 23; + * + * @return Whether the eventBasedHold field is set. + */ + @java.lang.Override + public boolean hasEventBasedHold() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Whether an object is under event-based hold.
+     * An event-based hold is a way to force the retention of an object until
+     * after some event occurs. Once the hold is released by explicitly setting
+     * this field to false, the object will become subject to any bucket-level
+     * retention policy, except that the retention duration will be calculated
+     * from the time the event based hold was lifted, rather than the time the
+     * object was created.
+     * In a WriteObject request, not setting this field implies that the value
+     * should be taken from the parent bucket's "default_event_based_hold" field.
+     * In a response, this field will always be set to true or false.
+     * 
+ * + * bool event_based_hold = 23; + * + * @return The eventBasedHold. + */ + @java.lang.Override + public boolean getEventBasedHold() { + return eventBasedHold_; + } + /** + * + * + *
+     * Whether an object is under event-based hold.
+     * An event-based hold is a way to force the retention of an object until
+     * after some event occurs. Once the hold is released by explicitly setting
+     * this field to false, the object will become subject to any bucket-level
+     * retention policy, except that the retention duration will be calculated
+     * from the time the event based hold was lifted, rather than the time the
+     * object was created.
+     * In a WriteObject request, not setting this field implies that the value
+     * should be taken from the parent bucket's "default_event_based_hold" field.
+     * In a response, this field will always be set to true or false.
+     * 
+ * + * bool event_based_hold = 23; + * + * @param value The eventBasedHold to set. + * @return This builder for chaining. + */ + public Builder setEventBasedHold(boolean value) { + bitField0_ |= 0x00000004; + eventBasedHold_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether an object is under event-based hold.
+     * An event-based hold is a way to force the retention of an object until
+     * after some event occurs. Once the hold is released by explicitly setting
+     * this field to false, the object will become subject to any bucket-level
+     * retention policy, except that the retention duration will be calculated
+     * from the time the event based hold was lifted, rather than the time the
+     * object was created.
+     * In a WriteObject request, not setting this field implies that the value
+     * should be taken from the parent bucket's "default_event_based_hold" field.
+     * In a response, this field will always be set to true or false.
+     * 
+ * + * bool event_based_hold = 23; + * + * @return This builder for chaining. + */ + public Builder clearEventBasedHold() { + bitField0_ = (bitField0_ & ~0x00000004); + eventBasedHold_ = false; + onChanged(); + return this; + } + + private com.google.storage.v2.Owner owner_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Owner, + com.google.storage.v2.Owner.Builder, + com.google.storage.v2.OwnerOrBuilder> + ownerBuilder_; + /** + * + * + *
+     * Output only. The owner of the object. This will always be the uploader of the object.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * .google.storage.v2.Owner owner = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the owner field is set. + */ + public boolean hasOwner() { + return ownerBuilder_ != null || owner_ != null; + } + /** + * + * + *
+     * Output only. The owner of the object. This will always be the uploader of the object.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * .google.storage.v2.Owner owner = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The owner. + */ + public com.google.storage.v2.Owner getOwner() { + if (ownerBuilder_ == null) { + return owner_ == null ? com.google.storage.v2.Owner.getDefaultInstance() : owner_; + } else { + return ownerBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The owner of the object. This will always be the uploader of the object.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * .google.storage.v2.Owner owner = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setOwner(com.google.storage.v2.Owner value) { + if (ownerBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + owner_ = value; + onChanged(); + } else { + ownerBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The owner of the object. This will always be the uploader of the object.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * .google.storage.v2.Owner owner = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setOwner(com.google.storage.v2.Owner.Builder builderForValue) { + if (ownerBuilder_ == null) { + owner_ = builderForValue.build(); + onChanged(); + } else { + ownerBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The owner of the object. This will always be the uploader of the object.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * .google.storage.v2.Owner owner = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeOwner(com.google.storage.v2.Owner value) { + if (ownerBuilder_ == null) { + if (owner_ != null) { + owner_ = com.google.storage.v2.Owner.newBuilder(owner_).mergeFrom(value).buildPartial(); + } else { + owner_ = value; + } + onChanged(); + } else { + ownerBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The owner of the object. This will always be the uploader of the object.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * .google.storage.v2.Owner owner = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearOwner() { + if (ownerBuilder_ == null) { + owner_ = null; + onChanged(); + } else { + owner_ = null; + ownerBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The owner of the object. This will always be the uploader of the object.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * .google.storage.v2.Owner owner = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.storage.v2.Owner.Builder getOwnerBuilder() { + + onChanged(); + return getOwnerFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The owner of the object. This will always be the uploader of the object.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * .google.storage.v2.Owner owner = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.storage.v2.OwnerOrBuilder getOwnerOrBuilder() { + if (ownerBuilder_ != null) { + return ownerBuilder_.getMessageOrBuilder(); + } else { + return owner_ == null ? com.google.storage.v2.Owner.getDefaultInstance() : owner_; + } + } + /** + * + * + *
+     * Output only. The owner of the object. This will always be the uploader of the object.
+     * Attempting to set or update this field will result in a
+     * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+     * 
+ * + * .google.storage.v2.Owner owner = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Owner, + com.google.storage.v2.Owner.Builder, + com.google.storage.v2.OwnerOrBuilder> + getOwnerFieldBuilder() { + if (ownerBuilder_ == null) { + ownerBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Owner, + com.google.storage.v2.Owner.Builder, + com.google.storage.v2.OwnerOrBuilder>( + getOwner(), getParentForChildren(), isClean()); + owner_ = null; + } + return ownerBuilder_; + } + + private com.google.storage.v2.Object.CustomerEncryption customerEncryption_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Object.CustomerEncryption, + com.google.storage.v2.Object.CustomerEncryption.Builder, + com.google.storage.v2.Object.CustomerEncryptionOrBuilder> + customerEncryptionBuilder_; + /** + * + * + *
+     * Metadata of customer-supplied encryption key, if the object is encrypted by
+     * such a key.
+     * 
+ * + * .google.storage.v2.Object.CustomerEncryption customer_encryption = 25; + * + * @return Whether the customerEncryption field is set. + */ + public boolean hasCustomerEncryption() { + return customerEncryptionBuilder_ != null || customerEncryption_ != null; + } + /** + * + * + *
+     * Metadata of customer-supplied encryption key, if the object is encrypted by
+     * such a key.
+     * 
+ * + * .google.storage.v2.Object.CustomerEncryption customer_encryption = 25; + * + * @return The customerEncryption. + */ + public com.google.storage.v2.Object.CustomerEncryption getCustomerEncryption() { + if (customerEncryptionBuilder_ == null) { + return customerEncryption_ == null + ? com.google.storage.v2.Object.CustomerEncryption.getDefaultInstance() + : customerEncryption_; + } else { + return customerEncryptionBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Metadata of customer-supplied encryption key, if the object is encrypted by
+     * such a key.
+     * 
+ * + * .google.storage.v2.Object.CustomerEncryption customer_encryption = 25; + */ + public Builder setCustomerEncryption(com.google.storage.v2.Object.CustomerEncryption value) { + if (customerEncryptionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + customerEncryption_ = value; + onChanged(); + } else { + customerEncryptionBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Metadata of customer-supplied encryption key, if the object is encrypted by
+     * such a key.
+     * 
+ * + * .google.storage.v2.Object.CustomerEncryption customer_encryption = 25; + */ + public Builder setCustomerEncryption( + com.google.storage.v2.Object.CustomerEncryption.Builder builderForValue) { + if (customerEncryptionBuilder_ == null) { + customerEncryption_ = builderForValue.build(); + onChanged(); + } else { + customerEncryptionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Metadata of customer-supplied encryption key, if the object is encrypted by
+     * such a key.
+     * 
+ * + * .google.storage.v2.Object.CustomerEncryption customer_encryption = 25; + */ + public Builder mergeCustomerEncryption(com.google.storage.v2.Object.CustomerEncryption value) { + if (customerEncryptionBuilder_ == null) { + if (customerEncryption_ != null) { + customerEncryption_ = + com.google.storage.v2.Object.CustomerEncryption.newBuilder(customerEncryption_) + .mergeFrom(value) + .buildPartial(); + } else { + customerEncryption_ = value; + } + onChanged(); + } else { + customerEncryptionBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Metadata of customer-supplied encryption key, if the object is encrypted by
+     * such a key.
+     * 
+ * + * .google.storage.v2.Object.CustomerEncryption customer_encryption = 25; + */ + public Builder clearCustomerEncryption() { + if (customerEncryptionBuilder_ == null) { + customerEncryption_ = null; + onChanged(); + } else { + customerEncryption_ = null; + customerEncryptionBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Metadata of customer-supplied encryption key, if the object is encrypted by
+     * such a key.
+     * 
+ * + * .google.storage.v2.Object.CustomerEncryption customer_encryption = 25; + */ + public com.google.storage.v2.Object.CustomerEncryption.Builder getCustomerEncryptionBuilder() { + + onChanged(); + return getCustomerEncryptionFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Metadata of customer-supplied encryption key, if the object is encrypted by
+     * such a key.
+     * 
+ * + * .google.storage.v2.Object.CustomerEncryption customer_encryption = 25; + */ + public com.google.storage.v2.Object.CustomerEncryptionOrBuilder + getCustomerEncryptionOrBuilder() { + if (customerEncryptionBuilder_ != null) { + return customerEncryptionBuilder_.getMessageOrBuilder(); + } else { + return customerEncryption_ == null + ? com.google.storage.v2.Object.CustomerEncryption.getDefaultInstance() + : customerEncryption_; + } + } + /** + * + * + *
+     * Metadata of customer-supplied encryption key, if the object is encrypted by
+     * such a key.
+     * 
+ * + * .google.storage.v2.Object.CustomerEncryption customer_encryption = 25; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Object.CustomerEncryption, + com.google.storage.v2.Object.CustomerEncryption.Builder, + com.google.storage.v2.Object.CustomerEncryptionOrBuilder> + getCustomerEncryptionFieldBuilder() { + if (customerEncryptionBuilder_ == null) { + customerEncryptionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Object.CustomerEncryption, + com.google.storage.v2.Object.CustomerEncryption.Builder, + com.google.storage.v2.Object.CustomerEncryptionOrBuilder>( + getCustomerEncryption(), getParentForChildren(), isClean()); + customerEncryption_ = null; + } + return customerEncryptionBuilder_; + } + + private com.google.protobuf.Timestamp customTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + customTimeBuilder_; + /** + * + * + *
+     * A user-specified timestamp set on an object.
+     * 
+ * + * .google.protobuf.Timestamp custom_time = 26; + * + * @return Whether the customTime field is set. + */ + public boolean hasCustomTime() { + return customTimeBuilder_ != null || customTime_ != null; + } + /** + * + * + *
+     * A user-specified timestamp set on an object.
+     * 
+ * + * .google.protobuf.Timestamp custom_time = 26; + * + * @return The customTime. + */ + public com.google.protobuf.Timestamp getCustomTime() { + if (customTimeBuilder_ == null) { + return customTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : customTime_; + } else { + return customTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * A user-specified timestamp set on an object.
+     * 
+ * + * .google.protobuf.Timestamp custom_time = 26; + */ + public Builder setCustomTime(com.google.protobuf.Timestamp value) { + if (customTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + customTime_ = value; + onChanged(); + } else { + customTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * A user-specified timestamp set on an object.
+     * 
+ * + * .google.protobuf.Timestamp custom_time = 26; + */ + public Builder setCustomTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (customTimeBuilder_ == null) { + customTime_ = builderForValue.build(); + onChanged(); + } else { + customTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * A user-specified timestamp set on an object.
+     * 
+ * + * .google.protobuf.Timestamp custom_time = 26; + */ + public Builder mergeCustomTime(com.google.protobuf.Timestamp value) { + if (customTimeBuilder_ == null) { + if (customTime_ != null) { + customTime_ = + com.google.protobuf.Timestamp.newBuilder(customTime_).mergeFrom(value).buildPartial(); + } else { + customTime_ = value; + } + onChanged(); + } else { + customTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * A user-specified timestamp set on an object.
+     * 
+ * + * .google.protobuf.Timestamp custom_time = 26; + */ + public Builder clearCustomTime() { + if (customTimeBuilder_ == null) { + customTime_ = null; + onChanged(); + } else { + customTime_ = null; + customTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * A user-specified timestamp set on an object.
+     * 
+ * + * .google.protobuf.Timestamp custom_time = 26; + */ + public com.google.protobuf.Timestamp.Builder getCustomTimeBuilder() { + + onChanged(); + return getCustomTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A user-specified timestamp set on an object.
+     * 
+ * + * .google.protobuf.Timestamp custom_time = 26; + */ + public com.google.protobuf.TimestampOrBuilder getCustomTimeOrBuilder() { + if (customTimeBuilder_ != null) { + return customTimeBuilder_.getMessageOrBuilder(); + } else { + return customTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : customTime_; + } + } + /** + * + * + *
+     * A user-specified timestamp set on an object.
+     * 
+ * + * .google.protobuf.Timestamp custom_time = 26; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCustomTimeFieldBuilder() { + if (customTimeBuilder_ == null) { + customTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCustomTime(), getParentForChildren(), isClean()); + customTime_ = null; + } + return customTimeBuilder_; + } + + @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.Object) + } + + // @@protoc_insertion_point(class_scope:google.storage.v2.Object) + private static final com.google.storage.v2.Object DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.v2.Object(); + } + + public static com.google.storage.v2.Object getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Object parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Object(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.storage.v2.Object getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectAccessControl.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectAccessControl.java new file mode 100644 index 0000000000..493188fb54 --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectAccessControl.java @@ -0,0 +1,1903 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +package com.google.storage.v2; + +/** + * + * + *
+ * An access-control entry.
+ * 
+ * + * Protobuf type {@code google.storage.v2.ObjectAccessControl} + */ +public final class ObjectAccessControl extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.v2.ObjectAccessControl) + ObjectAccessControlOrBuilder { + private static final long serialVersionUID = 0L; + // Use ObjectAccessControl.newBuilder() to construct. + private ObjectAccessControl(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ObjectAccessControl() { + role_ = ""; + id_ = ""; + entity_ = ""; + entityId_ = ""; + email_ = ""; + domain_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ObjectAccessControl(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ObjectAccessControl( + 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(); + + role_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + id_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + entity_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + entityId_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + email_ = s; + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + domain_ = s; + break; + } + case 58: + { + com.google.storage.v2.ProjectTeam.Builder subBuilder = null; + if (projectTeam_ != null) { + subBuilder = projectTeam_.toBuilder(); + } + projectTeam_ = + input.readMessage(com.google.storage.v2.ProjectTeam.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(projectTeam_); + projectTeam_ = 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_ObjectAccessControl_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ObjectAccessControl_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.ObjectAccessControl.class, + com.google.storage.v2.ObjectAccessControl.Builder.class); + } + + public static final int ROLE_FIELD_NUMBER = 1; + private volatile java.lang.Object role_; + /** + * + * + *
+   * The access permission for the entity.
+   * 
+ * + * string role = 1; + * + * @return The role. + */ + @java.lang.Override + public java.lang.String getRole() { + java.lang.Object ref = role_; + 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(); + role_ = s; + return s; + } + } + /** + * + * + *
+   * The access permission for the entity.
+   * 
+ * + * string role = 1; + * + * @return The bytes for role. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRoleBytes() { + java.lang.Object ref = role_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + role_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ID_FIELD_NUMBER = 2; + private volatile java.lang.Object id_; + /** + * + * + *
+   * The ID of the access-control entry.
+   * 
+ * + * string id = 2; + * + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + java.lang.Object ref = id_; + 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(); + id_ = s; + return s; + } + } + /** + * + * + *
+   * The ID of the access-control entry.
+   * 
+ * + * string id = 2; + * + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENTITY_FIELD_NUMBER = 3; + private volatile java.lang.Object entity_; + /** + * + * + *
+   * The entity holding the permission, in one of the following forms:
+   * * `user-{userid}`
+   * * `user-{email}`
+   * * `group-{groupid}`
+   * * `group-{email}`
+   * * `domain-{domain}`
+   * * `project-{team-projectid}`
+   * * `allUsers`
+   * * `allAuthenticatedUsers`
+   * Examples:
+   * * The user `liz@example.com` would be `user-liz@example.com`.
+   * * The group `example@googlegroups.com` would be
+   * `group-example@googlegroups.com`.
+   * * All members of the Google Apps for Business domain `example.com` would be
+   * `domain-example.com`.
+   * 
+ * + * string entity = 3; + * + * @return The entity. + */ + @java.lang.Override + public java.lang.String getEntity() { + java.lang.Object ref = entity_; + 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(); + entity_ = s; + return s; + } + } + /** + * + * + *
+   * The entity holding the permission, in one of the following forms:
+   * * `user-{userid}`
+   * * `user-{email}`
+   * * `group-{groupid}`
+   * * `group-{email}`
+   * * `domain-{domain}`
+   * * `project-{team-projectid}`
+   * * `allUsers`
+   * * `allAuthenticatedUsers`
+   * Examples:
+   * * The user `liz@example.com` would be `user-liz@example.com`.
+   * * The group `example@googlegroups.com` would be
+   * `group-example@googlegroups.com`.
+   * * All members of the Google Apps for Business domain `example.com` would be
+   * `domain-example.com`.
+   * 
+ * + * string entity = 3; + * + * @return The bytes for entity. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEntityBytes() { + java.lang.Object ref = entity_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + entity_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENTITY_ID_FIELD_NUMBER = 4; + private volatile java.lang.Object entityId_; + /** + * + * + *
+   * The ID for the entity, if any.
+   * 
+ * + * string entity_id = 4; + * + * @return The entityId. + */ + @java.lang.Override + public java.lang.String getEntityId() { + java.lang.Object ref = entityId_; + 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(); + entityId_ = s; + return s; + } + } + /** + * + * + *
+   * The ID for the entity, if any.
+   * 
+ * + * string entity_id = 4; + * + * @return The bytes for entityId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEntityIdBytes() { + java.lang.Object ref = entityId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + entityId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EMAIL_FIELD_NUMBER = 5; + private volatile java.lang.Object email_; + /** + * + * + *
+   * The email address associated with the entity, if any.
+   * 
+ * + * string email = 5; + * + * @return The email. + */ + @java.lang.Override + public java.lang.String getEmail() { + java.lang.Object ref = email_; + 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(); + email_ = s; + return s; + } + } + /** + * + * + *
+   * The email address associated with the entity, if any.
+   * 
+ * + * string email = 5; + * + * @return The bytes for email. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEmailBytes() { + java.lang.Object ref = email_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + email_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DOMAIN_FIELD_NUMBER = 6; + private volatile java.lang.Object domain_; + /** + * + * + *
+   * The domain associated with the entity, if any.
+   * 
+ * + * string domain = 6; + * + * @return The domain. + */ + @java.lang.Override + public java.lang.String getDomain() { + java.lang.Object ref = domain_; + 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(); + domain_ = s; + return s; + } + } + /** + * + * + *
+   * The domain associated with the entity, if any.
+   * 
+ * + * string domain = 6; + * + * @return The bytes for domain. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDomainBytes() { + java.lang.Object ref = domain_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + domain_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_TEAM_FIELD_NUMBER = 7; + private com.google.storage.v2.ProjectTeam projectTeam_; + /** + * + * + *
+   * The project team associated with the entity, if any.
+   * 
+ * + * .google.storage.v2.ProjectTeam project_team = 7; + * + * @return Whether the projectTeam field is set. + */ + @java.lang.Override + public boolean hasProjectTeam() { + return projectTeam_ != null; + } + /** + * + * + *
+   * The project team associated with the entity, if any.
+   * 
+ * + * .google.storage.v2.ProjectTeam project_team = 7; + * + * @return The projectTeam. + */ + @java.lang.Override + public com.google.storage.v2.ProjectTeam getProjectTeam() { + return projectTeam_ == null + ? com.google.storage.v2.ProjectTeam.getDefaultInstance() + : projectTeam_; + } + /** + * + * + *
+   * The project team associated with the entity, if any.
+   * 
+ * + * .google.storage.v2.ProjectTeam project_team = 7; + */ + @java.lang.Override + public com.google.storage.v2.ProjectTeamOrBuilder getProjectTeamOrBuilder() { + return getProjectTeam(); + } + + 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 (!getRoleBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, role_); + } + if (!getIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, id_); + } + if (!getEntityBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, entity_); + } + if (!getEntityIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, entityId_); + } + if (!getEmailBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, email_); + } + if (!getDomainBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, domain_); + } + if (projectTeam_ != null) { + output.writeMessage(7, getProjectTeam()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getRoleBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, role_); + } + if (!getIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, id_); + } + if (!getEntityBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, entity_); + } + if (!getEntityIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, entityId_); + } + if (!getEmailBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, email_); + } + if (!getDomainBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, domain_); + } + if (projectTeam_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getProjectTeam()); + } + 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.ObjectAccessControl)) { + return super.equals(obj); + } + com.google.storage.v2.ObjectAccessControl other = + (com.google.storage.v2.ObjectAccessControl) obj; + + if (!getRole().equals(other.getRole())) return false; + if (!getId().equals(other.getId())) return false; + if (!getEntity().equals(other.getEntity())) return false; + if (!getEntityId().equals(other.getEntityId())) return false; + if (!getEmail().equals(other.getEmail())) return false; + if (!getDomain().equals(other.getDomain())) return false; + if (hasProjectTeam() != other.hasProjectTeam()) return false; + if (hasProjectTeam()) { + if (!getProjectTeam().equals(other.getProjectTeam())) 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) + ROLE_FIELD_NUMBER; + hash = (53 * hash) + getRole().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + hash = (37 * hash) + ENTITY_FIELD_NUMBER; + hash = (53 * hash) + getEntity().hashCode(); + hash = (37 * hash) + ENTITY_ID_FIELD_NUMBER; + hash = (53 * hash) + getEntityId().hashCode(); + hash = (37 * hash) + EMAIL_FIELD_NUMBER; + hash = (53 * hash) + getEmail().hashCode(); + hash = (37 * hash) + DOMAIN_FIELD_NUMBER; + hash = (53 * hash) + getDomain().hashCode(); + if (hasProjectTeam()) { + hash = (37 * hash) + PROJECT_TEAM_FIELD_NUMBER; + hash = (53 * hash) + getProjectTeam().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.v2.ObjectAccessControl parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.ObjectAccessControl 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.ObjectAccessControl parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.ObjectAccessControl 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.ObjectAccessControl parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.ObjectAccessControl parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.ObjectAccessControl parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.ObjectAccessControl 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.ObjectAccessControl parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.v2.ObjectAccessControl 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.ObjectAccessControl parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.ObjectAccessControl 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.ObjectAccessControl 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 access-control entry.
+   * 
+ * + * Protobuf type {@code google.storage.v2.ObjectAccessControl} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.ObjectAccessControl) + com.google.storage.v2.ObjectAccessControlOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ObjectAccessControl_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ObjectAccessControl_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.ObjectAccessControl.class, + com.google.storage.v2.ObjectAccessControl.Builder.class); + } + + // Construct using com.google.storage.v2.ObjectAccessControl.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + role_ = ""; + + id_ = ""; + + entity_ = ""; + + entityId_ = ""; + + email_ = ""; + + domain_ = ""; + + if (projectTeamBuilder_ == null) { + projectTeam_ = null; + } else { + projectTeam_ = null; + projectTeamBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ObjectAccessControl_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.ObjectAccessControl getDefaultInstanceForType() { + return com.google.storage.v2.ObjectAccessControl.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.ObjectAccessControl build() { + com.google.storage.v2.ObjectAccessControl result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.ObjectAccessControl buildPartial() { + com.google.storage.v2.ObjectAccessControl result = + new com.google.storage.v2.ObjectAccessControl(this); + result.role_ = role_; + result.id_ = id_; + result.entity_ = entity_; + result.entityId_ = entityId_; + result.email_ = email_; + result.domain_ = domain_; + if (projectTeamBuilder_ == null) { + result.projectTeam_ = projectTeam_; + } else { + result.projectTeam_ = projectTeamBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.storage.v2.ObjectAccessControl) { + return mergeFrom((com.google.storage.v2.ObjectAccessControl) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.ObjectAccessControl other) { + if (other == com.google.storage.v2.ObjectAccessControl.getDefaultInstance()) return this; + if (!other.getRole().isEmpty()) { + role_ = other.role_; + onChanged(); + } + if (!other.getId().isEmpty()) { + id_ = other.id_; + onChanged(); + } + if (!other.getEntity().isEmpty()) { + entity_ = other.entity_; + onChanged(); + } + if (!other.getEntityId().isEmpty()) { + entityId_ = other.entityId_; + onChanged(); + } + if (!other.getEmail().isEmpty()) { + email_ = other.email_; + onChanged(); + } + if (!other.getDomain().isEmpty()) { + domain_ = other.domain_; + onChanged(); + } + if (other.hasProjectTeam()) { + mergeProjectTeam(other.getProjectTeam()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.storage.v2.ObjectAccessControl parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.storage.v2.ObjectAccessControl) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object role_ = ""; + /** + * + * + *
+     * The access permission for the entity.
+     * 
+ * + * string role = 1; + * + * @return The role. + */ + public java.lang.String getRole() { + java.lang.Object ref = role_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + role_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The access permission for the entity.
+     * 
+ * + * string role = 1; + * + * @return The bytes for role. + */ + public com.google.protobuf.ByteString getRoleBytes() { + java.lang.Object ref = role_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + role_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The access permission for the entity.
+     * 
+ * + * string role = 1; + * + * @param value The role to set. + * @return This builder for chaining. + */ + public Builder setRole(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + role_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The access permission for the entity.
+     * 
+ * + * string role = 1; + * + * @return This builder for chaining. + */ + public Builder clearRole() { + + role_ = getDefaultInstance().getRole(); + onChanged(); + return this; + } + /** + * + * + *
+     * The access permission for the entity.
+     * 
+ * + * string role = 1; + * + * @param value The bytes for role to set. + * @return This builder for chaining. + */ + public Builder setRoleBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + role_ = value; + onChanged(); + return this; + } + + private java.lang.Object id_ = ""; + /** + * + * + *
+     * The ID of the access-control entry.
+     * 
+ * + * string id = 2; + * + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The ID of the access-control entry.
+     * 
+ * + * string id = 2; + * + * @return The bytes for id. + */ + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The ID of the access-control entry.
+     * 
+ * + * string id = 2; + * + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + id_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The ID of the access-control entry.
+     * 
+ * + * string id = 2; + * + * @return This builder for chaining. + */ + public Builder clearId() { + + id_ = getDefaultInstance().getId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The ID of the access-control entry.
+     * 
+ * + * string id = 2; + * + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + id_ = value; + onChanged(); + return this; + } + + private java.lang.Object entity_ = ""; + /** + * + * + *
+     * The entity holding the permission, in one of the following forms:
+     * * `user-{userid}`
+     * * `user-{email}`
+     * * `group-{groupid}`
+     * * `group-{email}`
+     * * `domain-{domain}`
+     * * `project-{team-projectid}`
+     * * `allUsers`
+     * * `allAuthenticatedUsers`
+     * Examples:
+     * * The user `liz@example.com` would be `user-liz@example.com`.
+     * * The group `example@googlegroups.com` would be
+     * `group-example@googlegroups.com`.
+     * * All members of the Google Apps for Business domain `example.com` would be
+     * `domain-example.com`.
+     * 
+ * + * string entity = 3; + * + * @return The entity. + */ + public java.lang.String getEntity() { + java.lang.Object ref = entity_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + entity_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The entity holding the permission, in one of the following forms:
+     * * `user-{userid}`
+     * * `user-{email}`
+     * * `group-{groupid}`
+     * * `group-{email}`
+     * * `domain-{domain}`
+     * * `project-{team-projectid}`
+     * * `allUsers`
+     * * `allAuthenticatedUsers`
+     * Examples:
+     * * The user `liz@example.com` would be `user-liz@example.com`.
+     * * The group `example@googlegroups.com` would be
+     * `group-example@googlegroups.com`.
+     * * All members of the Google Apps for Business domain `example.com` would be
+     * `domain-example.com`.
+     * 
+ * + * string entity = 3; + * + * @return The bytes for entity. + */ + public com.google.protobuf.ByteString getEntityBytes() { + java.lang.Object ref = entity_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + entity_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The entity holding the permission, in one of the following forms:
+     * * `user-{userid}`
+     * * `user-{email}`
+     * * `group-{groupid}`
+     * * `group-{email}`
+     * * `domain-{domain}`
+     * * `project-{team-projectid}`
+     * * `allUsers`
+     * * `allAuthenticatedUsers`
+     * Examples:
+     * * The user `liz@example.com` would be `user-liz@example.com`.
+     * * The group `example@googlegroups.com` would be
+     * `group-example@googlegroups.com`.
+     * * All members of the Google Apps for Business domain `example.com` would be
+     * `domain-example.com`.
+     * 
+ * + * string entity = 3; + * + * @param value The entity to set. + * @return This builder for chaining. + */ + public Builder setEntity(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + entity_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The entity holding the permission, in one of the following forms:
+     * * `user-{userid}`
+     * * `user-{email}`
+     * * `group-{groupid}`
+     * * `group-{email}`
+     * * `domain-{domain}`
+     * * `project-{team-projectid}`
+     * * `allUsers`
+     * * `allAuthenticatedUsers`
+     * Examples:
+     * * The user `liz@example.com` would be `user-liz@example.com`.
+     * * The group `example@googlegroups.com` would be
+     * `group-example@googlegroups.com`.
+     * * All members of the Google Apps for Business domain `example.com` would be
+     * `domain-example.com`.
+     * 
+ * + * string entity = 3; + * + * @return This builder for chaining. + */ + public Builder clearEntity() { + + entity_ = getDefaultInstance().getEntity(); + onChanged(); + return this; + } + /** + * + * + *
+     * The entity holding the permission, in one of the following forms:
+     * * `user-{userid}`
+     * * `user-{email}`
+     * * `group-{groupid}`
+     * * `group-{email}`
+     * * `domain-{domain}`
+     * * `project-{team-projectid}`
+     * * `allUsers`
+     * * `allAuthenticatedUsers`
+     * Examples:
+     * * The user `liz@example.com` would be `user-liz@example.com`.
+     * * The group `example@googlegroups.com` would be
+     * `group-example@googlegroups.com`.
+     * * All members of the Google Apps for Business domain `example.com` would be
+     * `domain-example.com`.
+     * 
+ * + * string entity = 3; + * + * @param value The bytes for entity to set. + * @return This builder for chaining. + */ + public Builder setEntityBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + entity_ = value; + onChanged(); + return this; + } + + private java.lang.Object entityId_ = ""; + /** + * + * + *
+     * The ID for the entity, if any.
+     * 
+ * + * string entity_id = 4; + * + * @return The entityId. + */ + public java.lang.String getEntityId() { + java.lang.Object ref = entityId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + entityId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The ID for the entity, if any.
+     * 
+ * + * string entity_id = 4; + * + * @return The bytes for entityId. + */ + public com.google.protobuf.ByteString getEntityIdBytes() { + java.lang.Object ref = entityId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + entityId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The ID for the entity, if any.
+     * 
+ * + * string entity_id = 4; + * + * @param value The entityId to set. + * @return This builder for chaining. + */ + public Builder setEntityId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + entityId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The ID for the entity, if any.
+     * 
+ * + * string entity_id = 4; + * + * @return This builder for chaining. + */ + public Builder clearEntityId() { + + entityId_ = getDefaultInstance().getEntityId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The ID for the entity, if any.
+     * 
+ * + * string entity_id = 4; + * + * @param value The bytes for entityId to set. + * @return This builder for chaining. + */ + public Builder setEntityIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + entityId_ = value; + onChanged(); + return this; + } + + private java.lang.Object email_ = ""; + /** + * + * + *
+     * The email address associated with the entity, if any.
+     * 
+ * + * string email = 5; + * + * @return The email. + */ + public java.lang.String getEmail() { + java.lang.Object ref = email_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + email_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The email address associated with the entity, if any.
+     * 
+ * + * string email = 5; + * + * @return The bytes for email. + */ + public com.google.protobuf.ByteString getEmailBytes() { + java.lang.Object ref = email_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + email_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The email address associated with the entity, if any.
+     * 
+ * + * string email = 5; + * + * @param value The email to set. + * @return This builder for chaining. + */ + public Builder setEmail(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + email_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The email address associated with the entity, if any.
+     * 
+ * + * string email = 5; + * + * @return This builder for chaining. + */ + public Builder clearEmail() { + + email_ = getDefaultInstance().getEmail(); + onChanged(); + return this; + } + /** + * + * + *
+     * The email address associated with the entity, if any.
+     * 
+ * + * string email = 5; + * + * @param value The bytes for email to set. + * @return This builder for chaining. + */ + public Builder setEmailBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + email_ = value; + onChanged(); + return this; + } + + private java.lang.Object domain_ = ""; + /** + * + * + *
+     * The domain associated with the entity, if any.
+     * 
+ * + * string domain = 6; + * + * @return The domain. + */ + public java.lang.String getDomain() { + java.lang.Object ref = domain_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + domain_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The domain associated with the entity, if any.
+     * 
+ * + * string domain = 6; + * + * @return The bytes for domain. + */ + public com.google.protobuf.ByteString getDomainBytes() { + java.lang.Object ref = domain_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + domain_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The domain associated with the entity, if any.
+     * 
+ * + * string domain = 6; + * + * @param value The domain to set. + * @return This builder for chaining. + */ + public Builder setDomain(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + domain_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The domain associated with the entity, if any.
+     * 
+ * + * string domain = 6; + * + * @return This builder for chaining. + */ + public Builder clearDomain() { + + domain_ = getDefaultInstance().getDomain(); + onChanged(); + return this; + } + /** + * + * + *
+     * The domain associated with the entity, if any.
+     * 
+ * + * string domain = 6; + * + * @param value The bytes for domain to set. + * @return This builder for chaining. + */ + public Builder setDomainBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + domain_ = value; + onChanged(); + return this; + } + + private com.google.storage.v2.ProjectTeam projectTeam_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.ProjectTeam, + com.google.storage.v2.ProjectTeam.Builder, + com.google.storage.v2.ProjectTeamOrBuilder> + projectTeamBuilder_; + /** + * + * + *
+     * The project team associated with the entity, if any.
+     * 
+ * + * .google.storage.v2.ProjectTeam project_team = 7; + * + * @return Whether the projectTeam field is set. + */ + public boolean hasProjectTeam() { + return projectTeamBuilder_ != null || projectTeam_ != null; + } + /** + * + * + *
+     * The project team associated with the entity, if any.
+     * 
+ * + * .google.storage.v2.ProjectTeam project_team = 7; + * + * @return The projectTeam. + */ + public com.google.storage.v2.ProjectTeam getProjectTeam() { + if (projectTeamBuilder_ == null) { + return projectTeam_ == null + ? com.google.storage.v2.ProjectTeam.getDefaultInstance() + : projectTeam_; + } else { + return projectTeamBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The project team associated with the entity, if any.
+     * 
+ * + * .google.storage.v2.ProjectTeam project_team = 7; + */ + public Builder setProjectTeam(com.google.storage.v2.ProjectTeam value) { + if (projectTeamBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + projectTeam_ = value; + onChanged(); + } else { + projectTeamBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The project team associated with the entity, if any.
+     * 
+ * + * .google.storage.v2.ProjectTeam project_team = 7; + */ + public Builder setProjectTeam(com.google.storage.v2.ProjectTeam.Builder builderForValue) { + if (projectTeamBuilder_ == null) { + projectTeam_ = builderForValue.build(); + onChanged(); + } else { + projectTeamBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The project team associated with the entity, if any.
+     * 
+ * + * .google.storage.v2.ProjectTeam project_team = 7; + */ + public Builder mergeProjectTeam(com.google.storage.v2.ProjectTeam value) { + if (projectTeamBuilder_ == null) { + if (projectTeam_ != null) { + projectTeam_ = + com.google.storage.v2.ProjectTeam.newBuilder(projectTeam_) + .mergeFrom(value) + .buildPartial(); + } else { + projectTeam_ = value; + } + onChanged(); + } else { + projectTeamBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The project team associated with the entity, if any.
+     * 
+ * + * .google.storage.v2.ProjectTeam project_team = 7; + */ + public Builder clearProjectTeam() { + if (projectTeamBuilder_ == null) { + projectTeam_ = null; + onChanged(); + } else { + projectTeam_ = null; + projectTeamBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The project team associated with the entity, if any.
+     * 
+ * + * .google.storage.v2.ProjectTeam project_team = 7; + */ + public com.google.storage.v2.ProjectTeam.Builder getProjectTeamBuilder() { + + onChanged(); + return getProjectTeamFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The project team associated with the entity, if any.
+     * 
+ * + * .google.storage.v2.ProjectTeam project_team = 7; + */ + public com.google.storage.v2.ProjectTeamOrBuilder getProjectTeamOrBuilder() { + if (projectTeamBuilder_ != null) { + return projectTeamBuilder_.getMessageOrBuilder(); + } else { + return projectTeam_ == null + ? com.google.storage.v2.ProjectTeam.getDefaultInstance() + : projectTeam_; + } + } + /** + * + * + *
+     * The project team associated with the entity, if any.
+     * 
+ * + * .google.storage.v2.ProjectTeam project_team = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.ProjectTeam, + com.google.storage.v2.ProjectTeam.Builder, + com.google.storage.v2.ProjectTeamOrBuilder> + getProjectTeamFieldBuilder() { + if (projectTeamBuilder_ == null) { + projectTeamBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.ProjectTeam, + com.google.storage.v2.ProjectTeam.Builder, + com.google.storage.v2.ProjectTeamOrBuilder>( + getProjectTeam(), getParentForChildren(), isClean()); + projectTeam_ = null; + } + return projectTeamBuilder_; + } + + @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.ObjectAccessControl) + } + + // @@protoc_insertion_point(class_scope:google.storage.v2.ObjectAccessControl) + private static final com.google.storage.v2.ObjectAccessControl DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.v2.ObjectAccessControl(); + } + + public static com.google.storage.v2.ObjectAccessControl getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ObjectAccessControl parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ObjectAccessControl(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.storage.v2.ObjectAccessControl getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectAccessControlOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectAccessControlOrBuilder.java new file mode 100644 index 0000000000..a6a45c09cf --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectAccessControlOrBuilder.java @@ -0,0 +1,238 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +package com.google.storage.v2; + +public interface ObjectAccessControlOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.ObjectAccessControl) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The access permission for the entity.
+   * 
+ * + * string role = 1; + * + * @return The role. + */ + java.lang.String getRole(); + /** + * + * + *
+   * The access permission for the entity.
+   * 
+ * + * string role = 1; + * + * @return The bytes for role. + */ + com.google.protobuf.ByteString getRoleBytes(); + + /** + * + * + *
+   * The ID of the access-control entry.
+   * 
+ * + * string id = 2; + * + * @return The id. + */ + java.lang.String getId(); + /** + * + * + *
+   * The ID of the access-control entry.
+   * 
+ * + * string id = 2; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); + + /** + * + * + *
+   * The entity holding the permission, in one of the following forms:
+   * * `user-{userid}`
+   * * `user-{email}`
+   * * `group-{groupid}`
+   * * `group-{email}`
+   * * `domain-{domain}`
+   * * `project-{team-projectid}`
+   * * `allUsers`
+   * * `allAuthenticatedUsers`
+   * Examples:
+   * * The user `liz@example.com` would be `user-liz@example.com`.
+   * * The group `example@googlegroups.com` would be
+   * `group-example@googlegroups.com`.
+   * * All members of the Google Apps for Business domain `example.com` would be
+   * `domain-example.com`.
+   * 
+ * + * string entity = 3; + * + * @return The entity. + */ + java.lang.String getEntity(); + /** + * + * + *
+   * The entity holding the permission, in one of the following forms:
+   * * `user-{userid}`
+   * * `user-{email}`
+   * * `group-{groupid}`
+   * * `group-{email}`
+   * * `domain-{domain}`
+   * * `project-{team-projectid}`
+   * * `allUsers`
+   * * `allAuthenticatedUsers`
+   * Examples:
+   * * The user `liz@example.com` would be `user-liz@example.com`.
+   * * The group `example@googlegroups.com` would be
+   * `group-example@googlegroups.com`.
+   * * All members of the Google Apps for Business domain `example.com` would be
+   * `domain-example.com`.
+   * 
+ * + * string entity = 3; + * + * @return The bytes for entity. + */ + com.google.protobuf.ByteString getEntityBytes(); + + /** + * + * + *
+   * The ID for the entity, if any.
+   * 
+ * + * string entity_id = 4; + * + * @return The entityId. + */ + java.lang.String getEntityId(); + /** + * + * + *
+   * The ID for the entity, if any.
+   * 
+ * + * string entity_id = 4; + * + * @return The bytes for entityId. + */ + com.google.protobuf.ByteString getEntityIdBytes(); + + /** + * + * + *
+   * The email address associated with the entity, if any.
+   * 
+ * + * string email = 5; + * + * @return The email. + */ + java.lang.String getEmail(); + /** + * + * + *
+   * The email address associated with the entity, if any.
+   * 
+ * + * string email = 5; + * + * @return The bytes for email. + */ + com.google.protobuf.ByteString getEmailBytes(); + + /** + * + * + *
+   * The domain associated with the entity, if any.
+   * 
+ * + * string domain = 6; + * + * @return The domain. + */ + java.lang.String getDomain(); + /** + * + * + *
+   * The domain associated with the entity, if any.
+   * 
+ * + * string domain = 6; + * + * @return The bytes for domain. + */ + com.google.protobuf.ByteString getDomainBytes(); + + /** + * + * + *
+   * The project team associated with the entity, if any.
+   * 
+ * + * .google.storage.v2.ProjectTeam project_team = 7; + * + * @return Whether the projectTeam field is set. + */ + boolean hasProjectTeam(); + /** + * + * + *
+   * The project team associated with the entity, if any.
+   * 
+ * + * .google.storage.v2.ProjectTeam project_team = 7; + * + * @return The projectTeam. + */ + com.google.storage.v2.ProjectTeam getProjectTeam(); + /** + * + * + *
+   * The project team associated with the entity, if any.
+   * 
+ * + * .google.storage.v2.ProjectTeam project_team = 7; + */ + com.google.storage.v2.ProjectTeamOrBuilder getProjectTeamOrBuilder(); +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectChecksums.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectChecksums.java new file mode 100644 index 0000000000..aac2345404 --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectChecksums.java @@ -0,0 +1,725 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +package com.google.storage.v2; + +/** + * + * + *
+ * Message used for storing full (not subrange) object checksums.
+ * 
+ * + * Protobuf type {@code google.storage.v2.ObjectChecksums} + */ +public final class ObjectChecksums extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.v2.ObjectChecksums) + ObjectChecksumsOrBuilder { + private static final long serialVersionUID = 0L; + // Use ObjectChecksums.newBuilder() to construct. + private ObjectChecksums(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ObjectChecksums() { + md5Hash_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ObjectChecksums(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ObjectChecksums( + 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 13: + { + bitField0_ |= 0x00000001; + crc32C_ = input.readFixed32(); + break; + } + case 18: + { + md5Hash_ = input.readBytes(); + 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_ObjectChecksums_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ObjectChecksums_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.ObjectChecksums.class, + com.google.storage.v2.ObjectChecksums.Builder.class); + } + + private int bitField0_; + public static final int CRC32C_FIELD_NUMBER = 1; + private int crc32C_; + /** + * + * + *
+   * CRC32C digest of the object data. Computed by the Cloud Storage service for
+   * all written objects.
+   * If set in an WriteObjectRequest, service will validate that the stored
+   * object matches this checksum.
+   * 
+ * + * fixed32 crc32c = 1; + * + * @return Whether the crc32c field is set. + */ + @java.lang.Override + public boolean hasCrc32C() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * CRC32C digest of the object data. Computed by the Cloud Storage service for
+   * all written objects.
+   * If set in an WriteObjectRequest, service will validate that the stored
+   * object matches this checksum.
+   * 
+ * + * fixed32 crc32c = 1; + * + * @return The crc32c. + */ + @java.lang.Override + public int getCrc32C() { + return crc32C_; + } + + public static final int MD5_HASH_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString md5Hash_; + /** + * + * + *
+   * 128 bit MD5 hash of the object data.
+   * For more information about using the MD5 hash, see
+   * [https://cloud.google.com/storage/docs/hashes-etags#json-api][Hashes and
+   * ETags: Best Practices].
+   * Not all objects will provide an MD5 hash. For example, composite objects
+   * provide only crc32c hashes.
+   * This value is equivalent to running `cat object.txt | openssl md5 -binary`
+   * 
+ * + * bytes md5_hash = 2; + * + * @return The md5Hash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMd5Hash() { + return md5Hash_; + } + + 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.writeFixed32(1, crc32C_); + } + if (!md5Hash_.isEmpty()) { + output.writeBytes(2, md5Hash_); + } + 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.computeFixed32Size(1, crc32C_); + } + if (!md5Hash_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream.computeBytesSize(2, md5Hash_); + } + 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.ObjectChecksums)) { + return super.equals(obj); + } + com.google.storage.v2.ObjectChecksums other = (com.google.storage.v2.ObjectChecksums) obj; + + if (hasCrc32C() != other.hasCrc32C()) return false; + if (hasCrc32C()) { + if (getCrc32C() != other.getCrc32C()) return false; + } + if (!getMd5Hash().equals(other.getMd5Hash())) 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 (hasCrc32C()) { + hash = (37 * hash) + CRC32C_FIELD_NUMBER; + hash = (53 * hash) + getCrc32C(); + } + hash = (37 * hash) + MD5_HASH_FIELD_NUMBER; + hash = (53 * hash) + getMd5Hash().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.v2.ObjectChecksums parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.ObjectChecksums 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.ObjectChecksums parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.ObjectChecksums 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.ObjectChecksums parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.ObjectChecksums parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.ObjectChecksums parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.ObjectChecksums 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.ObjectChecksums parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.v2.ObjectChecksums 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.ObjectChecksums parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.ObjectChecksums 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.ObjectChecksums 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; + } + /** + * + * + *
+   * Message used for storing full (not subrange) object checksums.
+   * 
+ * + * Protobuf type {@code google.storage.v2.ObjectChecksums} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.ObjectChecksums) + com.google.storage.v2.ObjectChecksumsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ObjectChecksums_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ObjectChecksums_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.ObjectChecksums.class, + com.google.storage.v2.ObjectChecksums.Builder.class); + } + + // Construct using com.google.storage.v2.ObjectChecksums.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + crc32C_ = 0; + bitField0_ = (bitField0_ & ~0x00000001); + md5Hash_ = com.google.protobuf.ByteString.EMPTY; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ObjectChecksums_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.ObjectChecksums getDefaultInstanceForType() { + return com.google.storage.v2.ObjectChecksums.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.ObjectChecksums build() { + com.google.storage.v2.ObjectChecksums result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.ObjectChecksums buildPartial() { + com.google.storage.v2.ObjectChecksums result = + new com.google.storage.v2.ObjectChecksums(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.crc32C_ = crc32C_; + to_bitField0_ |= 0x00000001; + } + result.md5Hash_ = md5Hash_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.storage.v2.ObjectChecksums) { + return mergeFrom((com.google.storage.v2.ObjectChecksums) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.ObjectChecksums other) { + if (other == com.google.storage.v2.ObjectChecksums.getDefaultInstance()) return this; + if (other.hasCrc32C()) { + setCrc32C(other.getCrc32C()); + } + if (other.getMd5Hash() != com.google.protobuf.ByteString.EMPTY) { + setMd5Hash(other.getMd5Hash()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.storage.v2.ObjectChecksums parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.storage.v2.ObjectChecksums) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private int crc32C_; + /** + * + * + *
+     * CRC32C digest of the object data. Computed by the Cloud Storage service for
+     * all written objects.
+     * If set in an WriteObjectRequest, service will validate that the stored
+     * object matches this checksum.
+     * 
+ * + * fixed32 crc32c = 1; + * + * @return Whether the crc32c field is set. + */ + @java.lang.Override + public boolean hasCrc32C() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * CRC32C digest of the object data. Computed by the Cloud Storage service for
+     * all written objects.
+     * If set in an WriteObjectRequest, service will validate that the stored
+     * object matches this checksum.
+     * 
+ * + * fixed32 crc32c = 1; + * + * @return The crc32c. + */ + @java.lang.Override + public int getCrc32C() { + return crc32C_; + } + /** + * + * + *
+     * CRC32C digest of the object data. Computed by the Cloud Storage service for
+     * all written objects.
+     * If set in an WriteObjectRequest, service will validate that the stored
+     * object matches this checksum.
+     * 
+ * + * fixed32 crc32c = 1; + * + * @param value The crc32c to set. + * @return This builder for chaining. + */ + public Builder setCrc32C(int value) { + bitField0_ |= 0x00000001; + crc32C_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * CRC32C digest of the object data. Computed by the Cloud Storage service for
+     * all written objects.
+     * If set in an WriteObjectRequest, service will validate that the stored
+     * object matches this checksum.
+     * 
+ * + * fixed32 crc32c = 1; + * + * @return This builder for chaining. + */ + public Builder clearCrc32C() { + bitField0_ = (bitField0_ & ~0x00000001); + crc32C_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString md5Hash_ = com.google.protobuf.ByteString.EMPTY; + /** + * + * + *
+     * 128 bit MD5 hash of the object data.
+     * For more information about using the MD5 hash, see
+     * [https://cloud.google.com/storage/docs/hashes-etags#json-api][Hashes and
+     * ETags: Best Practices].
+     * Not all objects will provide an MD5 hash. For example, composite objects
+     * provide only crc32c hashes.
+     * This value is equivalent to running `cat object.txt | openssl md5 -binary`
+     * 
+ * + * bytes md5_hash = 2; + * + * @return The md5Hash. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMd5Hash() { + return md5Hash_; + } + /** + * + * + *
+     * 128 bit MD5 hash of the object data.
+     * For more information about using the MD5 hash, see
+     * [https://cloud.google.com/storage/docs/hashes-etags#json-api][Hashes and
+     * ETags: Best Practices].
+     * Not all objects will provide an MD5 hash. For example, composite objects
+     * provide only crc32c hashes.
+     * This value is equivalent to running `cat object.txt | openssl md5 -binary`
+     * 
+ * + * bytes md5_hash = 2; + * + * @param value The md5Hash to set. + * @return This builder for chaining. + */ + public Builder setMd5Hash(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + md5Hash_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * 128 bit MD5 hash of the object data.
+     * For more information about using the MD5 hash, see
+     * [https://cloud.google.com/storage/docs/hashes-etags#json-api][Hashes and
+     * ETags: Best Practices].
+     * Not all objects will provide an MD5 hash. For example, composite objects
+     * provide only crc32c hashes.
+     * This value is equivalent to running `cat object.txt | openssl md5 -binary`
+     * 
+ * + * bytes md5_hash = 2; + * + * @return This builder for chaining. + */ + public Builder clearMd5Hash() { + + md5Hash_ = getDefaultInstance().getMd5Hash(); + 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.ObjectChecksums) + } + + // @@protoc_insertion_point(class_scope:google.storage.v2.ObjectChecksums) + private static final com.google.storage.v2.ObjectChecksums DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.v2.ObjectChecksums(); + } + + public static com.google.storage.v2.ObjectChecksums getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ObjectChecksums parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ObjectChecksums(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.storage.v2.ObjectChecksums getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectChecksumsOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectChecksumsOrBuilder.java new file mode 100644 index 0000000000..aaddb7537d --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectChecksumsOrBuilder.java @@ -0,0 +1,75 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +package com.google.storage.v2; + +public interface ObjectChecksumsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.ObjectChecksums) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * CRC32C digest of the object data. Computed by the Cloud Storage service for
+   * all written objects.
+   * If set in an WriteObjectRequest, service will validate that the stored
+   * object matches this checksum.
+   * 
+ * + * fixed32 crc32c = 1; + * + * @return Whether the crc32c field is set. + */ + boolean hasCrc32C(); + /** + * + * + *
+   * CRC32C digest of the object data. Computed by the Cloud Storage service for
+   * all written objects.
+   * If set in an WriteObjectRequest, service will validate that the stored
+   * object matches this checksum.
+   * 
+ * + * fixed32 crc32c = 1; + * + * @return The crc32c. + */ + int getCrc32C(); + + /** + * + * + *
+   * 128 bit MD5 hash of the object data.
+   * For more information about using the MD5 hash, see
+   * [https://cloud.google.com/storage/docs/hashes-etags#json-api][Hashes and
+   * ETags: Best Practices].
+   * Not all objects will provide an MD5 hash. For example, composite objects
+   * provide only crc32c hashes.
+   * This value is equivalent to running `cat object.txt | openssl md5 -binary`
+   * 
+ * + * bytes md5_hash = 2; + * + * @return The md5Hash. + */ + com.google.protobuf.ByteString getMd5Hash(); +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectOrBuilder.java new file mode 100644 index 0000000000..5938f1546a --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectOrBuilder.java @@ -0,0 +1,925 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +package com.google.storage.v2; + +public interface ObjectOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.Object) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Immutable. The name of this object. Nearly any sequence of unicode characters is
+   * valid. See
+   * [Guidelines](https://cloud.google.com/storage/docs/naming-objects).
+   * Example: `test.txt`
+   * The `name` field by itself does not uniquely identify a Cloud Storage
+   * object. A Cloud Storage object is uniquely identified by the tuple of
+   * (bucket, object, generation).
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Immutable. The name of this object. Nearly any sequence of unicode characters is
+   * valid. See
+   * [Guidelines](https://cloud.google.com/storage/docs/naming-objects).
+   * Example: `test.txt`
+   * The `name` field by itself does not uniquely identify a Cloud Storage
+   * object. A Cloud Storage object is uniquely identified by the tuple of
+   * (bucket, object, generation).
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Immutable. The name of the bucket containing this object.
+   * Example: `projects/_/buckets/foo`.
+   * 
+ * + * + * string bucket = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The bucket. + */ + java.lang.String getBucket(); + /** + * + * + *
+   * Immutable. The name of the bucket containing this object.
+   * Example: `projects/_/buckets/foo`.
+   * 
+ * + * + * string bucket = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for bucket. + */ + com.google.protobuf.ByteString getBucketBytes(); + + /** + * + * + *
+   * Immutable. The content generation of this object. Used for object versioning.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * int64 generation = 3 [(.google.api.field_behavior) = IMMUTABLE]; + * + * @return The generation. + */ + long getGeneration(); + + /** + * + * + *
+   * Output only. The version of the metadata for this generation of this object. Used for
+   * preconditions and for detecting changes in metadata. A metageneration
+   * number is only meaningful in the context of a particular generation of a
+   * particular object.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * int64 metageneration = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The metageneration. + */ + long getMetageneration(); + + /** + * + * + *
+   * Storage class of the object.
+   * 
+ * + * string storage_class = 5; + * + * @return The storageClass. + */ + java.lang.String getStorageClass(); + /** + * + * + *
+   * Storage class of the object.
+   * 
+ * + * string storage_class = 5; + * + * @return The bytes for storageClass. + */ + com.google.protobuf.ByteString getStorageClassBytes(); + + /** + * + * + *
+   * Output only. Content-Length of the object data in bytes, matching
+   * [https://tools.ietf.org/html/rfc7230#section-3.3.2][RFC 7230 §3.3.2].
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * int64 size = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The size. + */ + long getSize(); + + /** + * + * + *
+   * Content-Encoding of the object data, matching
+   * [https://tools.ietf.org/html/rfc7231#section-3.1.2.2][RFC 7231 §3.1.2.2]
+   * 
+ * + * string content_encoding = 7; + * + * @return The contentEncoding. + */ + java.lang.String getContentEncoding(); + /** + * + * + *
+   * Content-Encoding of the object data, matching
+   * [https://tools.ietf.org/html/rfc7231#section-3.1.2.2][RFC 7231 §3.1.2.2]
+   * 
+ * + * string content_encoding = 7; + * + * @return The bytes for contentEncoding. + */ + com.google.protobuf.ByteString getContentEncodingBytes(); + + /** + * + * + *
+   * Content-Disposition of the object data, matching
+   * [https://tools.ietf.org/html/rfc6266][RFC 6266].
+   * 
+ * + * string content_disposition = 8; + * + * @return The contentDisposition. + */ + java.lang.String getContentDisposition(); + /** + * + * + *
+   * Content-Disposition of the object data, matching
+   * [https://tools.ietf.org/html/rfc6266][RFC 6266].
+   * 
+ * + * string content_disposition = 8; + * + * @return The bytes for contentDisposition. + */ + com.google.protobuf.ByteString getContentDispositionBytes(); + + /** + * + * + *
+   * Cache-Control directive for the object data, matching
+   * [https://tools.ietf.org/html/rfc7234#section-5.2"][RFC 7234 §5.2].
+   * If omitted, and the object is accessible to all anonymous users, the
+   * default will be `public, max-age=3600`.
+   * 
+ * + * string cache_control = 9; + * + * @return The cacheControl. + */ + java.lang.String getCacheControl(); + /** + * + * + *
+   * Cache-Control directive for the object data, matching
+   * [https://tools.ietf.org/html/rfc7234#section-5.2"][RFC 7234 §5.2].
+   * If omitted, and the object is accessible to all anonymous users, the
+   * default will be `public, max-age=3600`.
+   * 
+ * + * string cache_control = 9; + * + * @return The bytes for cacheControl. + */ + com.google.protobuf.ByteString getCacheControlBytes(); + + /** + * + * + *
+   * Access controls on the object.
+   * If iamConfig.uniformBucketLevelAccess is enabled on the parent
+   * bucket, requests to set, read, or modify acl is an error.
+   * 
+ * + * repeated .google.storage.v2.ObjectAccessControl acl = 10; + */ + java.util.List getAclList(); + /** + * + * + *
+   * Access controls on the object.
+   * If iamConfig.uniformBucketLevelAccess is enabled on the parent
+   * bucket, requests to set, read, or modify acl is an error.
+   * 
+ * + * repeated .google.storage.v2.ObjectAccessControl acl = 10; + */ + com.google.storage.v2.ObjectAccessControl getAcl(int index); + /** + * + * + *
+   * Access controls on the object.
+   * If iamConfig.uniformBucketLevelAccess is enabled on the parent
+   * bucket, requests to set, read, or modify acl is an error.
+   * 
+ * + * repeated .google.storage.v2.ObjectAccessControl acl = 10; + */ + int getAclCount(); + /** + * + * + *
+   * Access controls on the object.
+   * If iamConfig.uniformBucketLevelAccess is enabled on the parent
+   * bucket, requests to set, read, or modify acl is an error.
+   * 
+ * + * repeated .google.storage.v2.ObjectAccessControl acl = 10; + */ + java.util.List + getAclOrBuilderList(); + /** + * + * + *
+   * Access controls on the object.
+   * If iamConfig.uniformBucketLevelAccess is enabled on the parent
+   * bucket, requests to set, read, or modify acl is an error.
+   * 
+ * + * repeated .google.storage.v2.ObjectAccessControl acl = 10; + */ + com.google.storage.v2.ObjectAccessControlOrBuilder getAclOrBuilder(int index); + + /** + * + * + *
+   * Content-Language of the object data, matching
+   * [https://tools.ietf.org/html/rfc7231#section-3.1.3.2][RFC 7231 §3.1.3.2].
+   * 
+ * + * string content_language = 11; + * + * @return The contentLanguage. + */ + java.lang.String getContentLanguage(); + /** + * + * + *
+   * Content-Language of the object data, matching
+   * [https://tools.ietf.org/html/rfc7231#section-3.1.3.2][RFC 7231 §3.1.3.2].
+   * 
+ * + * string content_language = 11; + * + * @return The bytes for contentLanguage. + */ + com.google.protobuf.ByteString getContentLanguageBytes(); + + /** + * + * + *
+   * Output only. The deletion time of the object. Will be returned if and only if this
+   * version of the object has been deleted.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the deleteTime field is set. + */ + boolean hasDeleteTime(); + /** + * + * + *
+   * Output only. The deletion time of the object. Will be returned if and only if this
+   * version of the object has been deleted.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The deleteTime. + */ + com.google.protobuf.Timestamp getDeleteTime(); + /** + * + * + *
+   * Output only. The deletion time of the object. Will be returned if and only if this
+   * version of the object has been deleted.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * .google.protobuf.Timestamp delete_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getDeleteTimeOrBuilder(); + + /** + * + * + *
+   * Content-Type of the object data, matching
+   * [https://tools.ietf.org/html/rfc7231#section-3.1.1.5][RFC 7231 §3.1.1.5].
+   * If an object is stored without a Content-Type, it is served as
+   * `application/octet-stream`.
+   * 
+ * + * string content_type = 13; + * + * @return The contentType. + */ + java.lang.String getContentType(); + /** + * + * + *
+   * Content-Type of the object data, matching
+   * [https://tools.ietf.org/html/rfc7231#section-3.1.1.5][RFC 7231 §3.1.1.5].
+   * If an object is stored without a Content-Type, it is served as
+   * `application/octet-stream`.
+   * 
+ * + * string content_type = 13; + * + * @return The bytes for contentType. + */ + com.google.protobuf.ByteString getContentTypeBytes(); + + /** + * + * + *
+   * Output only. The creation time of the object.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * .google.protobuf.Timestamp create_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The creation time of the object.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * .google.protobuf.Timestamp create_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The creation time of the object.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * .google.protobuf.Timestamp create_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Number of underlying components that make up this object. Components are
+   * accumulated by compose operations.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * int32 component_count = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The componentCount. + */ + int getComponentCount(); + + /** + * + * + *
+   * Output only. Hashes for the data part of this object.
+   * 
+ * + * + * .google.storage.v2.ObjectChecksums checksums = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the checksums field is set. + */ + boolean hasChecksums(); + /** + * + * + *
+   * Output only. Hashes for the data part of this object.
+   * 
+ * + * + * .google.storage.v2.ObjectChecksums checksums = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The checksums. + */ + com.google.storage.v2.ObjectChecksums getChecksums(); + /** + * + * + *
+   * Output only. Hashes for the data part of this object.
+   * 
+ * + * + * .google.storage.v2.ObjectChecksums checksums = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.storage.v2.ObjectChecksumsOrBuilder getChecksumsOrBuilder(); + + /** + * + * + *
+   * Output only. The modification time of the object metadata.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * .google.protobuf.Timestamp update_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The modification time of the object metadata.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * .google.protobuf.Timestamp update_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The modification time of the object metadata.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * .google.protobuf.Timestamp update_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Cloud KMS Key used to encrypt this object, if the object is encrypted by
+   * such a key.
+   * 
+ * + * string kms_key = 18 [(.google.api.resource_reference) = { ... } + * + * @return The kmsKey. + */ + java.lang.String getKmsKey(); + /** + * + * + *
+   * Cloud KMS Key used to encrypt this object, if the object is encrypted by
+   * such a key.
+   * 
+ * + * string kms_key = 18 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for kmsKey. + */ + com.google.protobuf.ByteString getKmsKeyBytes(); + + /** + * + * + *
+   * Output only. The time at which the object's storage class was last changed. When the
+   * object is initially created, it will be set to time_created.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * + * .google.protobuf.Timestamp update_storage_class_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateStorageClassTime field is set. + */ + boolean hasUpdateStorageClassTime(); + /** + * + * + *
+   * Output only. The time at which the object's storage class was last changed. When the
+   * object is initially created, it will be set to time_created.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * + * .google.protobuf.Timestamp update_storage_class_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateStorageClassTime. + */ + com.google.protobuf.Timestamp getUpdateStorageClassTime(); + /** + * + * + *
+   * Output only. The time at which the object's storage class was last changed. When the
+   * object is initially created, it will be set to time_created.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * + * .google.protobuf.Timestamp update_storage_class_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateStorageClassTimeOrBuilder(); + + /** + * + * + *
+   * Whether an object is under temporary hold. While this flag is set to true,
+   * the object is protected against deletion and overwrites.  A common use case
+   * of this flag is regulatory investigations where objects need to be retained
+   * while the investigation is ongoing. Note that unlike event-based hold,
+   * temporary hold does not impact retention expiration time of an object.
+   * 
+ * + * bool temporary_hold = 20; + * + * @return The temporaryHold. + */ + boolean getTemporaryHold(); + + /** + * + * + *
+   * A server-determined value that specifies the earliest time that the
+   * object's retention period expires. This value is in
+   * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+   * Note 1: This field is not provided for objects with an active event-based
+   * hold, since retention expiration is unknown until the hold is removed.
+   * Note 2: This value can be provided even when temporary hold is set (so that
+   * the user can reason about policy without having to first unset the
+   * temporary hold).
+   * 
+ * + * .google.protobuf.Timestamp retention_expire_time = 21; + * + * @return Whether the retentionExpireTime field is set. + */ + boolean hasRetentionExpireTime(); + /** + * + * + *
+   * A server-determined value that specifies the earliest time that the
+   * object's retention period expires. This value is in
+   * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+   * Note 1: This field is not provided for objects with an active event-based
+   * hold, since retention expiration is unknown until the hold is removed.
+   * Note 2: This value can be provided even when temporary hold is set (so that
+   * the user can reason about policy without having to first unset the
+   * temporary hold).
+   * 
+ * + * .google.protobuf.Timestamp retention_expire_time = 21; + * + * @return The retentionExpireTime. + */ + com.google.protobuf.Timestamp getRetentionExpireTime(); + /** + * + * + *
+   * A server-determined value that specifies the earliest time that the
+   * object's retention period expires. This value is in
+   * [https://tools.ietf.org/html/rfc3339][RFC 3339] format.
+   * Note 1: This field is not provided for objects with an active event-based
+   * hold, since retention expiration is unknown until the hold is removed.
+   * Note 2: This value can be provided even when temporary hold is set (so that
+   * the user can reason about policy without having to first unset the
+   * temporary hold).
+   * 
+ * + * .google.protobuf.Timestamp retention_expire_time = 21; + */ + com.google.protobuf.TimestampOrBuilder getRetentionExpireTimeOrBuilder(); + + /** + * + * + *
+   * User-provided metadata, in key/value pairs.
+   * 
+ * + * map<string, string> metadata = 22; + */ + int getMetadataCount(); + /** + * + * + *
+   * User-provided metadata, in key/value pairs.
+   * 
+ * + * map<string, string> metadata = 22; + */ + boolean containsMetadata(java.lang.String key); + /** Use {@link #getMetadataMap()} instead. */ + @java.lang.Deprecated + java.util.Map getMetadata(); + /** + * + * + *
+   * User-provided metadata, in key/value pairs.
+   * 
+ * + * map<string, string> metadata = 22; + */ + java.util.Map getMetadataMap(); + /** + * + * + *
+   * User-provided metadata, in key/value pairs.
+   * 
+ * + * map<string, string> metadata = 22; + */ + java.lang.String getMetadataOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * User-provided metadata, in key/value pairs.
+   * 
+ * + * map<string, string> metadata = 22; + */ + java.lang.String getMetadataOrThrow(java.lang.String key); + + /** + * + * + *
+   * Whether an object is under event-based hold.
+   * An event-based hold is a way to force the retention of an object until
+   * after some event occurs. Once the hold is released by explicitly setting
+   * this field to false, the object will become subject to any bucket-level
+   * retention policy, except that the retention duration will be calculated
+   * from the time the event based hold was lifted, rather than the time the
+   * object was created.
+   * In a WriteObject request, not setting this field implies that the value
+   * should be taken from the parent bucket's "default_event_based_hold" field.
+   * In a response, this field will always be set to true or false.
+   * 
+ * + * bool event_based_hold = 23; + * + * @return Whether the eventBasedHold field is set. + */ + boolean hasEventBasedHold(); + /** + * + * + *
+   * Whether an object is under event-based hold.
+   * An event-based hold is a way to force the retention of an object until
+   * after some event occurs. Once the hold is released by explicitly setting
+   * this field to false, the object will become subject to any bucket-level
+   * retention policy, except that the retention duration will be calculated
+   * from the time the event based hold was lifted, rather than the time the
+   * object was created.
+   * In a WriteObject request, not setting this field implies that the value
+   * should be taken from the parent bucket's "default_event_based_hold" field.
+   * In a response, this field will always be set to true or false.
+   * 
+ * + * bool event_based_hold = 23; + * + * @return The eventBasedHold. + */ + boolean getEventBasedHold(); + + /** + * + * + *
+   * Output only. The owner of the object. This will always be the uploader of the object.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * .google.storage.v2.Owner owner = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the owner field is set. + */ + boolean hasOwner(); + /** + * + * + *
+   * Output only. The owner of the object. This will always be the uploader of the object.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * .google.storage.v2.Owner owner = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The owner. + */ + com.google.storage.v2.Owner getOwner(); + /** + * + * + *
+   * Output only. The owner of the object. This will always be the uploader of the object.
+   * Attempting to set or update this field will result in a
+   * [FieldViolation][google.rpc.BadRequest.FieldViolation].
+   * 
+ * + * .google.storage.v2.Owner owner = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + com.google.storage.v2.OwnerOrBuilder getOwnerOrBuilder(); + + /** + * + * + *
+   * Metadata of customer-supplied encryption key, if the object is encrypted by
+   * such a key.
+   * 
+ * + * .google.storage.v2.Object.CustomerEncryption customer_encryption = 25; + * + * @return Whether the customerEncryption field is set. + */ + boolean hasCustomerEncryption(); + /** + * + * + *
+   * Metadata of customer-supplied encryption key, if the object is encrypted by
+   * such a key.
+   * 
+ * + * .google.storage.v2.Object.CustomerEncryption customer_encryption = 25; + * + * @return The customerEncryption. + */ + com.google.storage.v2.Object.CustomerEncryption getCustomerEncryption(); + /** + * + * + *
+   * Metadata of customer-supplied encryption key, if the object is encrypted by
+   * such a key.
+   * 
+ * + * .google.storage.v2.Object.CustomerEncryption customer_encryption = 25; + */ + com.google.storage.v2.Object.CustomerEncryptionOrBuilder getCustomerEncryptionOrBuilder(); + + /** + * + * + *
+   * A user-specified timestamp set on an object.
+   * 
+ * + * .google.protobuf.Timestamp custom_time = 26; + * + * @return Whether the customTime field is set. + */ + boolean hasCustomTime(); + /** + * + * + *
+   * A user-specified timestamp set on an object.
+   * 
+ * + * .google.protobuf.Timestamp custom_time = 26; + * + * @return The customTime. + */ + com.google.protobuf.Timestamp getCustomTime(); + /** + * + * + *
+   * A user-specified timestamp set on an object.
+   * 
+ * + * .google.protobuf.Timestamp custom_time = 26; + */ + com.google.protobuf.TimestampOrBuilder getCustomTimeOrBuilder(); +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/Owner.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/Owner.java new file mode 100644 index 0000000000..e97de65903 --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/Owner.java @@ -0,0 +1,805 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +package com.google.storage.v2; + +/** + * + * + *
+ * The owner of a specific resource.
+ * 
+ * + * Protobuf type {@code google.storage.v2.Owner} + */ +public final class Owner extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.v2.Owner) + OwnerOrBuilder { + private static final long serialVersionUID = 0L; + // Use Owner.newBuilder() to construct. + private Owner(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Owner() { + entity_ = ""; + entityId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Owner(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Owner( + 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(); + + entity_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + entityId_ = 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_Owner_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_Owner_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.Owner.class, com.google.storage.v2.Owner.Builder.class); + } + + public static final int ENTITY_FIELD_NUMBER = 1; + private volatile java.lang.Object entity_; + /** + * + * + *
+   * The entity, in the form `user-`*userId*.
+   * 
+ * + * string entity = 1; + * + * @return The entity. + */ + @java.lang.Override + public java.lang.String getEntity() { + java.lang.Object ref = entity_; + 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(); + entity_ = s; + return s; + } + } + /** + * + * + *
+   * The entity, in the form `user-`*userId*.
+   * 
+ * + * string entity = 1; + * + * @return The bytes for entity. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEntityBytes() { + java.lang.Object ref = entity_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + entity_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENTITY_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object entityId_; + /** + * + * + *
+   * The ID for the entity.
+   * 
+ * + * string entity_id = 2; + * + * @return The entityId. + */ + @java.lang.Override + public java.lang.String getEntityId() { + java.lang.Object ref = entityId_; + 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(); + entityId_ = s; + return s; + } + } + /** + * + * + *
+   * The ID for the entity.
+   * 
+ * + * string entity_id = 2; + * + * @return The bytes for entityId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEntityIdBytes() { + java.lang.Object ref = entityId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + entityId_ = 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 (!getEntityBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, entity_); + } + if (!getEntityIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, entityId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getEntityBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, entity_); + } + if (!getEntityIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, entityId_); + } + 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.Owner)) { + return super.equals(obj); + } + com.google.storage.v2.Owner other = (com.google.storage.v2.Owner) obj; + + if (!getEntity().equals(other.getEntity())) return false; + if (!getEntityId().equals(other.getEntityId())) 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) + ENTITY_FIELD_NUMBER; + hash = (53 * hash) + getEntity().hashCode(); + hash = (37 * hash) + ENTITY_ID_FIELD_NUMBER; + hash = (53 * hash) + getEntityId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.v2.Owner parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.Owner 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.Owner parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.Owner 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.Owner parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.Owner parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.Owner parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.Owner 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.Owner parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.v2.Owner 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.Owner parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.Owner 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.Owner prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The owner of a specific resource.
+   * 
+ * + * Protobuf type {@code google.storage.v2.Owner} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.Owner) + com.google.storage.v2.OwnerOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto.internal_static_google_storage_v2_Owner_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_Owner_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.Owner.class, com.google.storage.v2.Owner.Builder.class); + } + + // Construct using com.google.storage.v2.Owner.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + entity_ = ""; + + entityId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto.internal_static_google_storage_v2_Owner_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.Owner getDefaultInstanceForType() { + return com.google.storage.v2.Owner.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.Owner build() { + com.google.storage.v2.Owner result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.Owner buildPartial() { + com.google.storage.v2.Owner result = new com.google.storage.v2.Owner(this); + result.entity_ = entity_; + result.entityId_ = entityId_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.storage.v2.Owner) { + return mergeFrom((com.google.storage.v2.Owner) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.Owner other) { + if (other == com.google.storage.v2.Owner.getDefaultInstance()) return this; + if (!other.getEntity().isEmpty()) { + entity_ = other.entity_; + onChanged(); + } + if (!other.getEntityId().isEmpty()) { + entityId_ = other.entityId_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.storage.v2.Owner parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.storage.v2.Owner) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object entity_ = ""; + /** + * + * + *
+     * The entity, in the form `user-`*userId*.
+     * 
+ * + * string entity = 1; + * + * @return The entity. + */ + public java.lang.String getEntity() { + java.lang.Object ref = entity_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + entity_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The entity, in the form `user-`*userId*.
+     * 
+ * + * string entity = 1; + * + * @return The bytes for entity. + */ + public com.google.protobuf.ByteString getEntityBytes() { + java.lang.Object ref = entity_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + entity_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The entity, in the form `user-`*userId*.
+     * 
+ * + * string entity = 1; + * + * @param value The entity to set. + * @return This builder for chaining. + */ + public Builder setEntity(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + entity_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The entity, in the form `user-`*userId*.
+     * 
+ * + * string entity = 1; + * + * @return This builder for chaining. + */ + public Builder clearEntity() { + + entity_ = getDefaultInstance().getEntity(); + onChanged(); + return this; + } + /** + * + * + *
+     * The entity, in the form `user-`*userId*.
+     * 
+ * + * string entity = 1; + * + * @param value The bytes for entity to set. + * @return This builder for chaining. + */ + public Builder setEntityBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + entity_ = value; + onChanged(); + return this; + } + + private java.lang.Object entityId_ = ""; + /** + * + * + *
+     * The ID for the entity.
+     * 
+ * + * string entity_id = 2; + * + * @return The entityId. + */ + public java.lang.String getEntityId() { + java.lang.Object ref = entityId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + entityId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The ID for the entity.
+     * 
+ * + * string entity_id = 2; + * + * @return The bytes for entityId. + */ + public com.google.protobuf.ByteString getEntityIdBytes() { + java.lang.Object ref = entityId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + entityId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The ID for the entity.
+     * 
+ * + * string entity_id = 2; + * + * @param value The entityId to set. + * @return This builder for chaining. + */ + public Builder setEntityId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + entityId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The ID for the entity.
+     * 
+ * + * string entity_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearEntityId() { + + entityId_ = getDefaultInstance().getEntityId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The ID for the entity.
+     * 
+ * + * string entity_id = 2; + * + * @param value The bytes for entityId to set. + * @return This builder for chaining. + */ + public Builder setEntityIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + entityId_ = 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.Owner) + } + + // @@protoc_insertion_point(class_scope:google.storage.v2.Owner) + private static final com.google.storage.v2.Owner DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.v2.Owner(); + } + + public static com.google.storage.v2.Owner getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Owner parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Owner(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.storage.v2.Owner getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/OwnerOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/OwnerOrBuilder.java new file mode 100644 index 0000000000..4caffe13d6 --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/OwnerOrBuilder.java @@ -0,0 +1,75 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +package com.google.storage.v2; + +public interface OwnerOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.Owner) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The entity, in the form `user-`*userId*.
+   * 
+ * + * string entity = 1; + * + * @return The entity. + */ + java.lang.String getEntity(); + /** + * + * + *
+   * The entity, in the form `user-`*userId*.
+   * 
+ * + * string entity = 1; + * + * @return The bytes for entity. + */ + com.google.protobuf.ByteString getEntityBytes(); + + /** + * + * + *
+   * The ID for the entity.
+   * 
+ * + * string entity_id = 2; + * + * @return The entityId. + */ + java.lang.String getEntityId(); + /** + * + * + *
+   * The ID for the entity.
+   * 
+ * + * string entity_id = 2; + * + * @return The bytes for entityId. + */ + com.google.protobuf.ByteString getEntityIdBytes(); +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/PredefinedObjectAcl.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/PredefinedObjectAcl.java new file mode 100644 index 0000000000..a6991274a2 --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/PredefinedObjectAcl.java @@ -0,0 +1,277 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +package com.google.storage.v2; + +/** + * + * + *
+ * Predefined or "canned" aliases for sets of specific object ACL entries.
+ * 
+ * + * Protobuf enum {@code google.storage.v2.PredefinedObjectAcl} + */ +public enum PredefinedObjectAcl implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * No predefined ACL.
+   * 
+ * + * PREDEFINED_OBJECT_ACL_UNSPECIFIED = 0; + */ + PREDEFINED_OBJECT_ACL_UNSPECIFIED(0), + /** + * + * + *
+   * Object owner gets `OWNER` access, and
+   * `allAuthenticatedUsers` get `READER` access.
+   * 
+ * + * OBJECT_ACL_AUTHENTICATED_READ = 1; + */ + OBJECT_ACL_AUTHENTICATED_READ(1), + /** + * + * + *
+   * Object owner gets `OWNER` access, and project team owners get
+   * `OWNER` access.
+   * 
+ * + * OBJECT_ACL_BUCKET_OWNER_FULL_CONTROL = 2; + */ + OBJECT_ACL_BUCKET_OWNER_FULL_CONTROL(2), + /** + * + * + *
+   * Object owner gets `OWNER` access, and project team owners get
+   * `READER` access.
+   * 
+ * + * OBJECT_ACL_BUCKET_OWNER_READ = 3; + */ + OBJECT_ACL_BUCKET_OWNER_READ(3), + /** + * + * + *
+   * Object owner gets `OWNER` access.
+   * 
+ * + * OBJECT_ACL_PRIVATE = 4; + */ + OBJECT_ACL_PRIVATE(4), + /** + * + * + *
+   * Object owner gets `OWNER` access, and project team members get
+   * access according to their roles.
+   * 
+ * + * OBJECT_ACL_PROJECT_PRIVATE = 5; + */ + OBJECT_ACL_PROJECT_PRIVATE(5), + /** + * + * + *
+   * Object owner gets `OWNER` access, and `allUsers`
+   * get `READER` access.
+   * 
+ * + * OBJECT_ACL_PUBLIC_READ = 6; + */ + OBJECT_ACL_PUBLIC_READ(6), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * No predefined ACL.
+   * 
+ * + * PREDEFINED_OBJECT_ACL_UNSPECIFIED = 0; + */ + public static final int PREDEFINED_OBJECT_ACL_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Object owner gets `OWNER` access, and
+   * `allAuthenticatedUsers` get `READER` access.
+   * 
+ * + * OBJECT_ACL_AUTHENTICATED_READ = 1; + */ + public static final int OBJECT_ACL_AUTHENTICATED_READ_VALUE = 1; + /** + * + * + *
+   * Object owner gets `OWNER` access, and project team owners get
+   * `OWNER` access.
+   * 
+ * + * OBJECT_ACL_BUCKET_OWNER_FULL_CONTROL = 2; + */ + public static final int OBJECT_ACL_BUCKET_OWNER_FULL_CONTROL_VALUE = 2; + /** + * + * + *
+   * Object owner gets `OWNER` access, and project team owners get
+   * `READER` access.
+   * 
+ * + * OBJECT_ACL_BUCKET_OWNER_READ = 3; + */ + public static final int OBJECT_ACL_BUCKET_OWNER_READ_VALUE = 3; + /** + * + * + *
+   * Object owner gets `OWNER` access.
+   * 
+ * + * OBJECT_ACL_PRIVATE = 4; + */ + public static final int OBJECT_ACL_PRIVATE_VALUE = 4; + /** + * + * + *
+   * Object owner gets `OWNER` access, and project team members get
+   * access according to their roles.
+   * 
+ * + * OBJECT_ACL_PROJECT_PRIVATE = 5; + */ + public static final int OBJECT_ACL_PROJECT_PRIVATE_VALUE = 5; + /** + * + * + *
+   * Object owner gets `OWNER` access, and `allUsers`
+   * get `READER` access.
+   * 
+ * + * OBJECT_ACL_PUBLIC_READ = 6; + */ + public static final int OBJECT_ACL_PUBLIC_READ_VALUE = 6; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static PredefinedObjectAcl 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 PredefinedObjectAcl forNumber(int value) { + switch (value) { + case 0: + return PREDEFINED_OBJECT_ACL_UNSPECIFIED; + case 1: + return OBJECT_ACL_AUTHENTICATED_READ; + case 2: + return OBJECT_ACL_BUCKET_OWNER_FULL_CONTROL; + case 3: + return OBJECT_ACL_BUCKET_OWNER_READ; + case 4: + return OBJECT_ACL_PRIVATE; + case 5: + return OBJECT_ACL_PROJECT_PRIVATE; + case 6: + return OBJECT_ACL_PUBLIC_READ; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public PredefinedObjectAcl findValueByNumber(int number) { + return PredefinedObjectAcl.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.storage.v2.StorageProto.getDescriptor().getEnumTypes().get(0); + } + + private static final PredefinedObjectAcl[] VALUES = values(); + + public static PredefinedObjectAcl valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private PredefinedObjectAcl(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.storage.v2.PredefinedObjectAcl) +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ProjectTeam.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ProjectTeam.java new file mode 100644 index 0000000000..24386ea8ae --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ProjectTeam.java @@ -0,0 +1,810 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +package com.google.storage.v2; + +/** + * + * + *
+ * Represents the Viewers, Editors, or Owners of a given project.
+ * 
+ * + * Protobuf type {@code google.storage.v2.ProjectTeam} + */ +public final class ProjectTeam extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.v2.ProjectTeam) + ProjectTeamOrBuilder { + private static final long serialVersionUID = 0L; + // Use ProjectTeam.newBuilder() to construct. + private ProjectTeam(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ProjectTeam() { + projectNumber_ = ""; + team_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ProjectTeam(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ProjectTeam( + 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(); + + projectNumber_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + team_ = 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_ProjectTeam_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ProjectTeam_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.ProjectTeam.class, + com.google.storage.v2.ProjectTeam.Builder.class); + } + + public static final int PROJECT_NUMBER_FIELD_NUMBER = 1; + private volatile java.lang.Object projectNumber_; + /** + * + * + *
+   * The project number.
+   * 
+ * + * string project_number = 1; + * + * @return The projectNumber. + */ + @java.lang.Override + public java.lang.String getProjectNumber() { + java.lang.Object ref = projectNumber_; + 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(); + projectNumber_ = s; + return s; + } + } + /** + * + * + *
+   * The project number.
+   * 
+ * + * string project_number = 1; + * + * @return The bytes for projectNumber. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectNumberBytes() { + java.lang.Object ref = projectNumber_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectNumber_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TEAM_FIELD_NUMBER = 2; + private volatile java.lang.Object team_; + /** + * + * + *
+   * The team.
+   * 
+ * + * string team = 2; + * + * @return The team. + */ + @java.lang.Override + public java.lang.String getTeam() { + java.lang.Object ref = team_; + 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(); + team_ = s; + return s; + } + } + /** + * + * + *
+   * The team.
+   * 
+ * + * string team = 2; + * + * @return The bytes for team. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTeamBytes() { + java.lang.Object ref = team_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + team_ = 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 (!getProjectNumberBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, projectNumber_); + } + if (!getTeamBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, team_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getProjectNumberBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, projectNumber_); + } + if (!getTeamBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, team_); + } + 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.ProjectTeam)) { + return super.equals(obj); + } + com.google.storage.v2.ProjectTeam other = (com.google.storage.v2.ProjectTeam) obj; + + if (!getProjectNumber().equals(other.getProjectNumber())) return false; + if (!getTeam().equals(other.getTeam())) 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) + PROJECT_NUMBER_FIELD_NUMBER; + hash = (53 * hash) + getProjectNumber().hashCode(); + hash = (37 * hash) + TEAM_FIELD_NUMBER; + hash = (53 * hash) + getTeam().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.v2.ProjectTeam parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.ProjectTeam 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.ProjectTeam parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.ProjectTeam 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.ProjectTeam parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.ProjectTeam parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.ProjectTeam parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.ProjectTeam 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.ProjectTeam parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.v2.ProjectTeam 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.ProjectTeam parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.ProjectTeam 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.ProjectTeam prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents the Viewers, Editors, or Owners of a given project.
+   * 
+ * + * Protobuf type {@code google.storage.v2.ProjectTeam} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.ProjectTeam) + com.google.storage.v2.ProjectTeamOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ProjectTeam_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ProjectTeam_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.ProjectTeam.class, + com.google.storage.v2.ProjectTeam.Builder.class); + } + + // Construct using com.google.storage.v2.ProjectTeam.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + projectNumber_ = ""; + + team_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ProjectTeam_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.ProjectTeam getDefaultInstanceForType() { + return com.google.storage.v2.ProjectTeam.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.ProjectTeam build() { + com.google.storage.v2.ProjectTeam result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.ProjectTeam buildPartial() { + com.google.storage.v2.ProjectTeam result = new com.google.storage.v2.ProjectTeam(this); + result.projectNumber_ = projectNumber_; + result.team_ = team_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.storage.v2.ProjectTeam) { + return mergeFrom((com.google.storage.v2.ProjectTeam) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.ProjectTeam other) { + if (other == com.google.storage.v2.ProjectTeam.getDefaultInstance()) return this; + if (!other.getProjectNumber().isEmpty()) { + projectNumber_ = other.projectNumber_; + onChanged(); + } + if (!other.getTeam().isEmpty()) { + team_ = other.team_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.storage.v2.ProjectTeam parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.storage.v2.ProjectTeam) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object projectNumber_ = ""; + /** + * + * + *
+     * The project number.
+     * 
+ * + * string project_number = 1; + * + * @return The projectNumber. + */ + public java.lang.String getProjectNumber() { + java.lang.Object ref = projectNumber_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + projectNumber_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The project number.
+     * 
+ * + * string project_number = 1; + * + * @return The bytes for projectNumber. + */ + public com.google.protobuf.ByteString getProjectNumberBytes() { + java.lang.Object ref = projectNumber_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectNumber_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The project number.
+     * 
+ * + * string project_number = 1; + * + * @param value The projectNumber to set. + * @return This builder for chaining. + */ + public Builder setProjectNumber(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + projectNumber_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The project number.
+     * 
+ * + * string project_number = 1; + * + * @return This builder for chaining. + */ + public Builder clearProjectNumber() { + + projectNumber_ = getDefaultInstance().getProjectNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The project number.
+     * 
+ * + * string project_number = 1; + * + * @param value The bytes for projectNumber to set. + * @return This builder for chaining. + */ + public Builder setProjectNumberBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + projectNumber_ = value; + onChanged(); + return this; + } + + private java.lang.Object team_ = ""; + /** + * + * + *
+     * The team.
+     * 
+ * + * string team = 2; + * + * @return The team. + */ + public java.lang.String getTeam() { + java.lang.Object ref = team_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + team_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The team.
+     * 
+ * + * string team = 2; + * + * @return The bytes for team. + */ + public com.google.protobuf.ByteString getTeamBytes() { + java.lang.Object ref = team_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + team_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The team.
+     * 
+ * + * string team = 2; + * + * @param value The team to set. + * @return This builder for chaining. + */ + public Builder setTeam(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + team_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The team.
+     * 
+ * + * string team = 2; + * + * @return This builder for chaining. + */ + public Builder clearTeam() { + + team_ = getDefaultInstance().getTeam(); + onChanged(); + return this; + } + /** + * + * + *
+     * The team.
+     * 
+ * + * string team = 2; + * + * @param value The bytes for team to set. + * @return This builder for chaining. + */ + public Builder setTeamBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + team_ = 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.ProjectTeam) + } + + // @@protoc_insertion_point(class_scope:google.storage.v2.ProjectTeam) + private static final com.google.storage.v2.ProjectTeam DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.v2.ProjectTeam(); + } + + public static com.google.storage.v2.ProjectTeam getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ProjectTeam parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ProjectTeam(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.storage.v2.ProjectTeam getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ProjectTeamOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ProjectTeamOrBuilder.java new file mode 100644 index 0000000000..3af551ee1e --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ProjectTeamOrBuilder.java @@ -0,0 +1,75 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +package com.google.storage.v2; + +public interface ProjectTeamOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.ProjectTeam) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The project number.
+   * 
+ * + * string project_number = 1; + * + * @return The projectNumber. + */ + java.lang.String getProjectNumber(); + /** + * + * + *
+   * The project number.
+   * 
+ * + * string project_number = 1; + * + * @return The bytes for projectNumber. + */ + com.google.protobuf.ByteString getProjectNumberBytes(); + + /** + * + * + *
+   * The team.
+   * 
+ * + * string team = 2; + * + * @return The team. + */ + java.lang.String getTeam(); + /** + * + * + *
+   * The team.
+   * 
+ * + * string team = 2; + * + * @return The bytes for team. + */ + com.google.protobuf.ByteString getTeamBytes(); +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/QueryWriteStatusRequest.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/QueryWriteStatusRequest.java new file mode 100644 index 0000000000..a3d479d6ac --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/QueryWriteStatusRequest.java @@ -0,0 +1,1205 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +package com.google.storage.v2; + +/** + * + * + *
+ * Request object for `QueryWriteStatus`.
+ * 
+ * + * Protobuf type {@code google.storage.v2.QueryWriteStatusRequest} + */ +public final class QueryWriteStatusRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.v2.QueryWriteStatusRequest) + QueryWriteStatusRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use QueryWriteStatusRequest.newBuilder() to construct. + private QueryWriteStatusRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QueryWriteStatusRequest() { + uploadId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QueryWriteStatusRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private QueryWriteStatusRequest( + 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(); + + uploadId_ = s; + break; + } + case 18: + { + com.google.storage.v2.CommonObjectRequestParams.Builder subBuilder = null; + if (commonObjectRequestParams_ != null) { + subBuilder = commonObjectRequestParams_.toBuilder(); + } + commonObjectRequestParams_ = + input.readMessage( + com.google.storage.v2.CommonObjectRequestParams.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(commonObjectRequestParams_); + commonObjectRequestParams_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.storage.v2.CommonRequestParams.Builder subBuilder = null; + if (commonRequestParams_ != null) { + subBuilder = commonRequestParams_.toBuilder(); + } + commonRequestParams_ = + input.readMessage( + com.google.storage.v2.CommonRequestParams.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(commonRequestParams_); + commonRequestParams_ = 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_QueryWriteStatusRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_QueryWriteStatusRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.QueryWriteStatusRequest.class, + com.google.storage.v2.QueryWriteStatusRequest.Builder.class); + } + + public static final int UPLOAD_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object uploadId_; + /** + * + * + *
+   * Required. The name of the resume token for the object whose write status is being
+   * requested.
+   * 
+ * + * string upload_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The uploadId. + */ + @java.lang.Override + public java.lang.String getUploadId() { + java.lang.Object ref = uploadId_; + 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(); + uploadId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the resume token for the object whose write status is being
+   * requested.
+   * 
+ * + * string upload_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for uploadId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUploadIdBytes() { + java.lang.Object ref = uploadId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uploadId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int COMMON_OBJECT_REQUEST_PARAMS_FIELD_NUMBER = 2; + private com.google.storage.v2.CommonObjectRequestParams commonObjectRequestParams_; + /** + * + * + *
+   * A set of parameters common to Storage API requests concerning an object.
+   * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 2; + * + * @return Whether the commonObjectRequestParams field is set. + */ + @java.lang.Override + public boolean hasCommonObjectRequestParams() { + return commonObjectRequestParams_ != null; + } + /** + * + * + *
+   * A set of parameters common to Storage API requests concerning an object.
+   * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 2; + * + * @return The commonObjectRequestParams. + */ + @java.lang.Override + public com.google.storage.v2.CommonObjectRequestParams getCommonObjectRequestParams() { + return commonObjectRequestParams_ == null + ? com.google.storage.v2.CommonObjectRequestParams.getDefaultInstance() + : commonObjectRequestParams_; + } + /** + * + * + *
+   * A set of parameters common to Storage API requests concerning an object.
+   * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 2; + */ + @java.lang.Override + public com.google.storage.v2.CommonObjectRequestParamsOrBuilder + getCommonObjectRequestParamsOrBuilder() { + return getCommonObjectRequestParams(); + } + + public static final int COMMON_REQUEST_PARAMS_FIELD_NUMBER = 3; + private com.google.storage.v2.CommonRequestParams commonRequestParams_; + /** + * + * + *
+   * A set of parameters common to all Storage API requests.
+   * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 3; + * + * @return Whether the commonRequestParams field is set. + */ + @java.lang.Override + public boolean hasCommonRequestParams() { + return commonRequestParams_ != null; + } + /** + * + * + *
+   * A set of parameters common to all Storage API requests.
+   * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 3; + * + * @return The commonRequestParams. + */ + @java.lang.Override + public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { + return commonRequestParams_ == null + ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() + : commonRequestParams_; + } + /** + * + * + *
+   * A set of parameters common to all Storage API requests.
+   * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 3; + */ + @java.lang.Override + public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { + return getCommonRequestParams(); + } + + 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 (!getUploadIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uploadId_); + } + if (commonObjectRequestParams_ != null) { + output.writeMessage(2, getCommonObjectRequestParams()); + } + if (commonRequestParams_ != null) { + output.writeMessage(3, getCommonRequestParams()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getUploadIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, uploadId_); + } + if (commonObjectRequestParams_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, getCommonObjectRequestParams()); + } + if (commonRequestParams_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCommonRequestParams()); + } + 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.QueryWriteStatusRequest)) { + return super.equals(obj); + } + com.google.storage.v2.QueryWriteStatusRequest other = + (com.google.storage.v2.QueryWriteStatusRequest) obj; + + if (!getUploadId().equals(other.getUploadId())) return false; + if (hasCommonObjectRequestParams() != other.hasCommonObjectRequestParams()) return false; + if (hasCommonObjectRequestParams()) { + if (!getCommonObjectRequestParams().equals(other.getCommonObjectRequestParams())) + return false; + } + if (hasCommonRequestParams() != other.hasCommonRequestParams()) return false; + if (hasCommonRequestParams()) { + if (!getCommonRequestParams().equals(other.getCommonRequestParams())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + UPLOAD_ID_FIELD_NUMBER; + hash = (53 * hash) + getUploadId().hashCode(); + if (hasCommonObjectRequestParams()) { + hash = (37 * hash) + COMMON_OBJECT_REQUEST_PARAMS_FIELD_NUMBER; + hash = (53 * hash) + getCommonObjectRequestParams().hashCode(); + } + if (hasCommonRequestParams()) { + hash = (37 * hash) + COMMON_REQUEST_PARAMS_FIELD_NUMBER; + hash = (53 * hash) + getCommonRequestParams().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.v2.QueryWriteStatusRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.QueryWriteStatusRequest 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.QueryWriteStatusRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.QueryWriteStatusRequest 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.QueryWriteStatusRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.QueryWriteStatusRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.QueryWriteStatusRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.QueryWriteStatusRequest 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.QueryWriteStatusRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.v2.QueryWriteStatusRequest 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.QueryWriteStatusRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.QueryWriteStatusRequest 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.QueryWriteStatusRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request object for `QueryWriteStatus`.
+   * 
+ * + * Protobuf type {@code google.storage.v2.QueryWriteStatusRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.QueryWriteStatusRequest) + com.google.storage.v2.QueryWriteStatusRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_QueryWriteStatusRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_QueryWriteStatusRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.QueryWriteStatusRequest.class, + com.google.storage.v2.QueryWriteStatusRequest.Builder.class); + } + + // Construct using com.google.storage.v2.QueryWriteStatusRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + uploadId_ = ""; + + if (commonObjectRequestParamsBuilder_ == null) { + commonObjectRequestParams_ = null; + } else { + commonObjectRequestParams_ = null; + commonObjectRequestParamsBuilder_ = null; + } + if (commonRequestParamsBuilder_ == null) { + commonRequestParams_ = null; + } else { + commonRequestParams_ = null; + commonRequestParamsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_QueryWriteStatusRequest_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.QueryWriteStatusRequest getDefaultInstanceForType() { + return com.google.storage.v2.QueryWriteStatusRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.QueryWriteStatusRequest build() { + com.google.storage.v2.QueryWriteStatusRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.QueryWriteStatusRequest buildPartial() { + com.google.storage.v2.QueryWriteStatusRequest result = + new com.google.storage.v2.QueryWriteStatusRequest(this); + result.uploadId_ = uploadId_; + if (commonObjectRequestParamsBuilder_ == null) { + result.commonObjectRequestParams_ = commonObjectRequestParams_; + } else { + result.commonObjectRequestParams_ = commonObjectRequestParamsBuilder_.build(); + } + if (commonRequestParamsBuilder_ == null) { + result.commonRequestParams_ = commonRequestParams_; + } else { + result.commonRequestParams_ = commonRequestParamsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.storage.v2.QueryWriteStatusRequest) { + return mergeFrom((com.google.storage.v2.QueryWriteStatusRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.QueryWriteStatusRequest other) { + if (other == com.google.storage.v2.QueryWriteStatusRequest.getDefaultInstance()) return this; + if (!other.getUploadId().isEmpty()) { + uploadId_ = other.uploadId_; + onChanged(); + } + if (other.hasCommonObjectRequestParams()) { + mergeCommonObjectRequestParams(other.getCommonObjectRequestParams()); + } + if (other.hasCommonRequestParams()) { + mergeCommonRequestParams(other.getCommonRequestParams()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.storage.v2.QueryWriteStatusRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.storage.v2.QueryWriteStatusRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object uploadId_ = ""; + /** + * + * + *
+     * Required. The name of the resume token for the object whose write status is being
+     * requested.
+     * 
+ * + * string upload_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The uploadId. + */ + public java.lang.String getUploadId() { + java.lang.Object ref = uploadId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uploadId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the resume token for the object whose write status is being
+     * requested.
+     * 
+ * + * string upload_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for uploadId. + */ + public com.google.protobuf.ByteString getUploadIdBytes() { + java.lang.Object ref = uploadId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uploadId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the resume token for the object whose write status is being
+     * requested.
+     * 
+ * + * string upload_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The uploadId to set. + * @return This builder for chaining. + */ + public Builder setUploadId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + uploadId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resume token for the object whose write status is being
+     * requested.
+     * 
+ * + * string upload_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearUploadId() { + + uploadId_ = getDefaultInstance().getUploadId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the resume token for the object whose write status is being
+     * requested.
+     * 
+ * + * string upload_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for uploadId to set. + * @return This builder for chaining. + */ + public Builder setUploadIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + uploadId_ = value; + onChanged(); + return this; + } + + private com.google.storage.v2.CommonObjectRequestParams commonObjectRequestParams_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.CommonObjectRequestParams, + com.google.storage.v2.CommonObjectRequestParams.Builder, + com.google.storage.v2.CommonObjectRequestParamsOrBuilder> + commonObjectRequestParamsBuilder_; + /** + * + * + *
+     * A set of parameters common to Storage API requests concerning an object.
+     * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 2; + * + * @return Whether the commonObjectRequestParams field is set. + */ + public boolean hasCommonObjectRequestParams() { + return commonObjectRequestParamsBuilder_ != null || commonObjectRequestParams_ != null; + } + /** + * + * + *
+     * A set of parameters common to Storage API requests concerning an object.
+     * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 2; + * + * @return The commonObjectRequestParams. + */ + public com.google.storage.v2.CommonObjectRequestParams getCommonObjectRequestParams() { + if (commonObjectRequestParamsBuilder_ == null) { + return commonObjectRequestParams_ == null + ? com.google.storage.v2.CommonObjectRequestParams.getDefaultInstance() + : commonObjectRequestParams_; + } else { + return commonObjectRequestParamsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * A set of parameters common to Storage API requests concerning an object.
+     * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 2; + */ + public Builder setCommonObjectRequestParams( + com.google.storage.v2.CommonObjectRequestParams value) { + if (commonObjectRequestParamsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + commonObjectRequestParams_ = value; + onChanged(); + } else { + commonObjectRequestParamsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * A set of parameters common to Storage API requests concerning an object.
+     * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 2; + */ + public Builder setCommonObjectRequestParams( + com.google.storage.v2.CommonObjectRequestParams.Builder builderForValue) { + if (commonObjectRequestParamsBuilder_ == null) { + commonObjectRequestParams_ = builderForValue.build(); + onChanged(); + } else { + commonObjectRequestParamsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * A set of parameters common to Storage API requests concerning an object.
+     * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 2; + */ + public Builder mergeCommonObjectRequestParams( + com.google.storage.v2.CommonObjectRequestParams value) { + if (commonObjectRequestParamsBuilder_ == null) { + if (commonObjectRequestParams_ != null) { + commonObjectRequestParams_ = + com.google.storage.v2.CommonObjectRequestParams.newBuilder(commonObjectRequestParams_) + .mergeFrom(value) + .buildPartial(); + } else { + commonObjectRequestParams_ = value; + } + onChanged(); + } else { + commonObjectRequestParamsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * A set of parameters common to Storage API requests concerning an object.
+     * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 2; + */ + public Builder clearCommonObjectRequestParams() { + if (commonObjectRequestParamsBuilder_ == null) { + commonObjectRequestParams_ = null; + onChanged(); + } else { + commonObjectRequestParams_ = null; + commonObjectRequestParamsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * A set of parameters common to Storage API requests concerning an object.
+     * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 2; + */ + public com.google.storage.v2.CommonObjectRequestParams.Builder + getCommonObjectRequestParamsBuilder() { + + onChanged(); + return getCommonObjectRequestParamsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A set of parameters common to Storage API requests concerning an object.
+     * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 2; + */ + public com.google.storage.v2.CommonObjectRequestParamsOrBuilder + getCommonObjectRequestParamsOrBuilder() { + if (commonObjectRequestParamsBuilder_ != null) { + return commonObjectRequestParamsBuilder_.getMessageOrBuilder(); + } else { + return commonObjectRequestParams_ == null + ? com.google.storage.v2.CommonObjectRequestParams.getDefaultInstance() + : commonObjectRequestParams_; + } + } + /** + * + * + *
+     * A set of parameters common to Storage API requests concerning an object.
+     * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.CommonObjectRequestParams, + com.google.storage.v2.CommonObjectRequestParams.Builder, + com.google.storage.v2.CommonObjectRequestParamsOrBuilder> + getCommonObjectRequestParamsFieldBuilder() { + if (commonObjectRequestParamsBuilder_ == null) { + commonObjectRequestParamsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.CommonObjectRequestParams, + com.google.storage.v2.CommonObjectRequestParams.Builder, + com.google.storage.v2.CommonObjectRequestParamsOrBuilder>( + getCommonObjectRequestParams(), getParentForChildren(), isClean()); + commonObjectRequestParams_ = null; + } + return commonObjectRequestParamsBuilder_; + } + + private com.google.storage.v2.CommonRequestParams commonRequestParams_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.CommonRequestParams, + com.google.storage.v2.CommonRequestParams.Builder, + com.google.storage.v2.CommonRequestParamsOrBuilder> + commonRequestParamsBuilder_; + /** + * + * + *
+     * A set of parameters common to all Storage API requests.
+     * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 3; + * + * @return Whether the commonRequestParams field is set. + */ + public boolean hasCommonRequestParams() { + return commonRequestParamsBuilder_ != null || commonRequestParams_ != null; + } + /** + * + * + *
+     * A set of parameters common to all Storage API requests.
+     * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 3; + * + * @return The commonRequestParams. + */ + public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { + if (commonRequestParamsBuilder_ == null) { + return commonRequestParams_ == null + ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() + : commonRequestParams_; + } else { + return commonRequestParamsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * A set of parameters common to all Storage API requests.
+     * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 3; + */ + public Builder setCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { + if (commonRequestParamsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + commonRequestParams_ = value; + onChanged(); + } else { + commonRequestParamsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * A set of parameters common to all Storage API requests.
+     * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 3; + */ + public Builder setCommonRequestParams( + com.google.storage.v2.CommonRequestParams.Builder builderForValue) { + if (commonRequestParamsBuilder_ == null) { + commonRequestParams_ = builderForValue.build(); + onChanged(); + } else { + commonRequestParamsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * A set of parameters common to all Storage API requests.
+     * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 3; + */ + public Builder mergeCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { + if (commonRequestParamsBuilder_ == null) { + if (commonRequestParams_ != null) { + commonRequestParams_ = + com.google.storage.v2.CommonRequestParams.newBuilder(commonRequestParams_) + .mergeFrom(value) + .buildPartial(); + } else { + commonRequestParams_ = value; + } + onChanged(); + } else { + commonRequestParamsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * A set of parameters common to all Storage API requests.
+     * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 3; + */ + public Builder clearCommonRequestParams() { + if (commonRequestParamsBuilder_ == null) { + commonRequestParams_ = null; + onChanged(); + } else { + commonRequestParams_ = null; + commonRequestParamsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * A set of parameters common to all Storage API requests.
+     * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 3; + */ + public com.google.storage.v2.CommonRequestParams.Builder getCommonRequestParamsBuilder() { + + onChanged(); + return getCommonRequestParamsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A set of parameters common to all Storage API requests.
+     * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 3; + */ + public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { + if (commonRequestParamsBuilder_ != null) { + return commonRequestParamsBuilder_.getMessageOrBuilder(); + } else { + return commonRequestParams_ == null + ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() + : commonRequestParams_; + } + } + /** + * + * + *
+     * A set of parameters common to all Storage API requests.
+     * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.CommonRequestParams, + com.google.storage.v2.CommonRequestParams.Builder, + com.google.storage.v2.CommonRequestParamsOrBuilder> + getCommonRequestParamsFieldBuilder() { + if (commonRequestParamsBuilder_ == null) { + commonRequestParamsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.CommonRequestParams, + com.google.storage.v2.CommonRequestParams.Builder, + com.google.storage.v2.CommonRequestParamsOrBuilder>( + getCommonRequestParams(), getParentForChildren(), isClean()); + commonRequestParams_ = null; + } + return commonRequestParamsBuilder_; + } + + @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.QueryWriteStatusRequest) + } + + // @@protoc_insertion_point(class_scope:google.storage.v2.QueryWriteStatusRequest) + private static final com.google.storage.v2.QueryWriteStatusRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.v2.QueryWriteStatusRequest(); + } + + public static com.google.storage.v2.QueryWriteStatusRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QueryWriteStatusRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new QueryWriteStatusRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.storage.v2.QueryWriteStatusRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/QueryWriteStatusRequestOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/QueryWriteStatusRequestOrBuilder.java new file mode 100644 index 0000000000..e615a6d43b --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/QueryWriteStatusRequestOrBuilder.java @@ -0,0 +1,122 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +package com.google.storage.v2; + +public interface QueryWriteStatusRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.QueryWriteStatusRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the resume token for the object whose write status is being
+   * requested.
+   * 
+ * + * string upload_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The uploadId. + */ + java.lang.String getUploadId(); + /** + * + * + *
+   * Required. The name of the resume token for the object whose write status is being
+   * requested.
+   * 
+ * + * string upload_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for uploadId. + */ + com.google.protobuf.ByteString getUploadIdBytes(); + + /** + * + * + *
+   * A set of parameters common to Storage API requests concerning an object.
+   * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 2; + * + * @return Whether the commonObjectRequestParams field is set. + */ + boolean hasCommonObjectRequestParams(); + /** + * + * + *
+   * A set of parameters common to Storage API requests concerning an object.
+   * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 2; + * + * @return The commonObjectRequestParams. + */ + com.google.storage.v2.CommonObjectRequestParams getCommonObjectRequestParams(); + /** + * + * + *
+   * A set of parameters common to Storage API requests concerning an object.
+   * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 2; + */ + com.google.storage.v2.CommonObjectRequestParamsOrBuilder getCommonObjectRequestParamsOrBuilder(); + + /** + * + * + *
+   * A set of parameters common to all Storage API requests.
+   * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 3; + * + * @return Whether the commonRequestParams field is set. + */ + boolean hasCommonRequestParams(); + /** + * + * + *
+   * A set of parameters common to all Storage API requests.
+   * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 3; + * + * @return The commonRequestParams. + */ + com.google.storage.v2.CommonRequestParams getCommonRequestParams(); + /** + * + * + *
+   * A set of parameters common to all Storage API requests.
+   * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 3; + */ + com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder(); +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/QueryWriteStatusResponse.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/QueryWriteStatusResponse.java new file mode 100644 index 0000000000..3deb1d5412 --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/QueryWriteStatusResponse.java @@ -0,0 +1,994 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +package com.google.storage.v2; + +/** + * + * + *
+ * Response object for `QueryWriteStatus`.
+ * 
+ * + * Protobuf type {@code google.storage.v2.QueryWriteStatusResponse} + */ +public final class QueryWriteStatusResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.v2.QueryWriteStatusResponse) + QueryWriteStatusResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use QueryWriteStatusResponse.newBuilder() to construct. + private QueryWriteStatusResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private QueryWriteStatusResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new QueryWriteStatusResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private QueryWriteStatusResponse( + 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: + { + writeStatusCase_ = 1; + writeStatus_ = input.readInt64(); + break; + } + case 18: + { + com.google.storage.v2.Object.Builder subBuilder = null; + if (writeStatusCase_ == 2) { + subBuilder = ((com.google.storage.v2.Object) writeStatus_).toBuilder(); + } + writeStatus_ = + input.readMessage(com.google.storage.v2.Object.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.storage.v2.Object) writeStatus_); + writeStatus_ = subBuilder.buildPartial(); + } + writeStatusCase_ = 2; + 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_QueryWriteStatusResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_QueryWriteStatusResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.QueryWriteStatusResponse.class, + com.google.storage.v2.QueryWriteStatusResponse.Builder.class); + } + + private int writeStatusCase_ = 0; + private java.lang.Object writeStatus_; + + public enum WriteStatusCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + COMMITTED_SIZE(1), + RESOURCE(2), + WRITESTATUS_NOT_SET(0); + private final int value; + + private WriteStatusCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static WriteStatusCase valueOf(int value) { + return forNumber(value); + } + + public static WriteStatusCase forNumber(int value) { + switch (value) { + case 1: + return COMMITTED_SIZE; + case 2: + return RESOURCE; + case 0: + return WRITESTATUS_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public WriteStatusCase getWriteStatusCase() { + return WriteStatusCase.forNumber(writeStatusCase_); + } + + public static final int COMMITTED_SIZE_FIELD_NUMBER = 1; + /** + * + * + *
+   * The total number of bytes that have been processed for the given object
+   * from all `WriteObject` calls. This is the correct value for the
+   * 'write_offset' field to use when resuming the `WriteObject` operation.
+   * Only set if the upload has not finalized.
+   * 
+ * + * int64 committed_size = 1; + * + * @return Whether the committedSize field is set. + */ + @java.lang.Override + public boolean hasCommittedSize() { + return writeStatusCase_ == 1; + } + /** + * + * + *
+   * The total number of bytes that have been processed for the given object
+   * from all `WriteObject` calls. This is the correct value for the
+   * 'write_offset' field to use when resuming the `WriteObject` operation.
+   * Only set if the upload has not finalized.
+   * 
+ * + * int64 committed_size = 1; + * + * @return The committedSize. + */ + @java.lang.Override + public long getCommittedSize() { + if (writeStatusCase_ == 1) { + return (java.lang.Long) writeStatus_; + } + return 0L; + } + + public static final int RESOURCE_FIELD_NUMBER = 2; + /** + * + * + *
+   * A resource containing the metadata for the uploaded object. Only set if
+   * the upload has finalized.
+   * 
+ * + * .google.storage.v2.Object resource = 2; + * + * @return Whether the resource field is set. + */ + @java.lang.Override + public boolean hasResource() { + return writeStatusCase_ == 2; + } + /** + * + * + *
+   * A resource containing the metadata for the uploaded object. Only set if
+   * the upload has finalized.
+   * 
+ * + * .google.storage.v2.Object resource = 2; + * + * @return The resource. + */ + @java.lang.Override + public com.google.storage.v2.Object getResource() { + if (writeStatusCase_ == 2) { + return (com.google.storage.v2.Object) writeStatus_; + } + return com.google.storage.v2.Object.getDefaultInstance(); + } + /** + * + * + *
+   * A resource containing the metadata for the uploaded object. Only set if
+   * the upload has finalized.
+   * 
+ * + * .google.storage.v2.Object resource = 2; + */ + @java.lang.Override + public com.google.storage.v2.ObjectOrBuilder getResourceOrBuilder() { + if (writeStatusCase_ == 2) { + return (com.google.storage.v2.Object) writeStatus_; + } + return com.google.storage.v2.Object.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (writeStatusCase_ == 1) { + output.writeInt64(1, (long) ((java.lang.Long) writeStatus_)); + } + if (writeStatusCase_ == 2) { + output.writeMessage(2, (com.google.storage.v2.Object) writeStatus_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (writeStatusCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeInt64Size( + 1, (long) ((java.lang.Long) writeStatus_)); + } + if (writeStatusCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.storage.v2.Object) writeStatus_); + } + 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.QueryWriteStatusResponse)) { + return super.equals(obj); + } + com.google.storage.v2.QueryWriteStatusResponse other = + (com.google.storage.v2.QueryWriteStatusResponse) obj; + + if (!getWriteStatusCase().equals(other.getWriteStatusCase())) return false; + switch (writeStatusCase_) { + case 1: + if (getCommittedSize() != other.getCommittedSize()) return false; + break; + case 2: + if (!getResource().equals(other.getResource())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (writeStatusCase_) { + case 1: + hash = (37 * hash) + COMMITTED_SIZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getCommittedSize()); + break; + case 2: + hash = (37 * hash) + RESOURCE_FIELD_NUMBER; + hash = (53 * hash) + getResource().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.v2.QueryWriteStatusResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.QueryWriteStatusResponse 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.QueryWriteStatusResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.QueryWriteStatusResponse 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.QueryWriteStatusResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.QueryWriteStatusResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.QueryWriteStatusResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.QueryWriteStatusResponse 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.QueryWriteStatusResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.v2.QueryWriteStatusResponse 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.QueryWriteStatusResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.QueryWriteStatusResponse 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.QueryWriteStatusResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response object for `QueryWriteStatus`.
+   * 
+ * + * Protobuf type {@code google.storage.v2.QueryWriteStatusResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.QueryWriteStatusResponse) + com.google.storage.v2.QueryWriteStatusResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_QueryWriteStatusResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_QueryWriteStatusResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.QueryWriteStatusResponse.class, + com.google.storage.v2.QueryWriteStatusResponse.Builder.class); + } + + // Construct using com.google.storage.v2.QueryWriteStatusResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + writeStatusCase_ = 0; + writeStatus_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_QueryWriteStatusResponse_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.QueryWriteStatusResponse getDefaultInstanceForType() { + return com.google.storage.v2.QueryWriteStatusResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.QueryWriteStatusResponse build() { + com.google.storage.v2.QueryWriteStatusResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.QueryWriteStatusResponse buildPartial() { + com.google.storage.v2.QueryWriteStatusResponse result = + new com.google.storage.v2.QueryWriteStatusResponse(this); + if (writeStatusCase_ == 1) { + result.writeStatus_ = writeStatus_; + } + if (writeStatusCase_ == 2) { + if (resourceBuilder_ == null) { + result.writeStatus_ = writeStatus_; + } else { + result.writeStatus_ = resourceBuilder_.build(); + } + } + result.writeStatusCase_ = writeStatusCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.storage.v2.QueryWriteStatusResponse) { + return mergeFrom((com.google.storage.v2.QueryWriteStatusResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.QueryWriteStatusResponse other) { + if (other == com.google.storage.v2.QueryWriteStatusResponse.getDefaultInstance()) return this; + switch (other.getWriteStatusCase()) { + case COMMITTED_SIZE: + { + setCommittedSize(other.getCommittedSize()); + break; + } + case RESOURCE: + { + mergeResource(other.getResource()); + break; + } + case WRITESTATUS_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.storage.v2.QueryWriteStatusResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.storage.v2.QueryWriteStatusResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int writeStatusCase_ = 0; + private java.lang.Object writeStatus_; + + public WriteStatusCase getWriteStatusCase() { + return WriteStatusCase.forNumber(writeStatusCase_); + } + + public Builder clearWriteStatus() { + writeStatusCase_ = 0; + writeStatus_ = null; + onChanged(); + return this; + } + + /** + * + * + *
+     * The total number of bytes that have been processed for the given object
+     * from all `WriteObject` calls. This is the correct value for the
+     * 'write_offset' field to use when resuming the `WriteObject` operation.
+     * Only set if the upload has not finalized.
+     * 
+ * + * int64 committed_size = 1; + * + * @return Whether the committedSize field is set. + */ + public boolean hasCommittedSize() { + return writeStatusCase_ == 1; + } + /** + * + * + *
+     * The total number of bytes that have been processed for the given object
+     * from all `WriteObject` calls. This is the correct value for the
+     * 'write_offset' field to use when resuming the `WriteObject` operation.
+     * Only set if the upload has not finalized.
+     * 
+ * + * int64 committed_size = 1; + * + * @return The committedSize. + */ + public long getCommittedSize() { + if (writeStatusCase_ == 1) { + return (java.lang.Long) writeStatus_; + } + return 0L; + } + /** + * + * + *
+     * The total number of bytes that have been processed for the given object
+     * from all `WriteObject` calls. This is the correct value for the
+     * 'write_offset' field to use when resuming the `WriteObject` operation.
+     * Only set if the upload has not finalized.
+     * 
+ * + * int64 committed_size = 1; + * + * @param value The committedSize to set. + * @return This builder for chaining. + */ + public Builder setCommittedSize(long value) { + writeStatusCase_ = 1; + writeStatus_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The total number of bytes that have been processed for the given object
+     * from all `WriteObject` calls. This is the correct value for the
+     * 'write_offset' field to use when resuming the `WriteObject` operation.
+     * Only set if the upload has not finalized.
+     * 
+ * + * int64 committed_size = 1; + * + * @return This builder for chaining. + */ + public Builder clearCommittedSize() { + if (writeStatusCase_ == 1) { + writeStatusCase_ = 0; + writeStatus_ = null; + onChanged(); + } + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Object, + com.google.storage.v2.Object.Builder, + com.google.storage.v2.ObjectOrBuilder> + resourceBuilder_; + /** + * + * + *
+     * A resource containing the metadata for the uploaded object. Only set if
+     * the upload has finalized.
+     * 
+ * + * .google.storage.v2.Object resource = 2; + * + * @return Whether the resource field is set. + */ + @java.lang.Override + public boolean hasResource() { + return writeStatusCase_ == 2; + } + /** + * + * + *
+     * A resource containing the metadata for the uploaded object. Only set if
+     * the upload has finalized.
+     * 
+ * + * .google.storage.v2.Object resource = 2; + * + * @return The resource. + */ + @java.lang.Override + public com.google.storage.v2.Object getResource() { + if (resourceBuilder_ == null) { + if (writeStatusCase_ == 2) { + return (com.google.storage.v2.Object) writeStatus_; + } + return com.google.storage.v2.Object.getDefaultInstance(); + } else { + if (writeStatusCase_ == 2) { + return resourceBuilder_.getMessage(); + } + return com.google.storage.v2.Object.getDefaultInstance(); + } + } + /** + * + * + *
+     * A resource containing the metadata for the uploaded object. Only set if
+     * the upload has finalized.
+     * 
+ * + * .google.storage.v2.Object resource = 2; + */ + public Builder setResource(com.google.storage.v2.Object value) { + if (resourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + writeStatus_ = value; + onChanged(); + } else { + resourceBuilder_.setMessage(value); + } + writeStatusCase_ = 2; + return this; + } + /** + * + * + *
+     * A resource containing the metadata for the uploaded object. Only set if
+     * the upload has finalized.
+     * 
+ * + * .google.storage.v2.Object resource = 2; + */ + public Builder setResource(com.google.storage.v2.Object.Builder builderForValue) { + if (resourceBuilder_ == null) { + writeStatus_ = builderForValue.build(); + onChanged(); + } else { + resourceBuilder_.setMessage(builderForValue.build()); + } + writeStatusCase_ = 2; + return this; + } + /** + * + * + *
+     * A resource containing the metadata for the uploaded object. Only set if
+     * the upload has finalized.
+     * 
+ * + * .google.storage.v2.Object resource = 2; + */ + public Builder mergeResource(com.google.storage.v2.Object value) { + if (resourceBuilder_ == null) { + if (writeStatusCase_ == 2 + && writeStatus_ != com.google.storage.v2.Object.getDefaultInstance()) { + writeStatus_ = + com.google.storage.v2.Object.newBuilder((com.google.storage.v2.Object) writeStatus_) + .mergeFrom(value) + .buildPartial(); + } else { + writeStatus_ = value; + } + onChanged(); + } else { + if (writeStatusCase_ == 2) { + resourceBuilder_.mergeFrom(value); + } + resourceBuilder_.setMessage(value); + } + writeStatusCase_ = 2; + return this; + } + /** + * + * + *
+     * A resource containing the metadata for the uploaded object. Only set if
+     * the upload has finalized.
+     * 
+ * + * .google.storage.v2.Object resource = 2; + */ + public Builder clearResource() { + if (resourceBuilder_ == null) { + if (writeStatusCase_ == 2) { + writeStatusCase_ = 0; + writeStatus_ = null; + onChanged(); + } + } else { + if (writeStatusCase_ == 2) { + writeStatusCase_ = 0; + writeStatus_ = null; + } + resourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A resource containing the metadata for the uploaded object. Only set if
+     * the upload has finalized.
+     * 
+ * + * .google.storage.v2.Object resource = 2; + */ + public com.google.storage.v2.Object.Builder getResourceBuilder() { + return getResourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A resource containing the metadata for the uploaded object. Only set if
+     * the upload has finalized.
+     * 
+ * + * .google.storage.v2.Object resource = 2; + */ + @java.lang.Override + public com.google.storage.v2.ObjectOrBuilder getResourceOrBuilder() { + if ((writeStatusCase_ == 2) && (resourceBuilder_ != null)) { + return resourceBuilder_.getMessageOrBuilder(); + } else { + if (writeStatusCase_ == 2) { + return (com.google.storage.v2.Object) writeStatus_; + } + return com.google.storage.v2.Object.getDefaultInstance(); + } + } + /** + * + * + *
+     * A resource containing the metadata for the uploaded object. Only set if
+     * the upload has finalized.
+     * 
+ * + * .google.storage.v2.Object resource = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Object, + com.google.storage.v2.Object.Builder, + com.google.storage.v2.ObjectOrBuilder> + getResourceFieldBuilder() { + if (resourceBuilder_ == null) { + if (!(writeStatusCase_ == 2)) { + writeStatus_ = com.google.storage.v2.Object.getDefaultInstance(); + } + resourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Object, + com.google.storage.v2.Object.Builder, + com.google.storage.v2.ObjectOrBuilder>( + (com.google.storage.v2.Object) writeStatus_, getParentForChildren(), isClean()); + writeStatus_ = null; + } + writeStatusCase_ = 2; + onChanged(); + ; + return resourceBuilder_; + } + + @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.QueryWriteStatusResponse) + } + + // @@protoc_insertion_point(class_scope:google.storage.v2.QueryWriteStatusResponse) + private static final com.google.storage.v2.QueryWriteStatusResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.v2.QueryWriteStatusResponse(); + } + + public static com.google.storage.v2.QueryWriteStatusResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QueryWriteStatusResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new QueryWriteStatusResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.storage.v2.QueryWriteStatusResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/QueryWriteStatusResponseOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/QueryWriteStatusResponseOrBuilder.java new file mode 100644 index 0000000000..d700c31657 --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/QueryWriteStatusResponseOrBuilder.java @@ -0,0 +1,96 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +package com.google.storage.v2; + +public interface QueryWriteStatusResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.QueryWriteStatusResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The total number of bytes that have been processed for the given object
+   * from all `WriteObject` calls. This is the correct value for the
+   * 'write_offset' field to use when resuming the `WriteObject` operation.
+   * Only set if the upload has not finalized.
+   * 
+ * + * int64 committed_size = 1; + * + * @return Whether the committedSize field is set. + */ + boolean hasCommittedSize(); + /** + * + * + *
+   * The total number of bytes that have been processed for the given object
+   * from all `WriteObject` calls. This is the correct value for the
+   * 'write_offset' field to use when resuming the `WriteObject` operation.
+   * Only set if the upload has not finalized.
+   * 
+ * + * int64 committed_size = 1; + * + * @return The committedSize. + */ + long getCommittedSize(); + + /** + * + * + *
+   * A resource containing the metadata for the uploaded object. Only set if
+   * the upload has finalized.
+   * 
+ * + * .google.storage.v2.Object resource = 2; + * + * @return Whether the resource field is set. + */ + boolean hasResource(); + /** + * + * + *
+   * A resource containing the metadata for the uploaded object. Only set if
+   * the upload has finalized.
+   * 
+ * + * .google.storage.v2.Object resource = 2; + * + * @return The resource. + */ + com.google.storage.v2.Object getResource(); + /** + * + * + *
+   * A resource containing the metadata for the uploaded object. Only set if
+   * the upload has finalized.
+   * 
+ * + * .google.storage.v2.Object resource = 2; + */ + com.google.storage.v2.ObjectOrBuilder getResourceOrBuilder(); + + public com.google.storage.v2.QueryWriteStatusResponse.WriteStatusCase getWriteStatusCase(); +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadObjectRequest.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadObjectRequest.java new file mode 100644 index 0000000000..33a6ad3ef4 --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadObjectRequest.java @@ -0,0 +1,2586 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +package com.google.storage.v2; + +/** + * + * + *
+ * Request message for ReadObject.
+ * 
+ * + * Protobuf type {@code google.storage.v2.ReadObjectRequest} + */ +public final class ReadObjectRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.v2.ReadObjectRequest) + ReadObjectRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ReadObjectRequest.newBuilder() to construct. + private ReadObjectRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ReadObjectRequest() { + bucket_ = ""; + object_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ReadObjectRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ReadObjectRequest( + 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(); + + bucket_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + object_ = s; + break; + } + case 24: + { + generation_ = input.readInt64(); + break; + } + case 32: + { + readOffset_ = input.readInt64(); + break; + } + case 40: + { + readLimit_ = input.readInt64(); + break; + } + case 48: + { + bitField0_ |= 0x00000001; + ifGenerationMatch_ = input.readInt64(); + break; + } + case 56: + { + bitField0_ |= 0x00000002; + ifGenerationNotMatch_ = input.readInt64(); + break; + } + case 64: + { + bitField0_ |= 0x00000004; + ifMetagenerationMatch_ = input.readInt64(); + break; + } + case 72: + { + bitField0_ |= 0x00000008; + ifMetagenerationNotMatch_ = input.readInt64(); + break; + } + case 82: + { + com.google.storage.v2.CommonObjectRequestParams.Builder subBuilder = null; + if (commonObjectRequestParams_ != null) { + subBuilder = commonObjectRequestParams_.toBuilder(); + } + commonObjectRequestParams_ = + input.readMessage( + com.google.storage.v2.CommonObjectRequestParams.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(commonObjectRequestParams_); + commonObjectRequestParams_ = subBuilder.buildPartial(); + } + + break; + } + case 90: + { + com.google.storage.v2.CommonRequestParams.Builder subBuilder = null; + if (commonRequestParams_ != null) { + subBuilder = commonRequestParams_.toBuilder(); + } + commonRequestParams_ = + input.readMessage( + com.google.storage.v2.CommonRequestParams.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(commonRequestParams_); + commonRequestParams_ = subBuilder.buildPartial(); + } + + break; + } + case 98: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (((bitField0_ & 0x00000010) != 0)) { + subBuilder = readMask_.toBuilder(); + } + readMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(readMask_); + readMask_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000010; + 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_ReadObjectRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ReadObjectRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.ReadObjectRequest.class, + com.google.storage.v2.ReadObjectRequest.Builder.class); + } + + private int bitField0_; + public static final int BUCKET_FIELD_NUMBER = 1; + private volatile java.lang.Object bucket_; + /** + * + * + *
+   * The name of the bucket containing the object to read.
+   * 
+ * + * string bucket = 1; + * + * @return The bucket. + */ + @java.lang.Override + public java.lang.String getBucket() { + java.lang.Object ref = bucket_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + bucket_ = s; + return s; + } + } + /** + * + * + *
+   * The name of the bucket containing the object to read.
+   * 
+ * + * string bucket = 1; + * + * @return The bytes for bucket. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBucketBytes() { + java.lang.Object ref = bucket_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + bucket_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OBJECT_FIELD_NUMBER = 2; + private volatile java.lang.Object object_; + /** + * + * + *
+   * The name of the object to read.
+   * 
+ * + * string object = 2; + * + * @return The object. + */ + @java.lang.Override + public java.lang.String getObject() { + java.lang.Object ref = object_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + object_ = s; + return s; + } + } + /** + * + * + *
+   * The name of the object to read.
+   * 
+ * + * string object = 2; + * + * @return The bytes for object. + */ + @java.lang.Override + public com.google.protobuf.ByteString getObjectBytes() { + java.lang.Object ref = object_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + object_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GENERATION_FIELD_NUMBER = 3; + private long generation_; + /** + * + * + *
+   * If present, selects a specific revision of this object (as opposed
+   * to the latest version, the default).
+   * 
+ * + * int64 generation = 3; + * + * @return The generation. + */ + @java.lang.Override + public long getGeneration() { + return generation_; + } + + public static final int READ_OFFSET_FIELD_NUMBER = 4; + private long readOffset_; + /** + * + * + *
+   * The offset for the first byte to return in the read, relative to the start
+   * of the object.
+   * A negative `read_offset` value will be interpreted as the number of bytes
+   * back from the end of the object to be returned. For example, if an object's
+   * length is 15 bytes, a ReadObjectRequest with `read_offset` = -5 and
+   * `read_limit` = 3 would return bytes 10 through 12 of the object. Requesting
+   * a negative offset whose magnitude is larger than the size of the object
+   * will result in an error.
+   * 
+ * + * int64 read_offset = 4; + * + * @return The readOffset. + */ + @java.lang.Override + public long getReadOffset() { + return readOffset_; + } + + public static final int READ_LIMIT_FIELD_NUMBER = 5; + private long readLimit_; + /** + * + * + *
+   * The maximum number of `data` bytes the server is allowed to return in the
+   * sum of all `Object` messages. A `read_limit` of zero indicates that there
+   * is no limit, and a negative `read_limit` will cause an error.
+   * If the stream returns fewer bytes than allowed by the `read_limit` and no
+   * error occurred, the stream includes all data from the `read_offset` to the
+   * end of the resource.
+   * 
+ * + * int64 read_limit = 5; + * + * @return The readLimit. + */ + @java.lang.Override + public long getReadLimit() { + return readLimit_; + } + + public static final int IF_GENERATION_MATCH_FIELD_NUMBER = 6; + private long ifGenerationMatch_; + /** + * + * + *
+   * Makes the operation conditional on whether the object's current generation
+   * matches the given value. Setting to 0 makes the operation succeed only if
+   * there are no live versions of the object.
+   * 
+ * + * int64 if_generation_match = 6; + * + * @return Whether the ifGenerationMatch field is set. + */ + @java.lang.Override + public boolean hasIfGenerationMatch() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Makes the operation conditional on whether the object's current generation
+   * matches the given value. Setting to 0 makes the operation succeed only if
+   * there are no live versions of the object.
+   * 
+ * + * int64 if_generation_match = 6; + * + * @return The ifGenerationMatch. + */ + @java.lang.Override + public long getIfGenerationMatch() { + return ifGenerationMatch_; + } + + public static final int IF_GENERATION_NOT_MATCH_FIELD_NUMBER = 7; + private long ifGenerationNotMatch_; + /** + * + * + *
+   * Makes the operation conditional on whether the object's current generation
+   * does not match the given value. If no live object exists, the precondition
+   * fails. Setting to 0 makes the operation succeed only if there is a live
+   * version of the object.
+   * 
+ * + * int64 if_generation_not_match = 7; + * + * @return Whether the ifGenerationNotMatch field is set. + */ + @java.lang.Override + public boolean hasIfGenerationNotMatch() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Makes the operation conditional on whether the object's current generation
+   * does not match the given value. If no live object exists, the precondition
+   * fails. Setting to 0 makes the operation succeed only if there is a live
+   * version of the object.
+   * 
+ * + * int64 if_generation_not_match = 7; + * + * @return The ifGenerationNotMatch. + */ + @java.lang.Override + public long getIfGenerationNotMatch() { + return ifGenerationNotMatch_; + } + + public static final int IF_METAGENERATION_MATCH_FIELD_NUMBER = 8; + private long ifMetagenerationMatch_; + /** + * + * + *
+   * Makes the operation conditional on whether the object's current
+   * metageneration matches the given value.
+   * 
+ * + * int64 if_metageneration_match = 8; + * + * @return Whether the ifMetagenerationMatch field is set. + */ + @java.lang.Override + public boolean hasIfMetagenerationMatch() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * Makes the operation conditional on whether the object's current
+   * metageneration matches the given value.
+   * 
+ * + * int64 if_metageneration_match = 8; + * + * @return The ifMetagenerationMatch. + */ + @java.lang.Override + public long getIfMetagenerationMatch() { + return ifMetagenerationMatch_; + } + + public static final int IF_METAGENERATION_NOT_MATCH_FIELD_NUMBER = 9; + private long ifMetagenerationNotMatch_; + /** + * + * + *
+   * Makes the operation conditional on whether the object's current
+   * metageneration does not match the given value.
+   * 
+ * + * int64 if_metageneration_not_match = 9; + * + * @return Whether the ifMetagenerationNotMatch field is set. + */ + @java.lang.Override + public boolean hasIfMetagenerationNotMatch() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+   * Makes the operation conditional on whether the object's current
+   * metageneration does not match the given value.
+   * 
+ * + * int64 if_metageneration_not_match = 9; + * + * @return The ifMetagenerationNotMatch. + */ + @java.lang.Override + public long getIfMetagenerationNotMatch() { + return ifMetagenerationNotMatch_; + } + + public static final int COMMON_OBJECT_REQUEST_PARAMS_FIELD_NUMBER = 10; + private com.google.storage.v2.CommonObjectRequestParams commonObjectRequestParams_; + /** + * + * + *
+   * A set of parameters common to Storage API requests concerning an object.
+   * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; + * + * @return Whether the commonObjectRequestParams field is set. + */ + @java.lang.Override + public boolean hasCommonObjectRequestParams() { + return commonObjectRequestParams_ != null; + } + /** + * + * + *
+   * A set of parameters common to Storage API requests concerning an object.
+   * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; + * + * @return The commonObjectRequestParams. + */ + @java.lang.Override + public com.google.storage.v2.CommonObjectRequestParams getCommonObjectRequestParams() { + return commonObjectRequestParams_ == null + ? com.google.storage.v2.CommonObjectRequestParams.getDefaultInstance() + : commonObjectRequestParams_; + } + /** + * + * + *
+   * A set of parameters common to Storage API requests concerning an object.
+   * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; + */ + @java.lang.Override + public com.google.storage.v2.CommonObjectRequestParamsOrBuilder + getCommonObjectRequestParamsOrBuilder() { + return getCommonObjectRequestParams(); + } + + public static final int COMMON_REQUEST_PARAMS_FIELD_NUMBER = 11; + private com.google.storage.v2.CommonRequestParams commonRequestParams_; + /** + * + * + *
+   * A set of parameters common to all Storage API requests.
+   * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 11; + * + * @return Whether the commonRequestParams field is set. + */ + @java.lang.Override + public boolean hasCommonRequestParams() { + return commonRequestParams_ != null; + } + /** + * + * + *
+   * A set of parameters common to all Storage API requests.
+   * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 11; + * + * @return The commonRequestParams. + */ + @java.lang.Override + public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { + return commonRequestParams_ == null + ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() + : commonRequestParams_; + } + /** + * + * + *
+   * A set of parameters common to all Storage API requests.
+   * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 11; + */ + @java.lang.Override + public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { + return getCommonRequestParams(); + } + + public static final int READ_MASK_FIELD_NUMBER = 12; + private com.google.protobuf.FieldMask readMask_; + /** + * + * + *
+   * Mask specifying which fields to read.
+   * The checksummed_data field and its children will always be present.
+   * If no mask is specified, will default to all fields except metadata.owner
+   * and metadata.acl.
+   * * may be used to mean "all fields".
+   * 
+ * + * .google.protobuf.FieldMask read_mask = 12; + * + * @return Whether the readMask field is set. + */ + @java.lang.Override + public boolean hasReadMask() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+   * Mask specifying which fields to read.
+   * The checksummed_data field and its children will always be present.
+   * If no mask is specified, will default to all fields except metadata.owner
+   * and metadata.acl.
+   * * may be used to mean "all fields".
+   * 
+ * + * .google.protobuf.FieldMask read_mask = 12; + * + * @return The readMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getReadMask() { + return readMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : readMask_; + } + /** + * + * + *
+   * Mask specifying which fields to read.
+   * The checksummed_data field and its children will always be present.
+   * If no mask is specified, will default to all fields except metadata.owner
+   * and metadata.acl.
+   * * may be used to mean "all fields".
+   * 
+ * + * .google.protobuf.FieldMask read_mask = 12; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getReadMaskOrBuilder() { + return readMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : readMask_; + } + + 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 (!getBucketBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, bucket_); + } + if (!getObjectBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, object_); + } + if (generation_ != 0L) { + output.writeInt64(3, generation_); + } + if (readOffset_ != 0L) { + output.writeInt64(4, readOffset_); + } + if (readLimit_ != 0L) { + output.writeInt64(5, readLimit_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt64(6, ifGenerationMatch_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeInt64(7, ifGenerationNotMatch_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeInt64(8, ifMetagenerationMatch_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeInt64(9, ifMetagenerationNotMatch_); + } + if (commonObjectRequestParams_ != null) { + output.writeMessage(10, getCommonObjectRequestParams()); + } + if (commonRequestParams_ != null) { + output.writeMessage(11, getCommonRequestParams()); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(12, getReadMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getBucketBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, bucket_); + } + if (!getObjectBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, object_); + } + if (generation_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, generation_); + } + if (readOffset_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, readOffset_); + } + if (readLimit_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(5, readLimit_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(6, ifGenerationMatch_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(7, ifGenerationNotMatch_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(8, ifMetagenerationMatch_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(9, ifMetagenerationNotMatch_); + } + if (commonObjectRequestParams_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 10, getCommonObjectRequestParams()); + } + if (commonRequestParams_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(11, getCommonRequestParams()); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getReadMask()); + } + 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.ReadObjectRequest)) { + return super.equals(obj); + } + com.google.storage.v2.ReadObjectRequest other = (com.google.storage.v2.ReadObjectRequest) obj; + + if (!getBucket().equals(other.getBucket())) return false; + if (!getObject().equals(other.getObject())) return false; + if (getGeneration() != other.getGeneration()) return false; + if (getReadOffset() != other.getReadOffset()) return false; + if (getReadLimit() != other.getReadLimit()) return false; + if (hasIfGenerationMatch() != other.hasIfGenerationMatch()) return false; + if (hasIfGenerationMatch()) { + if (getIfGenerationMatch() != other.getIfGenerationMatch()) return false; + } + if (hasIfGenerationNotMatch() != other.hasIfGenerationNotMatch()) return false; + if (hasIfGenerationNotMatch()) { + if (getIfGenerationNotMatch() != other.getIfGenerationNotMatch()) return false; + } + if (hasIfMetagenerationMatch() != other.hasIfMetagenerationMatch()) return false; + if (hasIfMetagenerationMatch()) { + if (getIfMetagenerationMatch() != other.getIfMetagenerationMatch()) return false; + } + if (hasIfMetagenerationNotMatch() != other.hasIfMetagenerationNotMatch()) return false; + if (hasIfMetagenerationNotMatch()) { + if (getIfMetagenerationNotMatch() != other.getIfMetagenerationNotMatch()) return false; + } + if (hasCommonObjectRequestParams() != other.hasCommonObjectRequestParams()) return false; + if (hasCommonObjectRequestParams()) { + if (!getCommonObjectRequestParams().equals(other.getCommonObjectRequestParams())) + return false; + } + if (hasCommonRequestParams() != other.hasCommonRequestParams()) return false; + if (hasCommonRequestParams()) { + if (!getCommonRequestParams().equals(other.getCommonRequestParams())) return false; + } + if (hasReadMask() != other.hasReadMask()) return false; + if (hasReadMask()) { + if (!getReadMask().equals(other.getReadMask())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + BUCKET_FIELD_NUMBER; + hash = (53 * hash) + getBucket().hashCode(); + hash = (37 * hash) + OBJECT_FIELD_NUMBER; + hash = (53 * hash) + getObject().hashCode(); + hash = (37 * hash) + GENERATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getGeneration()); + hash = (37 * hash) + READ_OFFSET_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getReadOffset()); + hash = (37 * hash) + READ_LIMIT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getReadLimit()); + if (hasIfGenerationMatch()) { + hash = (37 * hash) + IF_GENERATION_MATCH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIfGenerationMatch()); + } + if (hasIfGenerationNotMatch()) { + hash = (37 * hash) + IF_GENERATION_NOT_MATCH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIfGenerationNotMatch()); + } + if (hasIfMetagenerationMatch()) { + hash = (37 * hash) + IF_METAGENERATION_MATCH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIfMetagenerationMatch()); + } + if (hasIfMetagenerationNotMatch()) { + hash = (37 * hash) + IF_METAGENERATION_NOT_MATCH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIfMetagenerationNotMatch()); + } + if (hasCommonObjectRequestParams()) { + hash = (37 * hash) + COMMON_OBJECT_REQUEST_PARAMS_FIELD_NUMBER; + hash = (53 * hash) + getCommonObjectRequestParams().hashCode(); + } + if (hasCommonRequestParams()) { + hash = (37 * hash) + COMMON_REQUEST_PARAMS_FIELD_NUMBER; + hash = (53 * hash) + getCommonRequestParams().hashCode(); + } + if (hasReadMask()) { + hash = (37 * hash) + READ_MASK_FIELD_NUMBER; + hash = (53 * hash) + getReadMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.v2.ReadObjectRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.ReadObjectRequest 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.ReadObjectRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.ReadObjectRequest 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.ReadObjectRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.ReadObjectRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.ReadObjectRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.ReadObjectRequest 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.ReadObjectRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.v2.ReadObjectRequest 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.ReadObjectRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.ReadObjectRequest 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.ReadObjectRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for ReadObject.
+   * 
+ * + * Protobuf type {@code google.storage.v2.ReadObjectRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.ReadObjectRequest) + com.google.storage.v2.ReadObjectRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ReadObjectRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ReadObjectRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.ReadObjectRequest.class, + com.google.storage.v2.ReadObjectRequest.Builder.class); + } + + // Construct using com.google.storage.v2.ReadObjectRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getReadMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bucket_ = ""; + + object_ = ""; + + generation_ = 0L; + + readOffset_ = 0L; + + readLimit_ = 0L; + + ifGenerationMatch_ = 0L; + bitField0_ = (bitField0_ & ~0x00000001); + ifGenerationNotMatch_ = 0L; + bitField0_ = (bitField0_ & ~0x00000002); + ifMetagenerationMatch_ = 0L; + bitField0_ = (bitField0_ & ~0x00000004); + ifMetagenerationNotMatch_ = 0L; + bitField0_ = (bitField0_ & ~0x00000008); + if (commonObjectRequestParamsBuilder_ == null) { + commonObjectRequestParams_ = null; + } else { + commonObjectRequestParams_ = null; + commonObjectRequestParamsBuilder_ = null; + } + if (commonRequestParamsBuilder_ == null) { + commonRequestParams_ = null; + } else { + commonRequestParams_ = null; + commonRequestParamsBuilder_ = null; + } + if (readMaskBuilder_ == null) { + readMask_ = null; + } else { + readMaskBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ReadObjectRequest_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.ReadObjectRequest getDefaultInstanceForType() { + return com.google.storage.v2.ReadObjectRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.ReadObjectRequest build() { + com.google.storage.v2.ReadObjectRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.ReadObjectRequest buildPartial() { + com.google.storage.v2.ReadObjectRequest result = + new com.google.storage.v2.ReadObjectRequest(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.bucket_ = bucket_; + result.object_ = object_; + result.generation_ = generation_; + result.readOffset_ = readOffset_; + result.readLimit_ = readLimit_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.ifGenerationMatch_ = ifGenerationMatch_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.ifGenerationNotMatch_ = ifGenerationNotMatch_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.ifMetagenerationMatch_ = ifMetagenerationMatch_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.ifMetagenerationNotMatch_ = ifMetagenerationNotMatch_; + to_bitField0_ |= 0x00000008; + } + if (commonObjectRequestParamsBuilder_ == null) { + result.commonObjectRequestParams_ = commonObjectRequestParams_; + } else { + result.commonObjectRequestParams_ = commonObjectRequestParamsBuilder_.build(); + } + if (commonRequestParamsBuilder_ == null) { + result.commonRequestParams_ = commonRequestParams_; + } else { + result.commonRequestParams_ = commonRequestParamsBuilder_.build(); + } + if (((from_bitField0_ & 0x00000010) != 0)) { + if (readMaskBuilder_ == null) { + result.readMask_ = readMask_; + } else { + result.readMask_ = readMaskBuilder_.build(); + } + to_bitField0_ |= 0x00000010; + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.storage.v2.ReadObjectRequest) { + return mergeFrom((com.google.storage.v2.ReadObjectRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.ReadObjectRequest other) { + if (other == com.google.storage.v2.ReadObjectRequest.getDefaultInstance()) return this; + if (!other.getBucket().isEmpty()) { + bucket_ = other.bucket_; + onChanged(); + } + if (!other.getObject().isEmpty()) { + object_ = other.object_; + onChanged(); + } + if (other.getGeneration() != 0L) { + setGeneration(other.getGeneration()); + } + if (other.getReadOffset() != 0L) { + setReadOffset(other.getReadOffset()); + } + if (other.getReadLimit() != 0L) { + setReadLimit(other.getReadLimit()); + } + if (other.hasIfGenerationMatch()) { + setIfGenerationMatch(other.getIfGenerationMatch()); + } + if (other.hasIfGenerationNotMatch()) { + setIfGenerationNotMatch(other.getIfGenerationNotMatch()); + } + if (other.hasIfMetagenerationMatch()) { + setIfMetagenerationMatch(other.getIfMetagenerationMatch()); + } + if (other.hasIfMetagenerationNotMatch()) { + setIfMetagenerationNotMatch(other.getIfMetagenerationNotMatch()); + } + if (other.hasCommonObjectRequestParams()) { + mergeCommonObjectRequestParams(other.getCommonObjectRequestParams()); + } + if (other.hasCommonRequestParams()) { + mergeCommonRequestParams(other.getCommonRequestParams()); + } + if (other.hasReadMask()) { + mergeReadMask(other.getReadMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.storage.v2.ReadObjectRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.storage.v2.ReadObjectRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object bucket_ = ""; + /** + * + * + *
+     * The name of the bucket containing the object to read.
+     * 
+ * + * string bucket = 1; + * + * @return The bucket. + */ + public java.lang.String getBucket() { + java.lang.Object ref = bucket_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + bucket_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The name of the bucket containing the object to read.
+     * 
+ * + * string bucket = 1; + * + * @return The bytes for bucket. + */ + public com.google.protobuf.ByteString getBucketBytes() { + java.lang.Object ref = bucket_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + bucket_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The name of the bucket containing the object to read.
+     * 
+ * + * string bucket = 1; + * + * @param value The bucket to set. + * @return This builder for chaining. + */ + public Builder setBucket(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + bucket_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the bucket containing the object to read.
+     * 
+ * + * string bucket = 1; + * + * @return This builder for chaining. + */ + public Builder clearBucket() { + + bucket_ = getDefaultInstance().getBucket(); + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the bucket containing the object to read.
+     * 
+ * + * string bucket = 1; + * + * @param value The bytes for bucket to set. + * @return This builder for chaining. + */ + public Builder setBucketBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + bucket_ = value; + onChanged(); + return this; + } + + private java.lang.Object object_ = ""; + /** + * + * + *
+     * The name of the object to read.
+     * 
+ * + * string object = 2; + * + * @return The object. + */ + public java.lang.String getObject() { + java.lang.Object ref = object_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + object_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The name of the object to read.
+     * 
+ * + * string object = 2; + * + * @return The bytes for object. + */ + public com.google.protobuf.ByteString getObjectBytes() { + java.lang.Object ref = object_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + object_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The name of the object to read.
+     * 
+ * + * string object = 2; + * + * @param value The object to set. + * @return This builder for chaining. + */ + public Builder setObject(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + object_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the object to read.
+     * 
+ * + * string object = 2; + * + * @return This builder for chaining. + */ + public Builder clearObject() { + + object_ = getDefaultInstance().getObject(); + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the object to read.
+     * 
+ * + * string object = 2; + * + * @param value The bytes for object to set. + * @return This builder for chaining. + */ + public Builder setObjectBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + object_ = value; + onChanged(); + return this; + } + + private long generation_; + /** + * + * + *
+     * If present, selects a specific revision of this object (as opposed
+     * to the latest version, the default).
+     * 
+ * + * int64 generation = 3; + * + * @return The generation. + */ + @java.lang.Override + public long getGeneration() { + return generation_; + } + /** + * + * + *
+     * If present, selects a specific revision of this object (as opposed
+     * to the latest version, the default).
+     * 
+ * + * int64 generation = 3; + * + * @param value The generation to set. + * @return This builder for chaining. + */ + public Builder setGeneration(long value) { + + generation_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If present, selects a specific revision of this object (as opposed
+     * to the latest version, the default).
+     * 
+ * + * int64 generation = 3; + * + * @return This builder for chaining. + */ + public Builder clearGeneration() { + + generation_ = 0L; + onChanged(); + return this; + } + + private long readOffset_; + /** + * + * + *
+     * The offset for the first byte to return in the read, relative to the start
+     * of the object.
+     * A negative `read_offset` value will be interpreted as the number of bytes
+     * back from the end of the object to be returned. For example, if an object's
+     * length is 15 bytes, a ReadObjectRequest with `read_offset` = -5 and
+     * `read_limit` = 3 would return bytes 10 through 12 of the object. Requesting
+     * a negative offset whose magnitude is larger than the size of the object
+     * will result in an error.
+     * 
+ * + * int64 read_offset = 4; + * + * @return The readOffset. + */ + @java.lang.Override + public long getReadOffset() { + return readOffset_; + } + /** + * + * + *
+     * The offset for the first byte to return in the read, relative to the start
+     * of the object.
+     * A negative `read_offset` value will be interpreted as the number of bytes
+     * back from the end of the object to be returned. For example, if an object's
+     * length is 15 bytes, a ReadObjectRequest with `read_offset` = -5 and
+     * `read_limit` = 3 would return bytes 10 through 12 of the object. Requesting
+     * a negative offset whose magnitude is larger than the size of the object
+     * will result in an error.
+     * 
+ * + * int64 read_offset = 4; + * + * @param value The readOffset to set. + * @return This builder for chaining. + */ + public Builder setReadOffset(long value) { + + readOffset_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The offset for the first byte to return in the read, relative to the start
+     * of the object.
+     * A negative `read_offset` value will be interpreted as the number of bytes
+     * back from the end of the object to be returned. For example, if an object's
+     * length is 15 bytes, a ReadObjectRequest with `read_offset` = -5 and
+     * `read_limit` = 3 would return bytes 10 through 12 of the object. Requesting
+     * a negative offset whose magnitude is larger than the size of the object
+     * will result in an error.
+     * 
+ * + * int64 read_offset = 4; + * + * @return This builder for chaining. + */ + public Builder clearReadOffset() { + + readOffset_ = 0L; + onChanged(); + return this; + } + + private long readLimit_; + /** + * + * + *
+     * The maximum number of `data` bytes the server is allowed to return in the
+     * sum of all `Object` messages. A `read_limit` of zero indicates that there
+     * is no limit, and a negative `read_limit` will cause an error.
+     * If the stream returns fewer bytes than allowed by the `read_limit` and no
+     * error occurred, the stream includes all data from the `read_offset` to the
+     * end of the resource.
+     * 
+ * + * int64 read_limit = 5; + * + * @return The readLimit. + */ + @java.lang.Override + public long getReadLimit() { + return readLimit_; + } + /** + * + * + *
+     * The maximum number of `data` bytes the server is allowed to return in the
+     * sum of all `Object` messages. A `read_limit` of zero indicates that there
+     * is no limit, and a negative `read_limit` will cause an error.
+     * If the stream returns fewer bytes than allowed by the `read_limit` and no
+     * error occurred, the stream includes all data from the `read_offset` to the
+     * end of the resource.
+     * 
+ * + * int64 read_limit = 5; + * + * @param value The readLimit to set. + * @return This builder for chaining. + */ + public Builder setReadLimit(long value) { + + readLimit_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of `data` bytes the server is allowed to return in the
+     * sum of all `Object` messages. A `read_limit` of zero indicates that there
+     * is no limit, and a negative `read_limit` will cause an error.
+     * If the stream returns fewer bytes than allowed by the `read_limit` and no
+     * error occurred, the stream includes all data from the `read_offset` to the
+     * end of the resource.
+     * 
+ * + * int64 read_limit = 5; + * + * @return This builder for chaining. + */ + public Builder clearReadLimit() { + + readLimit_ = 0L; + onChanged(); + return this; + } + + private long ifGenerationMatch_; + /** + * + * + *
+     * Makes the operation conditional on whether the object's current generation
+     * matches the given value. Setting to 0 makes the operation succeed only if
+     * there are no live versions of the object.
+     * 
+ * + * int64 if_generation_match = 6; + * + * @return Whether the ifGenerationMatch field is set. + */ + @java.lang.Override + public boolean hasIfGenerationMatch() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Makes the operation conditional on whether the object's current generation
+     * matches the given value. Setting to 0 makes the operation succeed only if
+     * there are no live versions of the object.
+     * 
+ * + * int64 if_generation_match = 6; + * + * @return The ifGenerationMatch. + */ + @java.lang.Override + public long getIfGenerationMatch() { + return ifGenerationMatch_; + } + /** + * + * + *
+     * Makes the operation conditional on whether the object's current generation
+     * matches the given value. Setting to 0 makes the operation succeed only if
+     * there are no live versions of the object.
+     * 
+ * + * int64 if_generation_match = 6; + * + * @param value The ifGenerationMatch to set. + * @return This builder for chaining. + */ + public Builder setIfGenerationMatch(long value) { + bitField0_ |= 0x00000001; + ifGenerationMatch_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Makes the operation conditional on whether the object's current generation
+     * matches the given value. Setting to 0 makes the operation succeed only if
+     * there are no live versions of the object.
+     * 
+ * + * int64 if_generation_match = 6; + * + * @return This builder for chaining. + */ + public Builder clearIfGenerationMatch() { + bitField0_ = (bitField0_ & ~0x00000001); + ifGenerationMatch_ = 0L; + onChanged(); + return this; + } + + private long ifGenerationNotMatch_; + /** + * + * + *
+     * Makes the operation conditional on whether the object's current generation
+     * does not match the given value. If no live object exists, the precondition
+     * fails. Setting to 0 makes the operation succeed only if there is a live
+     * version of the object.
+     * 
+ * + * int64 if_generation_not_match = 7; + * + * @return Whether the ifGenerationNotMatch field is set. + */ + @java.lang.Override + public boolean hasIfGenerationNotMatch() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Makes the operation conditional on whether the object's current generation
+     * does not match the given value. If no live object exists, the precondition
+     * fails. Setting to 0 makes the operation succeed only if there is a live
+     * version of the object.
+     * 
+ * + * int64 if_generation_not_match = 7; + * + * @return The ifGenerationNotMatch. + */ + @java.lang.Override + public long getIfGenerationNotMatch() { + return ifGenerationNotMatch_; + } + /** + * + * + *
+     * Makes the operation conditional on whether the object's current generation
+     * does not match the given value. If no live object exists, the precondition
+     * fails. Setting to 0 makes the operation succeed only if there is a live
+     * version of the object.
+     * 
+ * + * int64 if_generation_not_match = 7; + * + * @param value The ifGenerationNotMatch to set. + * @return This builder for chaining. + */ + public Builder setIfGenerationNotMatch(long value) { + bitField0_ |= 0x00000002; + ifGenerationNotMatch_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Makes the operation conditional on whether the object's current generation
+     * does not match the given value. If no live object exists, the precondition
+     * fails. Setting to 0 makes the operation succeed only if there is a live
+     * version of the object.
+     * 
+ * + * int64 if_generation_not_match = 7; + * + * @return This builder for chaining. + */ + public Builder clearIfGenerationNotMatch() { + bitField0_ = (bitField0_ & ~0x00000002); + ifGenerationNotMatch_ = 0L; + onChanged(); + return this; + } + + private long ifMetagenerationMatch_; + /** + * + * + *
+     * Makes the operation conditional on whether the object's current
+     * metageneration matches the given value.
+     * 
+ * + * int64 if_metageneration_match = 8; + * + * @return Whether the ifMetagenerationMatch field is set. + */ + @java.lang.Override + public boolean hasIfMetagenerationMatch() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Makes the operation conditional on whether the object's current
+     * metageneration matches the given value.
+     * 
+ * + * int64 if_metageneration_match = 8; + * + * @return The ifMetagenerationMatch. + */ + @java.lang.Override + public long getIfMetagenerationMatch() { + return ifMetagenerationMatch_; + } + /** + * + * + *
+     * Makes the operation conditional on whether the object's current
+     * metageneration matches the given value.
+     * 
+ * + * int64 if_metageneration_match = 8; + * + * @param value The ifMetagenerationMatch to set. + * @return This builder for chaining. + */ + public Builder setIfMetagenerationMatch(long value) { + bitField0_ |= 0x00000004; + ifMetagenerationMatch_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Makes the operation conditional on whether the object's current
+     * metageneration matches the given value.
+     * 
+ * + * int64 if_metageneration_match = 8; + * + * @return This builder for chaining. + */ + public Builder clearIfMetagenerationMatch() { + bitField0_ = (bitField0_ & ~0x00000004); + ifMetagenerationMatch_ = 0L; + onChanged(); + return this; + } + + private long ifMetagenerationNotMatch_; + /** + * + * + *
+     * Makes the operation conditional on whether the object's current
+     * metageneration does not match the given value.
+     * 
+ * + * int64 if_metageneration_not_match = 9; + * + * @return Whether the ifMetagenerationNotMatch field is set. + */ + @java.lang.Override + public boolean hasIfMetagenerationNotMatch() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Makes the operation conditional on whether the object's current
+     * metageneration does not match the given value.
+     * 
+ * + * int64 if_metageneration_not_match = 9; + * + * @return The ifMetagenerationNotMatch. + */ + @java.lang.Override + public long getIfMetagenerationNotMatch() { + return ifMetagenerationNotMatch_; + } + /** + * + * + *
+     * Makes the operation conditional on whether the object's current
+     * metageneration does not match the given value.
+     * 
+ * + * int64 if_metageneration_not_match = 9; + * + * @param value The ifMetagenerationNotMatch to set. + * @return This builder for chaining. + */ + public Builder setIfMetagenerationNotMatch(long value) { + bitField0_ |= 0x00000008; + ifMetagenerationNotMatch_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Makes the operation conditional on whether the object's current
+     * metageneration does not match the given value.
+     * 
+ * + * int64 if_metageneration_not_match = 9; + * + * @return This builder for chaining. + */ + public Builder clearIfMetagenerationNotMatch() { + bitField0_ = (bitField0_ & ~0x00000008); + ifMetagenerationNotMatch_ = 0L; + onChanged(); + return this; + } + + private com.google.storage.v2.CommonObjectRequestParams commonObjectRequestParams_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.CommonObjectRequestParams, + com.google.storage.v2.CommonObjectRequestParams.Builder, + com.google.storage.v2.CommonObjectRequestParamsOrBuilder> + commonObjectRequestParamsBuilder_; + /** + * + * + *
+     * A set of parameters common to Storage API requests concerning an object.
+     * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; + * + * @return Whether the commonObjectRequestParams field is set. + */ + public boolean hasCommonObjectRequestParams() { + return commonObjectRequestParamsBuilder_ != null || commonObjectRequestParams_ != null; + } + /** + * + * + *
+     * A set of parameters common to Storage API requests concerning an object.
+     * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; + * + * @return The commonObjectRequestParams. + */ + public com.google.storage.v2.CommonObjectRequestParams getCommonObjectRequestParams() { + if (commonObjectRequestParamsBuilder_ == null) { + return commonObjectRequestParams_ == null + ? com.google.storage.v2.CommonObjectRequestParams.getDefaultInstance() + : commonObjectRequestParams_; + } else { + return commonObjectRequestParamsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * A set of parameters common to Storage API requests concerning an object.
+     * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; + */ + public Builder setCommonObjectRequestParams( + com.google.storage.v2.CommonObjectRequestParams value) { + if (commonObjectRequestParamsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + commonObjectRequestParams_ = value; + onChanged(); + } else { + commonObjectRequestParamsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * A set of parameters common to Storage API requests concerning an object.
+     * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; + */ + public Builder setCommonObjectRequestParams( + com.google.storage.v2.CommonObjectRequestParams.Builder builderForValue) { + if (commonObjectRequestParamsBuilder_ == null) { + commonObjectRequestParams_ = builderForValue.build(); + onChanged(); + } else { + commonObjectRequestParamsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * A set of parameters common to Storage API requests concerning an object.
+     * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; + */ + public Builder mergeCommonObjectRequestParams( + com.google.storage.v2.CommonObjectRequestParams value) { + if (commonObjectRequestParamsBuilder_ == null) { + if (commonObjectRequestParams_ != null) { + commonObjectRequestParams_ = + com.google.storage.v2.CommonObjectRequestParams.newBuilder(commonObjectRequestParams_) + .mergeFrom(value) + .buildPartial(); + } else { + commonObjectRequestParams_ = value; + } + onChanged(); + } else { + commonObjectRequestParamsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * A set of parameters common to Storage API requests concerning an object.
+     * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; + */ + public Builder clearCommonObjectRequestParams() { + if (commonObjectRequestParamsBuilder_ == null) { + commonObjectRequestParams_ = null; + onChanged(); + } else { + commonObjectRequestParams_ = null; + commonObjectRequestParamsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * A set of parameters common to Storage API requests concerning an object.
+     * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; + */ + public com.google.storage.v2.CommonObjectRequestParams.Builder + getCommonObjectRequestParamsBuilder() { + + onChanged(); + return getCommonObjectRequestParamsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A set of parameters common to Storage API requests concerning an object.
+     * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; + */ + public com.google.storage.v2.CommonObjectRequestParamsOrBuilder + getCommonObjectRequestParamsOrBuilder() { + if (commonObjectRequestParamsBuilder_ != null) { + return commonObjectRequestParamsBuilder_.getMessageOrBuilder(); + } else { + return commonObjectRequestParams_ == null + ? com.google.storage.v2.CommonObjectRequestParams.getDefaultInstance() + : commonObjectRequestParams_; + } + } + /** + * + * + *
+     * A set of parameters common to Storage API requests concerning an object.
+     * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.CommonObjectRequestParams, + com.google.storage.v2.CommonObjectRequestParams.Builder, + com.google.storage.v2.CommonObjectRequestParamsOrBuilder> + getCommonObjectRequestParamsFieldBuilder() { + if (commonObjectRequestParamsBuilder_ == null) { + commonObjectRequestParamsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.CommonObjectRequestParams, + com.google.storage.v2.CommonObjectRequestParams.Builder, + com.google.storage.v2.CommonObjectRequestParamsOrBuilder>( + getCommonObjectRequestParams(), getParentForChildren(), isClean()); + commonObjectRequestParams_ = null; + } + return commonObjectRequestParamsBuilder_; + } + + private com.google.storage.v2.CommonRequestParams commonRequestParams_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.CommonRequestParams, + com.google.storage.v2.CommonRequestParams.Builder, + com.google.storage.v2.CommonRequestParamsOrBuilder> + commonRequestParamsBuilder_; + /** + * + * + *
+     * A set of parameters common to all Storage API requests.
+     * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 11; + * + * @return Whether the commonRequestParams field is set. + */ + public boolean hasCommonRequestParams() { + return commonRequestParamsBuilder_ != null || commonRequestParams_ != null; + } + /** + * + * + *
+     * A set of parameters common to all Storage API requests.
+     * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 11; + * + * @return The commonRequestParams. + */ + public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { + if (commonRequestParamsBuilder_ == null) { + return commonRequestParams_ == null + ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() + : commonRequestParams_; + } else { + return commonRequestParamsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * A set of parameters common to all Storage API requests.
+     * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 11; + */ + public Builder setCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { + if (commonRequestParamsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + commonRequestParams_ = value; + onChanged(); + } else { + commonRequestParamsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * A set of parameters common to all Storage API requests.
+     * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 11; + */ + public Builder setCommonRequestParams( + com.google.storage.v2.CommonRequestParams.Builder builderForValue) { + if (commonRequestParamsBuilder_ == null) { + commonRequestParams_ = builderForValue.build(); + onChanged(); + } else { + commonRequestParamsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * A set of parameters common to all Storage API requests.
+     * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 11; + */ + public Builder mergeCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { + if (commonRequestParamsBuilder_ == null) { + if (commonRequestParams_ != null) { + commonRequestParams_ = + com.google.storage.v2.CommonRequestParams.newBuilder(commonRequestParams_) + .mergeFrom(value) + .buildPartial(); + } else { + commonRequestParams_ = value; + } + onChanged(); + } else { + commonRequestParamsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * A set of parameters common to all Storage API requests.
+     * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 11; + */ + public Builder clearCommonRequestParams() { + if (commonRequestParamsBuilder_ == null) { + commonRequestParams_ = null; + onChanged(); + } else { + commonRequestParams_ = null; + commonRequestParamsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * A set of parameters common to all Storage API requests.
+     * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 11; + */ + public com.google.storage.v2.CommonRequestParams.Builder getCommonRequestParamsBuilder() { + + onChanged(); + return getCommonRequestParamsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A set of parameters common to all Storage API requests.
+     * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 11; + */ + public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { + if (commonRequestParamsBuilder_ != null) { + return commonRequestParamsBuilder_.getMessageOrBuilder(); + } else { + return commonRequestParams_ == null + ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() + : commonRequestParams_; + } + } + /** + * + * + *
+     * A set of parameters common to all Storage API requests.
+     * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 11; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.CommonRequestParams, + com.google.storage.v2.CommonRequestParams.Builder, + com.google.storage.v2.CommonRequestParamsOrBuilder> + getCommonRequestParamsFieldBuilder() { + if (commonRequestParamsBuilder_ == null) { + commonRequestParamsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.CommonRequestParams, + com.google.storage.v2.CommonRequestParams.Builder, + com.google.storage.v2.CommonRequestParamsOrBuilder>( + getCommonRequestParams(), getParentForChildren(), isClean()); + commonRequestParams_ = null; + } + return commonRequestParamsBuilder_; + } + + private com.google.protobuf.FieldMask readMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + readMaskBuilder_; + /** + * + * + *
+     * Mask specifying which fields to read.
+     * The checksummed_data field and its children will always be present.
+     * If no mask is specified, will default to all fields except metadata.owner
+     * and metadata.acl.
+     * * may be used to mean "all fields".
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 12; + * + * @return Whether the readMask field is set. + */ + public boolean hasReadMask() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Mask specifying which fields to read.
+     * The checksummed_data field and its children will always be present.
+     * If no mask is specified, will default to all fields except metadata.owner
+     * and metadata.acl.
+     * * may be used to mean "all fields".
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 12; + * + * @return The readMask. + */ + public com.google.protobuf.FieldMask getReadMask() { + if (readMaskBuilder_ == null) { + return readMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : readMask_; + } else { + return readMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Mask specifying which fields to read.
+     * The checksummed_data field and its children will always be present.
+     * If no mask is specified, will default to all fields except metadata.owner
+     * and metadata.acl.
+     * * may be used to mean "all fields".
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 12; + */ + public Builder setReadMask(com.google.protobuf.FieldMask value) { + if (readMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + readMask_ = value; + onChanged(); + } else { + readMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + return this; + } + /** + * + * + *
+     * Mask specifying which fields to read.
+     * The checksummed_data field and its children will always be present.
+     * If no mask is specified, will default to all fields except metadata.owner
+     * and metadata.acl.
+     * * may be used to mean "all fields".
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 12; + */ + public Builder setReadMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (readMaskBuilder_ == null) { + readMask_ = builderForValue.build(); + onChanged(); + } else { + readMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + return this; + } + /** + * + * + *
+     * Mask specifying which fields to read.
+     * The checksummed_data field and its children will always be present.
+     * If no mask is specified, will default to all fields except metadata.owner
+     * and metadata.acl.
+     * * may be used to mean "all fields".
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 12; + */ + public Builder mergeReadMask(com.google.protobuf.FieldMask value) { + if (readMaskBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && readMask_ != null + && readMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + readMask_ = + com.google.protobuf.FieldMask.newBuilder(readMask_).mergeFrom(value).buildPartial(); + } else { + readMask_ = value; + } + onChanged(); + } else { + readMaskBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + return this; + } + /** + * + * + *
+     * Mask specifying which fields to read.
+     * The checksummed_data field and its children will always be present.
+     * If no mask is specified, will default to all fields except metadata.owner
+     * and metadata.acl.
+     * * may be used to mean "all fields".
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 12; + */ + public Builder clearReadMask() { + if (readMaskBuilder_ == null) { + readMask_ = null; + onChanged(); + } else { + readMaskBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000010); + return this; + } + /** + * + * + *
+     * Mask specifying which fields to read.
+     * The checksummed_data field and its children will always be present.
+     * If no mask is specified, will default to all fields except metadata.owner
+     * and metadata.acl.
+     * * may be used to mean "all fields".
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 12; + */ + public com.google.protobuf.FieldMask.Builder getReadMaskBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getReadMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Mask specifying which fields to read.
+     * The checksummed_data field and its children will always be present.
+     * If no mask is specified, will default to all fields except metadata.owner
+     * and metadata.acl.
+     * * may be used to mean "all fields".
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 12; + */ + public com.google.protobuf.FieldMaskOrBuilder getReadMaskOrBuilder() { + if (readMaskBuilder_ != null) { + return readMaskBuilder_.getMessageOrBuilder(); + } else { + return readMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : readMask_; + } + } + /** + * + * + *
+     * Mask specifying which fields to read.
+     * The checksummed_data field and its children will always be present.
+     * If no mask is specified, will default to all fields except metadata.owner
+     * and metadata.acl.
+     * * may be used to mean "all fields".
+     * 
+ * + * .google.protobuf.FieldMask read_mask = 12; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getReadMaskFieldBuilder() { + if (readMaskBuilder_ == null) { + readMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getReadMask(), getParentForChildren(), isClean()); + readMask_ = null; + } + return readMaskBuilder_; + } + + @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.ReadObjectRequest) + } + + // @@protoc_insertion_point(class_scope:google.storage.v2.ReadObjectRequest) + private static final com.google.storage.v2.ReadObjectRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.v2.ReadObjectRequest(); + } + + public static com.google.storage.v2.ReadObjectRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReadObjectRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ReadObjectRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.storage.v2.ReadObjectRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadObjectRequestOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadObjectRequestOrBuilder.java new file mode 100644 index 0000000000..bf9a680667 --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadObjectRequestOrBuilder.java @@ -0,0 +1,358 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +package com.google.storage.v2; + +public interface ReadObjectRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.ReadObjectRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The name of the bucket containing the object to read.
+   * 
+ * + * string bucket = 1; + * + * @return The bucket. + */ + java.lang.String getBucket(); + /** + * + * + *
+   * The name of the bucket containing the object to read.
+   * 
+ * + * string bucket = 1; + * + * @return The bytes for bucket. + */ + com.google.protobuf.ByteString getBucketBytes(); + + /** + * + * + *
+   * The name of the object to read.
+   * 
+ * + * string object = 2; + * + * @return The object. + */ + java.lang.String getObject(); + /** + * + * + *
+   * The name of the object to read.
+   * 
+ * + * string object = 2; + * + * @return The bytes for object. + */ + com.google.protobuf.ByteString getObjectBytes(); + + /** + * + * + *
+   * If present, selects a specific revision of this object (as opposed
+   * to the latest version, the default).
+   * 
+ * + * int64 generation = 3; + * + * @return The generation. + */ + long getGeneration(); + + /** + * + * + *
+   * The offset for the first byte to return in the read, relative to the start
+   * of the object.
+   * A negative `read_offset` value will be interpreted as the number of bytes
+   * back from the end of the object to be returned. For example, if an object's
+   * length is 15 bytes, a ReadObjectRequest with `read_offset` = -5 and
+   * `read_limit` = 3 would return bytes 10 through 12 of the object. Requesting
+   * a negative offset whose magnitude is larger than the size of the object
+   * will result in an error.
+   * 
+ * + * int64 read_offset = 4; + * + * @return The readOffset. + */ + long getReadOffset(); + + /** + * + * + *
+   * The maximum number of `data` bytes the server is allowed to return in the
+   * sum of all `Object` messages. A `read_limit` of zero indicates that there
+   * is no limit, and a negative `read_limit` will cause an error.
+   * If the stream returns fewer bytes than allowed by the `read_limit` and no
+   * error occurred, the stream includes all data from the `read_offset` to the
+   * end of the resource.
+   * 
+ * + * int64 read_limit = 5; + * + * @return The readLimit. + */ + long getReadLimit(); + + /** + * + * + *
+   * Makes the operation conditional on whether the object's current generation
+   * matches the given value. Setting to 0 makes the operation succeed only if
+   * there are no live versions of the object.
+   * 
+ * + * int64 if_generation_match = 6; + * + * @return Whether the ifGenerationMatch field is set. + */ + boolean hasIfGenerationMatch(); + /** + * + * + *
+   * Makes the operation conditional on whether the object's current generation
+   * matches the given value. Setting to 0 makes the operation succeed only if
+   * there are no live versions of the object.
+   * 
+ * + * int64 if_generation_match = 6; + * + * @return The ifGenerationMatch. + */ + long getIfGenerationMatch(); + + /** + * + * + *
+   * Makes the operation conditional on whether the object's current generation
+   * does not match the given value. If no live object exists, the precondition
+   * fails. Setting to 0 makes the operation succeed only if there is a live
+   * version of the object.
+   * 
+ * + * int64 if_generation_not_match = 7; + * + * @return Whether the ifGenerationNotMatch field is set. + */ + boolean hasIfGenerationNotMatch(); + /** + * + * + *
+   * Makes the operation conditional on whether the object's current generation
+   * does not match the given value. If no live object exists, the precondition
+   * fails. Setting to 0 makes the operation succeed only if there is a live
+   * version of the object.
+   * 
+ * + * int64 if_generation_not_match = 7; + * + * @return The ifGenerationNotMatch. + */ + long getIfGenerationNotMatch(); + + /** + * + * + *
+   * Makes the operation conditional on whether the object's current
+   * metageneration matches the given value.
+   * 
+ * + * int64 if_metageneration_match = 8; + * + * @return Whether the ifMetagenerationMatch field is set. + */ + boolean hasIfMetagenerationMatch(); + /** + * + * + *
+   * Makes the operation conditional on whether the object's current
+   * metageneration matches the given value.
+   * 
+ * + * int64 if_metageneration_match = 8; + * + * @return The ifMetagenerationMatch. + */ + long getIfMetagenerationMatch(); + + /** + * + * + *
+   * Makes the operation conditional on whether the object's current
+   * metageneration does not match the given value.
+   * 
+ * + * int64 if_metageneration_not_match = 9; + * + * @return Whether the ifMetagenerationNotMatch field is set. + */ + boolean hasIfMetagenerationNotMatch(); + /** + * + * + *
+   * Makes the operation conditional on whether the object's current
+   * metageneration does not match the given value.
+   * 
+ * + * int64 if_metageneration_not_match = 9; + * + * @return The ifMetagenerationNotMatch. + */ + long getIfMetagenerationNotMatch(); + + /** + * + * + *
+   * A set of parameters common to Storage API requests concerning an object.
+   * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; + * + * @return Whether the commonObjectRequestParams field is set. + */ + boolean hasCommonObjectRequestParams(); + /** + * + * + *
+   * A set of parameters common to Storage API requests concerning an object.
+   * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; + * + * @return The commonObjectRequestParams. + */ + com.google.storage.v2.CommonObjectRequestParams getCommonObjectRequestParams(); + /** + * + * + *
+   * A set of parameters common to Storage API requests concerning an object.
+   * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 10; + */ + com.google.storage.v2.CommonObjectRequestParamsOrBuilder getCommonObjectRequestParamsOrBuilder(); + + /** + * + * + *
+   * A set of parameters common to all Storage API requests.
+   * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 11; + * + * @return Whether the commonRequestParams field is set. + */ + boolean hasCommonRequestParams(); + /** + * + * + *
+   * A set of parameters common to all Storage API requests.
+   * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 11; + * + * @return The commonRequestParams. + */ + com.google.storage.v2.CommonRequestParams getCommonRequestParams(); + /** + * + * + *
+   * A set of parameters common to all Storage API requests.
+   * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 11; + */ + com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder(); + + /** + * + * + *
+   * Mask specifying which fields to read.
+   * The checksummed_data field and its children will always be present.
+   * If no mask is specified, will default to all fields except metadata.owner
+   * and metadata.acl.
+   * * may be used to mean "all fields".
+   * 
+ * + * .google.protobuf.FieldMask read_mask = 12; + * + * @return Whether the readMask field is set. + */ + boolean hasReadMask(); + /** + * + * + *
+   * Mask specifying which fields to read.
+   * The checksummed_data field and its children will always be present.
+   * If no mask is specified, will default to all fields except metadata.owner
+   * and metadata.acl.
+   * * may be used to mean "all fields".
+   * 
+ * + * .google.protobuf.FieldMask read_mask = 12; + * + * @return The readMask. + */ + com.google.protobuf.FieldMask getReadMask(); + /** + * + * + *
+   * Mask specifying which fields to read.
+   * The checksummed_data field and its children will always be present.
+   * If no mask is specified, will default to all fields except metadata.owner
+   * and metadata.acl.
+   * * may be used to mean "all fields".
+   * 
+ * + * .google.protobuf.FieldMask read_mask = 12; + */ + com.google.protobuf.FieldMaskOrBuilder getReadMaskOrBuilder(); +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadObjectResponse.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadObjectResponse.java new file mode 100644 index 0000000000..9ba19e2fe1 --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadObjectResponse.java @@ -0,0 +1,1649 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +package com.google.storage.v2; + +/** + * + * + *
+ * Response message for GetObject.
+ * 
+ * + * Protobuf type {@code google.storage.v2.ReadObjectResponse} + */ +public final class ReadObjectResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.v2.ReadObjectResponse) + ReadObjectResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ReadObjectResponse.newBuilder() to construct. + private ReadObjectResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ReadObjectResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ReadObjectResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ReadObjectResponse( + 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.ChecksummedData.Builder subBuilder = null; + if (checksummedData_ != null) { + subBuilder = checksummedData_.toBuilder(); + } + checksummedData_ = + input.readMessage( + com.google.storage.v2.ChecksummedData.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(checksummedData_); + checksummedData_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.storage.v2.ObjectChecksums.Builder subBuilder = null; + if (objectChecksums_ != null) { + subBuilder = objectChecksums_.toBuilder(); + } + objectChecksums_ = + input.readMessage( + com.google.storage.v2.ObjectChecksums.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(objectChecksums_); + objectChecksums_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.storage.v2.ContentRange.Builder subBuilder = null; + if (contentRange_ != null) { + subBuilder = contentRange_.toBuilder(); + } + contentRange_ = + input.readMessage(com.google.storage.v2.ContentRange.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(contentRange_); + contentRange_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + com.google.storage.v2.Object.Builder subBuilder = null; + if (metadata_ != null) { + subBuilder = metadata_.toBuilder(); + } + metadata_ = + input.readMessage(com.google.storage.v2.Object.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(metadata_); + metadata_ = 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_ReadObjectResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ReadObjectResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.ReadObjectResponse.class, + com.google.storage.v2.ReadObjectResponse.Builder.class); + } + + public static final int CHECKSUMMED_DATA_FIELD_NUMBER = 1; + private com.google.storage.v2.ChecksummedData checksummedData_; + /** + * + * + *
+   * A portion of the data for the object. The service **may** leave `data`
+   * empty for any given `ReadResponse`. This enables the service to inform the
+   * client that the request is still live while it is running an operation to
+   * generate more data.
+   * 
+ * + * .google.storage.v2.ChecksummedData checksummed_data = 1; + * + * @return Whether the checksummedData field is set. + */ + @java.lang.Override + public boolean hasChecksummedData() { + return checksummedData_ != null; + } + /** + * + * + *
+   * A portion of the data for the object. The service **may** leave `data`
+   * empty for any given `ReadResponse`. This enables the service to inform the
+   * client that the request is still live while it is running an operation to
+   * generate more data.
+   * 
+ * + * .google.storage.v2.ChecksummedData checksummed_data = 1; + * + * @return The checksummedData. + */ + @java.lang.Override + public com.google.storage.v2.ChecksummedData getChecksummedData() { + return checksummedData_ == null + ? com.google.storage.v2.ChecksummedData.getDefaultInstance() + : checksummedData_; + } + /** + * + * + *
+   * A portion of the data for the object. The service **may** leave `data`
+   * empty for any given `ReadResponse`. This enables the service to inform the
+   * client that the request is still live while it is running an operation to
+   * generate more data.
+   * 
+ * + * .google.storage.v2.ChecksummedData checksummed_data = 1; + */ + @java.lang.Override + public com.google.storage.v2.ChecksummedDataOrBuilder getChecksummedDataOrBuilder() { + return getChecksummedData(); + } + + public static final int OBJECT_CHECKSUMS_FIELD_NUMBER = 2; + private com.google.storage.v2.ObjectChecksums objectChecksums_; + /** + * + * + *
+   * The checksums of the complete object. The client should compute one of
+   * these checksums over the downloaded object and compare it against the value
+   * provided here.
+   * 
+ * + * .google.storage.v2.ObjectChecksums object_checksums = 2; + * + * @return Whether the objectChecksums field is set. + */ + @java.lang.Override + public boolean hasObjectChecksums() { + return objectChecksums_ != null; + } + /** + * + * + *
+   * The checksums of the complete object. The client should compute one of
+   * these checksums over the downloaded object and compare it against the value
+   * provided here.
+   * 
+ * + * .google.storage.v2.ObjectChecksums object_checksums = 2; + * + * @return The objectChecksums. + */ + @java.lang.Override + public com.google.storage.v2.ObjectChecksums getObjectChecksums() { + return objectChecksums_ == null + ? com.google.storage.v2.ObjectChecksums.getDefaultInstance() + : objectChecksums_; + } + /** + * + * + *
+   * The checksums of the complete object. The client should compute one of
+   * these checksums over the downloaded object and compare it against the value
+   * provided here.
+   * 
+ * + * .google.storage.v2.ObjectChecksums object_checksums = 2; + */ + @java.lang.Override + public com.google.storage.v2.ObjectChecksumsOrBuilder getObjectChecksumsOrBuilder() { + return getObjectChecksums(); + } + + public static final int CONTENT_RANGE_FIELD_NUMBER = 3; + private com.google.storage.v2.ContentRange contentRange_; + /** + * + * + *
+   * If read_offset and or read_limit was specified on the
+   * ReadObjectRequest, ContentRange will be populated on the first
+   * ReadObjectResponse message of the read stream.
+   * 
+ * + * .google.storage.v2.ContentRange content_range = 3; + * + * @return Whether the contentRange field is set. + */ + @java.lang.Override + public boolean hasContentRange() { + return contentRange_ != null; + } + /** + * + * + *
+   * If read_offset and or read_limit was specified on the
+   * ReadObjectRequest, ContentRange will be populated on the first
+   * ReadObjectResponse message of the read stream.
+   * 
+ * + * .google.storage.v2.ContentRange content_range = 3; + * + * @return The contentRange. + */ + @java.lang.Override + public com.google.storage.v2.ContentRange getContentRange() { + return contentRange_ == null + ? com.google.storage.v2.ContentRange.getDefaultInstance() + : contentRange_; + } + /** + * + * + *
+   * If read_offset and or read_limit was specified on the
+   * ReadObjectRequest, ContentRange will be populated on the first
+   * ReadObjectResponse message of the read stream.
+   * 
+ * + * .google.storage.v2.ContentRange content_range = 3; + */ + @java.lang.Override + public com.google.storage.v2.ContentRangeOrBuilder getContentRangeOrBuilder() { + return getContentRange(); + } + + public static final int METADATA_FIELD_NUMBER = 4; + private com.google.storage.v2.Object metadata_; + /** + * + * + *
+   * Metadata of the object whose media is being returned.
+   * Only populated in the first response in the stream.
+   * 
+ * + * .google.storage.v2.Object metadata = 4; + * + * @return Whether the metadata field is set. + */ + @java.lang.Override + public boolean hasMetadata() { + return metadata_ != null; + } + /** + * + * + *
+   * Metadata of the object whose media is being returned.
+   * Only populated in the first response in the stream.
+   * 
+ * + * .google.storage.v2.Object metadata = 4; + * + * @return The metadata. + */ + @java.lang.Override + public com.google.storage.v2.Object getMetadata() { + return metadata_ == null ? com.google.storage.v2.Object.getDefaultInstance() : metadata_; + } + /** + * + * + *
+   * Metadata of the object whose media is being returned.
+   * Only populated in the first response in the stream.
+   * 
+ * + * .google.storage.v2.Object metadata = 4; + */ + @java.lang.Override + public com.google.storage.v2.ObjectOrBuilder getMetadataOrBuilder() { + return getMetadata(); + } + + 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 (checksummedData_ != null) { + output.writeMessage(1, getChecksummedData()); + } + if (objectChecksums_ != null) { + output.writeMessage(2, getObjectChecksums()); + } + if (contentRange_ != null) { + output.writeMessage(3, getContentRange()); + } + if (metadata_ != null) { + output.writeMessage(4, getMetadata()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (checksummedData_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getChecksummedData()); + } + if (objectChecksums_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getObjectChecksums()); + } + if (contentRange_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getContentRange()); + } + if (metadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getMetadata()); + } + 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.ReadObjectResponse)) { + return super.equals(obj); + } + com.google.storage.v2.ReadObjectResponse other = (com.google.storage.v2.ReadObjectResponse) obj; + + if (hasChecksummedData() != other.hasChecksummedData()) return false; + if (hasChecksummedData()) { + if (!getChecksummedData().equals(other.getChecksummedData())) return false; + } + if (hasObjectChecksums() != other.hasObjectChecksums()) return false; + if (hasObjectChecksums()) { + if (!getObjectChecksums().equals(other.getObjectChecksums())) return false; + } + if (hasContentRange() != other.hasContentRange()) return false; + if (hasContentRange()) { + if (!getContentRange().equals(other.getContentRange())) return false; + } + if (hasMetadata() != other.hasMetadata()) return false; + if (hasMetadata()) { + if (!getMetadata().equals(other.getMetadata())) 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 (hasChecksummedData()) { + hash = (37 * hash) + CHECKSUMMED_DATA_FIELD_NUMBER; + hash = (53 * hash) + getChecksummedData().hashCode(); + } + if (hasObjectChecksums()) { + hash = (37 * hash) + OBJECT_CHECKSUMS_FIELD_NUMBER; + hash = (53 * hash) + getObjectChecksums().hashCode(); + } + if (hasContentRange()) { + hash = (37 * hash) + CONTENT_RANGE_FIELD_NUMBER; + hash = (53 * hash) + getContentRange().hashCode(); + } + if (hasMetadata()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + getMetadata().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.v2.ReadObjectResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.ReadObjectResponse 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.ReadObjectResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.ReadObjectResponse 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.ReadObjectResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.ReadObjectResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.ReadObjectResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.ReadObjectResponse 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.ReadObjectResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.v2.ReadObjectResponse 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.ReadObjectResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.ReadObjectResponse 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.ReadObjectResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for GetObject.
+   * 
+ * + * Protobuf type {@code google.storage.v2.ReadObjectResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.ReadObjectResponse) + com.google.storage.v2.ReadObjectResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ReadObjectResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ReadObjectResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.ReadObjectResponse.class, + com.google.storage.v2.ReadObjectResponse.Builder.class); + } + + // Construct using com.google.storage.v2.ReadObjectResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (checksummedDataBuilder_ == null) { + checksummedData_ = null; + } else { + checksummedData_ = null; + checksummedDataBuilder_ = null; + } + if (objectChecksumsBuilder_ == null) { + objectChecksums_ = null; + } else { + objectChecksums_ = null; + objectChecksumsBuilder_ = null; + } + if (contentRangeBuilder_ == null) { + contentRange_ = null; + } else { + contentRange_ = null; + contentRangeBuilder_ = null; + } + if (metadataBuilder_ == null) { + metadata_ = null; + } else { + metadata_ = null; + metadataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ReadObjectResponse_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.ReadObjectResponse getDefaultInstanceForType() { + return com.google.storage.v2.ReadObjectResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.ReadObjectResponse build() { + com.google.storage.v2.ReadObjectResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.ReadObjectResponse buildPartial() { + com.google.storage.v2.ReadObjectResponse result = + new com.google.storage.v2.ReadObjectResponse(this); + if (checksummedDataBuilder_ == null) { + result.checksummedData_ = checksummedData_; + } else { + result.checksummedData_ = checksummedDataBuilder_.build(); + } + if (objectChecksumsBuilder_ == null) { + result.objectChecksums_ = objectChecksums_; + } else { + result.objectChecksums_ = objectChecksumsBuilder_.build(); + } + if (contentRangeBuilder_ == null) { + result.contentRange_ = contentRange_; + } else { + result.contentRange_ = contentRangeBuilder_.build(); + } + if (metadataBuilder_ == null) { + result.metadata_ = metadata_; + } else { + result.metadata_ = metadataBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.storage.v2.ReadObjectResponse) { + return mergeFrom((com.google.storage.v2.ReadObjectResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.ReadObjectResponse other) { + if (other == com.google.storage.v2.ReadObjectResponse.getDefaultInstance()) return this; + if (other.hasChecksummedData()) { + mergeChecksummedData(other.getChecksummedData()); + } + if (other.hasObjectChecksums()) { + mergeObjectChecksums(other.getObjectChecksums()); + } + if (other.hasContentRange()) { + mergeContentRange(other.getContentRange()); + } + if (other.hasMetadata()) { + mergeMetadata(other.getMetadata()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.storage.v2.ReadObjectResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.storage.v2.ReadObjectResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.storage.v2.ChecksummedData checksummedData_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.ChecksummedData, + com.google.storage.v2.ChecksummedData.Builder, + com.google.storage.v2.ChecksummedDataOrBuilder> + checksummedDataBuilder_; + /** + * + * + *
+     * A portion of the data for the object. The service **may** leave `data`
+     * empty for any given `ReadResponse`. This enables the service to inform the
+     * client that the request is still live while it is running an operation to
+     * generate more data.
+     * 
+ * + * .google.storage.v2.ChecksummedData checksummed_data = 1; + * + * @return Whether the checksummedData field is set. + */ + public boolean hasChecksummedData() { + return checksummedDataBuilder_ != null || checksummedData_ != null; + } + /** + * + * + *
+     * A portion of the data for the object. The service **may** leave `data`
+     * empty for any given `ReadResponse`. This enables the service to inform the
+     * client that the request is still live while it is running an operation to
+     * generate more data.
+     * 
+ * + * .google.storage.v2.ChecksummedData checksummed_data = 1; + * + * @return The checksummedData. + */ + public com.google.storage.v2.ChecksummedData getChecksummedData() { + if (checksummedDataBuilder_ == null) { + return checksummedData_ == null + ? com.google.storage.v2.ChecksummedData.getDefaultInstance() + : checksummedData_; + } else { + return checksummedDataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * A portion of the data for the object. The service **may** leave `data`
+     * empty for any given `ReadResponse`. This enables the service to inform the
+     * client that the request is still live while it is running an operation to
+     * generate more data.
+     * 
+ * + * .google.storage.v2.ChecksummedData checksummed_data = 1; + */ + public Builder setChecksummedData(com.google.storage.v2.ChecksummedData value) { + if (checksummedDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + checksummedData_ = value; + onChanged(); + } else { + checksummedDataBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * A portion of the data for the object. The service **may** leave `data`
+     * empty for any given `ReadResponse`. This enables the service to inform the
+     * client that the request is still live while it is running an operation to
+     * generate more data.
+     * 
+ * + * .google.storage.v2.ChecksummedData checksummed_data = 1; + */ + public Builder setChecksummedData( + com.google.storage.v2.ChecksummedData.Builder builderForValue) { + if (checksummedDataBuilder_ == null) { + checksummedData_ = builderForValue.build(); + onChanged(); + } else { + checksummedDataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * A portion of the data for the object. The service **may** leave `data`
+     * empty for any given `ReadResponse`. This enables the service to inform the
+     * client that the request is still live while it is running an operation to
+     * generate more data.
+     * 
+ * + * .google.storage.v2.ChecksummedData checksummed_data = 1; + */ + public Builder mergeChecksummedData(com.google.storage.v2.ChecksummedData value) { + if (checksummedDataBuilder_ == null) { + if (checksummedData_ != null) { + checksummedData_ = + com.google.storage.v2.ChecksummedData.newBuilder(checksummedData_) + .mergeFrom(value) + .buildPartial(); + } else { + checksummedData_ = value; + } + onChanged(); + } else { + checksummedDataBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * A portion of the data for the object. The service **may** leave `data`
+     * empty for any given `ReadResponse`. This enables the service to inform the
+     * client that the request is still live while it is running an operation to
+     * generate more data.
+     * 
+ * + * .google.storage.v2.ChecksummedData checksummed_data = 1; + */ + public Builder clearChecksummedData() { + if (checksummedDataBuilder_ == null) { + checksummedData_ = null; + onChanged(); + } else { + checksummedData_ = null; + checksummedDataBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * A portion of the data for the object. The service **may** leave `data`
+     * empty for any given `ReadResponse`. This enables the service to inform the
+     * client that the request is still live while it is running an operation to
+     * generate more data.
+     * 
+ * + * .google.storage.v2.ChecksummedData checksummed_data = 1; + */ + public com.google.storage.v2.ChecksummedData.Builder getChecksummedDataBuilder() { + + onChanged(); + return getChecksummedDataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A portion of the data for the object. The service **may** leave `data`
+     * empty for any given `ReadResponse`. This enables the service to inform the
+     * client that the request is still live while it is running an operation to
+     * generate more data.
+     * 
+ * + * .google.storage.v2.ChecksummedData checksummed_data = 1; + */ + public com.google.storage.v2.ChecksummedDataOrBuilder getChecksummedDataOrBuilder() { + if (checksummedDataBuilder_ != null) { + return checksummedDataBuilder_.getMessageOrBuilder(); + } else { + return checksummedData_ == null + ? com.google.storage.v2.ChecksummedData.getDefaultInstance() + : checksummedData_; + } + } + /** + * + * + *
+     * A portion of the data for the object. The service **may** leave `data`
+     * empty for any given `ReadResponse`. This enables the service to inform the
+     * client that the request is still live while it is running an operation to
+     * generate more data.
+     * 
+ * + * .google.storage.v2.ChecksummedData checksummed_data = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.ChecksummedData, + com.google.storage.v2.ChecksummedData.Builder, + com.google.storage.v2.ChecksummedDataOrBuilder> + getChecksummedDataFieldBuilder() { + if (checksummedDataBuilder_ == null) { + checksummedDataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.ChecksummedData, + com.google.storage.v2.ChecksummedData.Builder, + com.google.storage.v2.ChecksummedDataOrBuilder>( + getChecksummedData(), getParentForChildren(), isClean()); + checksummedData_ = null; + } + return checksummedDataBuilder_; + } + + private com.google.storage.v2.ObjectChecksums objectChecksums_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.ObjectChecksums, + com.google.storage.v2.ObjectChecksums.Builder, + com.google.storage.v2.ObjectChecksumsOrBuilder> + objectChecksumsBuilder_; + /** + * + * + *
+     * The checksums of the complete object. The client should compute one of
+     * these checksums over the downloaded object and compare it against the value
+     * provided here.
+     * 
+ * + * .google.storage.v2.ObjectChecksums object_checksums = 2; + * + * @return Whether the objectChecksums field is set. + */ + public boolean hasObjectChecksums() { + return objectChecksumsBuilder_ != null || objectChecksums_ != null; + } + /** + * + * + *
+     * The checksums of the complete object. The client should compute one of
+     * these checksums over the downloaded object and compare it against the value
+     * provided here.
+     * 
+ * + * .google.storage.v2.ObjectChecksums object_checksums = 2; + * + * @return The objectChecksums. + */ + public com.google.storage.v2.ObjectChecksums getObjectChecksums() { + if (objectChecksumsBuilder_ == null) { + return objectChecksums_ == null + ? com.google.storage.v2.ObjectChecksums.getDefaultInstance() + : objectChecksums_; + } else { + return objectChecksumsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The checksums of the complete object. The client should compute one of
+     * these checksums over the downloaded object and compare it against the value
+     * provided here.
+     * 
+ * + * .google.storage.v2.ObjectChecksums object_checksums = 2; + */ + public Builder setObjectChecksums(com.google.storage.v2.ObjectChecksums value) { + if (objectChecksumsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + objectChecksums_ = value; + onChanged(); + } else { + objectChecksumsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The checksums of the complete object. The client should compute one of
+     * these checksums over the downloaded object and compare it against the value
+     * provided here.
+     * 
+ * + * .google.storage.v2.ObjectChecksums object_checksums = 2; + */ + public Builder setObjectChecksums( + com.google.storage.v2.ObjectChecksums.Builder builderForValue) { + if (objectChecksumsBuilder_ == null) { + objectChecksums_ = builderForValue.build(); + onChanged(); + } else { + objectChecksumsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The checksums of the complete object. The client should compute one of
+     * these checksums over the downloaded object and compare it against the value
+     * provided here.
+     * 
+ * + * .google.storage.v2.ObjectChecksums object_checksums = 2; + */ + public Builder mergeObjectChecksums(com.google.storage.v2.ObjectChecksums value) { + if (objectChecksumsBuilder_ == null) { + if (objectChecksums_ != null) { + objectChecksums_ = + com.google.storage.v2.ObjectChecksums.newBuilder(objectChecksums_) + .mergeFrom(value) + .buildPartial(); + } else { + objectChecksums_ = value; + } + onChanged(); + } else { + objectChecksumsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The checksums of the complete object. The client should compute one of
+     * these checksums over the downloaded object and compare it against the value
+     * provided here.
+     * 
+ * + * .google.storage.v2.ObjectChecksums object_checksums = 2; + */ + public Builder clearObjectChecksums() { + if (objectChecksumsBuilder_ == null) { + objectChecksums_ = null; + onChanged(); + } else { + objectChecksums_ = null; + objectChecksumsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The checksums of the complete object. The client should compute one of
+     * these checksums over the downloaded object and compare it against the value
+     * provided here.
+     * 
+ * + * .google.storage.v2.ObjectChecksums object_checksums = 2; + */ + public com.google.storage.v2.ObjectChecksums.Builder getObjectChecksumsBuilder() { + + onChanged(); + return getObjectChecksumsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The checksums of the complete object. The client should compute one of
+     * these checksums over the downloaded object and compare it against the value
+     * provided here.
+     * 
+ * + * .google.storage.v2.ObjectChecksums object_checksums = 2; + */ + public com.google.storage.v2.ObjectChecksumsOrBuilder getObjectChecksumsOrBuilder() { + if (objectChecksumsBuilder_ != null) { + return objectChecksumsBuilder_.getMessageOrBuilder(); + } else { + return objectChecksums_ == null + ? com.google.storage.v2.ObjectChecksums.getDefaultInstance() + : objectChecksums_; + } + } + /** + * + * + *
+     * The checksums of the complete object. The client should compute one of
+     * these checksums over the downloaded object and compare it against the value
+     * provided here.
+     * 
+ * + * .google.storage.v2.ObjectChecksums object_checksums = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.ObjectChecksums, + com.google.storage.v2.ObjectChecksums.Builder, + com.google.storage.v2.ObjectChecksumsOrBuilder> + getObjectChecksumsFieldBuilder() { + if (objectChecksumsBuilder_ == null) { + objectChecksumsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.ObjectChecksums, + com.google.storage.v2.ObjectChecksums.Builder, + com.google.storage.v2.ObjectChecksumsOrBuilder>( + getObjectChecksums(), getParentForChildren(), isClean()); + objectChecksums_ = null; + } + return objectChecksumsBuilder_; + } + + private com.google.storage.v2.ContentRange contentRange_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.ContentRange, + com.google.storage.v2.ContentRange.Builder, + com.google.storage.v2.ContentRangeOrBuilder> + contentRangeBuilder_; + /** + * + * + *
+     * If read_offset and or read_limit was specified on the
+     * ReadObjectRequest, ContentRange will be populated on the first
+     * ReadObjectResponse message of the read stream.
+     * 
+ * + * .google.storage.v2.ContentRange content_range = 3; + * + * @return Whether the contentRange field is set. + */ + public boolean hasContentRange() { + return contentRangeBuilder_ != null || contentRange_ != null; + } + /** + * + * + *
+     * If read_offset and or read_limit was specified on the
+     * ReadObjectRequest, ContentRange will be populated on the first
+     * ReadObjectResponse message of the read stream.
+     * 
+ * + * .google.storage.v2.ContentRange content_range = 3; + * + * @return The contentRange. + */ + public com.google.storage.v2.ContentRange getContentRange() { + if (contentRangeBuilder_ == null) { + return contentRange_ == null + ? com.google.storage.v2.ContentRange.getDefaultInstance() + : contentRange_; + } else { + return contentRangeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * If read_offset and or read_limit was specified on the
+     * ReadObjectRequest, ContentRange will be populated on the first
+     * ReadObjectResponse message of the read stream.
+     * 
+ * + * .google.storage.v2.ContentRange content_range = 3; + */ + public Builder setContentRange(com.google.storage.v2.ContentRange value) { + if (contentRangeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + contentRange_ = value; + onChanged(); + } else { + contentRangeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * If read_offset and or read_limit was specified on the
+     * ReadObjectRequest, ContentRange will be populated on the first
+     * ReadObjectResponse message of the read stream.
+     * 
+ * + * .google.storage.v2.ContentRange content_range = 3; + */ + public Builder setContentRange(com.google.storage.v2.ContentRange.Builder builderForValue) { + if (contentRangeBuilder_ == null) { + contentRange_ = builderForValue.build(); + onChanged(); + } else { + contentRangeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * If read_offset and or read_limit was specified on the
+     * ReadObjectRequest, ContentRange will be populated on the first
+     * ReadObjectResponse message of the read stream.
+     * 
+ * + * .google.storage.v2.ContentRange content_range = 3; + */ + public Builder mergeContentRange(com.google.storage.v2.ContentRange value) { + if (contentRangeBuilder_ == null) { + if (contentRange_ != null) { + contentRange_ = + com.google.storage.v2.ContentRange.newBuilder(contentRange_) + .mergeFrom(value) + .buildPartial(); + } else { + contentRange_ = value; + } + onChanged(); + } else { + contentRangeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * If read_offset and or read_limit was specified on the
+     * ReadObjectRequest, ContentRange will be populated on the first
+     * ReadObjectResponse message of the read stream.
+     * 
+ * + * .google.storage.v2.ContentRange content_range = 3; + */ + public Builder clearContentRange() { + if (contentRangeBuilder_ == null) { + contentRange_ = null; + onChanged(); + } else { + contentRange_ = null; + contentRangeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * If read_offset and or read_limit was specified on the
+     * ReadObjectRequest, ContentRange will be populated on the first
+     * ReadObjectResponse message of the read stream.
+     * 
+ * + * .google.storage.v2.ContentRange content_range = 3; + */ + public com.google.storage.v2.ContentRange.Builder getContentRangeBuilder() { + + onChanged(); + return getContentRangeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * If read_offset and or read_limit was specified on the
+     * ReadObjectRequest, ContentRange will be populated on the first
+     * ReadObjectResponse message of the read stream.
+     * 
+ * + * .google.storage.v2.ContentRange content_range = 3; + */ + public com.google.storage.v2.ContentRangeOrBuilder getContentRangeOrBuilder() { + if (contentRangeBuilder_ != null) { + return contentRangeBuilder_.getMessageOrBuilder(); + } else { + return contentRange_ == null + ? com.google.storage.v2.ContentRange.getDefaultInstance() + : contentRange_; + } + } + /** + * + * + *
+     * If read_offset and or read_limit was specified on the
+     * ReadObjectRequest, ContentRange will be populated on the first
+     * ReadObjectResponse message of the read stream.
+     * 
+ * + * .google.storage.v2.ContentRange content_range = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.ContentRange, + com.google.storage.v2.ContentRange.Builder, + com.google.storage.v2.ContentRangeOrBuilder> + getContentRangeFieldBuilder() { + if (contentRangeBuilder_ == null) { + contentRangeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.ContentRange, + com.google.storage.v2.ContentRange.Builder, + com.google.storage.v2.ContentRangeOrBuilder>( + getContentRange(), getParentForChildren(), isClean()); + contentRange_ = null; + } + return contentRangeBuilder_; + } + + private com.google.storage.v2.Object metadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Object, + com.google.storage.v2.Object.Builder, + com.google.storage.v2.ObjectOrBuilder> + metadataBuilder_; + /** + * + * + *
+     * Metadata of the object whose media is being returned.
+     * Only populated in the first response in the stream.
+     * 
+ * + * .google.storage.v2.Object metadata = 4; + * + * @return Whether the metadata field is set. + */ + public boolean hasMetadata() { + return metadataBuilder_ != null || metadata_ != null; + } + /** + * + * + *
+     * Metadata of the object whose media is being returned.
+     * Only populated in the first response in the stream.
+     * 
+ * + * .google.storage.v2.Object metadata = 4; + * + * @return The metadata. + */ + public com.google.storage.v2.Object getMetadata() { + if (metadataBuilder_ == null) { + return metadata_ == null ? com.google.storage.v2.Object.getDefaultInstance() : metadata_; + } else { + return metadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Metadata of the object whose media is being returned.
+     * Only populated in the first response in the stream.
+     * 
+ * + * .google.storage.v2.Object metadata = 4; + */ + public Builder setMetadata(com.google.storage.v2.Object value) { + if (metadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metadata_ = value; + onChanged(); + } else { + metadataBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Metadata of the object whose media is being returned.
+     * Only populated in the first response in the stream.
+     * 
+ * + * .google.storage.v2.Object metadata = 4; + */ + public Builder setMetadata(com.google.storage.v2.Object.Builder builderForValue) { + if (metadataBuilder_ == null) { + metadata_ = builderForValue.build(); + onChanged(); + } else { + metadataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Metadata of the object whose media is being returned.
+     * Only populated in the first response in the stream.
+     * 
+ * + * .google.storage.v2.Object metadata = 4; + */ + public Builder mergeMetadata(com.google.storage.v2.Object value) { + if (metadataBuilder_ == null) { + if (metadata_ != null) { + metadata_ = + com.google.storage.v2.Object.newBuilder(metadata_).mergeFrom(value).buildPartial(); + } else { + metadata_ = value; + } + onChanged(); + } else { + metadataBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Metadata of the object whose media is being returned.
+     * Only populated in the first response in the stream.
+     * 
+ * + * .google.storage.v2.Object metadata = 4; + */ + public Builder clearMetadata() { + if (metadataBuilder_ == null) { + metadata_ = null; + onChanged(); + } else { + metadata_ = null; + metadataBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Metadata of the object whose media is being returned.
+     * Only populated in the first response in the stream.
+     * 
+ * + * .google.storage.v2.Object metadata = 4; + */ + public com.google.storage.v2.Object.Builder getMetadataBuilder() { + + onChanged(); + return getMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Metadata of the object whose media is being returned.
+     * Only populated in the first response in the stream.
+     * 
+ * + * .google.storage.v2.Object metadata = 4; + */ + public com.google.storage.v2.ObjectOrBuilder getMetadataOrBuilder() { + if (metadataBuilder_ != null) { + return metadataBuilder_.getMessageOrBuilder(); + } else { + return metadata_ == null ? com.google.storage.v2.Object.getDefaultInstance() : metadata_; + } + } + /** + * + * + *
+     * Metadata of the object whose media is being returned.
+     * Only populated in the first response in the stream.
+     * 
+ * + * .google.storage.v2.Object metadata = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Object, + com.google.storage.v2.Object.Builder, + com.google.storage.v2.ObjectOrBuilder> + getMetadataFieldBuilder() { + if (metadataBuilder_ == null) { + metadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Object, + com.google.storage.v2.Object.Builder, + com.google.storage.v2.ObjectOrBuilder>( + getMetadata(), getParentForChildren(), isClean()); + metadata_ = null; + } + return metadataBuilder_; + } + + @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.ReadObjectResponse) + } + + // @@protoc_insertion_point(class_scope:google.storage.v2.ReadObjectResponse) + private static final com.google.storage.v2.ReadObjectResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.v2.ReadObjectResponse(); + } + + public static com.google.storage.v2.ReadObjectResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReadObjectResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ReadObjectResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.storage.v2.ReadObjectResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadObjectResponseOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadObjectResponseOrBuilder.java new file mode 100644 index 0000000000..6fea82c9bf --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadObjectResponseOrBuilder.java @@ -0,0 +1,189 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +package com.google.storage.v2; + +public interface ReadObjectResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.ReadObjectResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A portion of the data for the object. The service **may** leave `data`
+   * empty for any given `ReadResponse`. This enables the service to inform the
+   * client that the request is still live while it is running an operation to
+   * generate more data.
+   * 
+ * + * .google.storage.v2.ChecksummedData checksummed_data = 1; + * + * @return Whether the checksummedData field is set. + */ + boolean hasChecksummedData(); + /** + * + * + *
+   * A portion of the data for the object. The service **may** leave `data`
+   * empty for any given `ReadResponse`. This enables the service to inform the
+   * client that the request is still live while it is running an operation to
+   * generate more data.
+   * 
+ * + * .google.storage.v2.ChecksummedData checksummed_data = 1; + * + * @return The checksummedData. + */ + com.google.storage.v2.ChecksummedData getChecksummedData(); + /** + * + * + *
+   * A portion of the data for the object. The service **may** leave `data`
+   * empty for any given `ReadResponse`. This enables the service to inform the
+   * client that the request is still live while it is running an operation to
+   * generate more data.
+   * 
+ * + * .google.storage.v2.ChecksummedData checksummed_data = 1; + */ + com.google.storage.v2.ChecksummedDataOrBuilder getChecksummedDataOrBuilder(); + + /** + * + * + *
+   * The checksums of the complete object. The client should compute one of
+   * these checksums over the downloaded object and compare it against the value
+   * provided here.
+   * 
+ * + * .google.storage.v2.ObjectChecksums object_checksums = 2; + * + * @return Whether the objectChecksums field is set. + */ + boolean hasObjectChecksums(); + /** + * + * + *
+   * The checksums of the complete object. The client should compute one of
+   * these checksums over the downloaded object and compare it against the value
+   * provided here.
+   * 
+ * + * .google.storage.v2.ObjectChecksums object_checksums = 2; + * + * @return The objectChecksums. + */ + com.google.storage.v2.ObjectChecksums getObjectChecksums(); + /** + * + * + *
+   * The checksums of the complete object. The client should compute one of
+   * these checksums over the downloaded object and compare it against the value
+   * provided here.
+   * 
+ * + * .google.storage.v2.ObjectChecksums object_checksums = 2; + */ + com.google.storage.v2.ObjectChecksumsOrBuilder getObjectChecksumsOrBuilder(); + + /** + * + * + *
+   * If read_offset and or read_limit was specified on the
+   * ReadObjectRequest, ContentRange will be populated on the first
+   * ReadObjectResponse message of the read stream.
+   * 
+ * + * .google.storage.v2.ContentRange content_range = 3; + * + * @return Whether the contentRange field is set. + */ + boolean hasContentRange(); + /** + * + * + *
+   * If read_offset and or read_limit was specified on the
+   * ReadObjectRequest, ContentRange will be populated on the first
+   * ReadObjectResponse message of the read stream.
+   * 
+ * + * .google.storage.v2.ContentRange content_range = 3; + * + * @return The contentRange. + */ + com.google.storage.v2.ContentRange getContentRange(); + /** + * + * + *
+   * If read_offset and or read_limit was specified on the
+   * ReadObjectRequest, ContentRange will be populated on the first
+   * ReadObjectResponse message of the read stream.
+   * 
+ * + * .google.storage.v2.ContentRange content_range = 3; + */ + com.google.storage.v2.ContentRangeOrBuilder getContentRangeOrBuilder(); + + /** + * + * + *
+   * Metadata of the object whose media is being returned.
+   * Only populated in the first response in the stream.
+   * 
+ * + * .google.storage.v2.Object metadata = 4; + * + * @return Whether the metadata field is set. + */ + boolean hasMetadata(); + /** + * + * + *
+   * Metadata of the object whose media is being returned.
+   * Only populated in the first response in the stream.
+   * 
+ * + * .google.storage.v2.Object metadata = 4; + * + * @return The metadata. + */ + com.google.storage.v2.Object getMetadata(); + /** + * + * + *
+   * Metadata of the object whose media is being returned.
+   * Only populated in the first response in the stream.
+   * 
+ * + * .google.storage.v2.Object metadata = 4; + */ + com.google.storage.v2.ObjectOrBuilder getMetadataOrBuilder(); +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ServiceConstants.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ServiceConstants.java new file mode 100644 index 0000000000..90b6e08e55 --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ServiceConstants.java @@ -0,0 +1,1002 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +package com.google.storage.v2; + +/** + * + * + *
+ * Shared constants.
+ * 
+ * + * Protobuf type {@code google.storage.v2.ServiceConstants} + */ +public final class ServiceConstants extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.v2.ServiceConstants) + ServiceConstantsOrBuilder { + private static final long serialVersionUID = 0L; + // Use ServiceConstants.newBuilder() to construct. + private ServiceConstants(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ServiceConstants() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ServiceConstants(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ServiceConstants( + 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; + 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_ServiceConstants_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ServiceConstants_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.ServiceConstants.class, + com.google.storage.v2.ServiceConstants.Builder.class); + } + + /** + * + * + *
+   * A collection of constant values meaningful to the Storage API.
+   * 
+ * + * Protobuf enum {@code google.storage.v2.ServiceConstants.Values} + */ + public enum Values implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unused. Proto3 requires first enum to be 0.
+     * 
+ * + * VALUES_UNSPECIFIED = 0; + */ + VALUES_UNSPECIFIED(0, 0), + /** + * + * + *
+     * The maximum size chunk that can will be returned in a single
+     * ReadRequest.
+     * 2 MiB.
+     * 
+ * + * MAX_READ_CHUNK_BYTES = 2097152; + */ + MAX_READ_CHUNK_BYTES(1, 2097152), + /** + * + * + *
+     * The maximum size of an object in MB - whether written in a single stream
+     * or composed from multiple other objects.
+     * 5 TiB.
+     * 
+ * + * MAX_OBJECT_SIZE_MB = 5242880; + */ + MAX_OBJECT_SIZE_MB(3, 5242880), + /** + * + * + *
+     * The maximum length field name that can be sent in a single
+     * custom metadata field.
+     * 1 KiB.
+     * 
+ * + * MAX_CUSTOM_METADATA_FIELD_NAME_BYTES = 1024; + */ + MAX_CUSTOM_METADATA_FIELD_NAME_BYTES(4, 1024), + /** + * + * + *
+     * The maximum length field value that can be sent in a single
+     * custom_metadata field.
+     * 4 KiB.
+     * 
+ * + * MAX_CUSTOM_METADATA_FIELD_VALUE_BYTES = 4096; + */ + MAX_CUSTOM_METADATA_FIELD_VALUE_BYTES(5, 4096), + /** + * + * + *
+     * The maximum total bytes that can be populated into all field names and
+     * values of the custom_metadata for one object.
+     * 8 KiB.
+     * 
+ * + * MAX_CUSTOM_METADATA_TOTAL_SIZE_BYTES = 8192; + */ + MAX_CUSTOM_METADATA_TOTAL_SIZE_BYTES(6, 8192), + /** + * + * + *
+     * The maximum total bytes that can be populated into all bucket metadata
+     * fields.
+     * 20 KiB.
+     * 
+ * + * MAX_BUCKET_METADATA_TOTAL_SIZE_BYTES = 20480; + */ + MAX_BUCKET_METADATA_TOTAL_SIZE_BYTES(7, 20480), + /** + * + * + *
+     * The maximum number of NotificationConfigs that can be registered
+     * for a given bucket.
+     * 
+ * + * MAX_NOTIFICATION_CONFIGS_PER_BUCKET = 100; + */ + MAX_NOTIFICATION_CONFIGS_PER_BUCKET(8, 100), + /** + * + * + *
+     * The maximum number of custom attributes per NotificationConfigs.
+     * 
+ * + * MAX_NOTIFICATION_CUSTOM_ATTRIBUTES = 5; + */ + MAX_NOTIFICATION_CUSTOM_ATTRIBUTES(10, 5), + /** + * + * + *
+     * The maximum length of a custom attribute key included in
+     * NotificationConfig.
+     * 
+ * + * MAX_NOTIFICATION_CUSTOM_ATTRIBUTE_KEY_LENGTH = 256; + */ + MAX_NOTIFICATION_CUSTOM_ATTRIBUTE_KEY_LENGTH(11, 256), + /** + * + * + *
+     * The maximum number of key/value entries per bucket label.
+     * 
+ * + * MAX_LABELS_ENTRIES_COUNT = 64; + */ + MAX_LABELS_ENTRIES_COUNT(13, 64), + /** + * + * + *
+     * The maximum character length of the key or value in a bucket
+     * label map.
+     * 
+ * + * MAX_LABELS_KEY_VALUE_LENGTH = 63; + */ + MAX_LABELS_KEY_VALUE_LENGTH(14, 63), + /** + * + * + *
+     * The maximum byte size of the key or value in a bucket label
+     * map.
+     * 
+ * + * MAX_LABELS_KEY_VALUE_BYTES = 128; + */ + MAX_LABELS_KEY_VALUE_BYTES(15, 128), + /** + * + * + *
+     * The maximum number of object IDs that can be included in a
+     * DeleteObjectsRequest.
+     * 
+ * + * MAX_OBJECT_IDS_PER_DELETE_OBJECTS_REQUEST = 1000; + */ + MAX_OBJECT_IDS_PER_DELETE_OBJECTS_REQUEST(16, 1000), + /** + * + * + *
+     * The maximum number of days for which a token returned by the
+     * GetListObjectsSplitPoints RPC is valid.
+     * 
+ * + * SPLIT_TOKEN_MAX_VALID_DAYS = 14; + */ + SPLIT_TOKEN_MAX_VALID_DAYS(17, 14), + UNRECOGNIZED(-1, -1), + ; + + /** + * + * + *
+     * The maximum size chunk that can be sent in a single WriteObjectRequest.
+     * 2 MiB.
+     * 
+ * + * MAX_WRITE_CHUNK_BYTES = 2097152; + */ + public static final Values MAX_WRITE_CHUNK_BYTES = MAX_READ_CHUNK_BYTES; + /** + * + * + *
+     * The maximum number of LifecycleRules that can be registered for a given
+     * bucket.
+     * 
+ * + * MAX_LIFECYCLE_RULES_PER_BUCKET = 100; + */ + public static final Values MAX_LIFECYCLE_RULES_PER_BUCKET = MAX_NOTIFICATION_CONFIGS_PER_BUCKET; + /** + * + * + *
+     * The maximum length of a custom attribute value included in a
+     * NotificationConfig.
+     * 
+ * + * MAX_NOTIFICATION_CUSTOM_ATTRIBUTE_VALUE_LENGTH = 1024; + */ + public static final Values MAX_NOTIFICATION_CUSTOM_ATTRIBUTE_VALUE_LENGTH = + MAX_CUSTOM_METADATA_FIELD_NAME_BYTES; + /** + * + * + *
+     * Unused. Proto3 requires first enum to be 0.
+     * 
+ * + * VALUES_UNSPECIFIED = 0; + */ + public static final int VALUES_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The maximum size chunk that can will be returned in a single
+     * ReadRequest.
+     * 2 MiB.
+     * 
+ * + * MAX_READ_CHUNK_BYTES = 2097152; + */ + public static final int MAX_READ_CHUNK_BYTES_VALUE = 2097152; + /** + * + * + *
+     * The maximum size chunk that can be sent in a single WriteObjectRequest.
+     * 2 MiB.
+     * 
+ * + * MAX_WRITE_CHUNK_BYTES = 2097152; + */ + public static final int MAX_WRITE_CHUNK_BYTES_VALUE = 2097152; + /** + * + * + *
+     * The maximum size of an object in MB - whether written in a single stream
+     * or composed from multiple other objects.
+     * 5 TiB.
+     * 
+ * + * MAX_OBJECT_SIZE_MB = 5242880; + */ + public static final int MAX_OBJECT_SIZE_MB_VALUE = 5242880; + /** + * + * + *
+     * The maximum length field name that can be sent in a single
+     * custom metadata field.
+     * 1 KiB.
+     * 
+ * + * MAX_CUSTOM_METADATA_FIELD_NAME_BYTES = 1024; + */ + public static final int MAX_CUSTOM_METADATA_FIELD_NAME_BYTES_VALUE = 1024; + /** + * + * + *
+     * The maximum length field value that can be sent in a single
+     * custom_metadata field.
+     * 4 KiB.
+     * 
+ * + * MAX_CUSTOM_METADATA_FIELD_VALUE_BYTES = 4096; + */ + public static final int MAX_CUSTOM_METADATA_FIELD_VALUE_BYTES_VALUE = 4096; + /** + * + * + *
+     * The maximum total bytes that can be populated into all field names and
+     * values of the custom_metadata for one object.
+     * 8 KiB.
+     * 
+ * + * MAX_CUSTOM_METADATA_TOTAL_SIZE_BYTES = 8192; + */ + public static final int MAX_CUSTOM_METADATA_TOTAL_SIZE_BYTES_VALUE = 8192; + /** + * + * + *
+     * The maximum total bytes that can be populated into all bucket metadata
+     * fields.
+     * 20 KiB.
+     * 
+ * + * MAX_BUCKET_METADATA_TOTAL_SIZE_BYTES = 20480; + */ + public static final int MAX_BUCKET_METADATA_TOTAL_SIZE_BYTES_VALUE = 20480; + /** + * + * + *
+     * The maximum number of NotificationConfigs that can be registered
+     * for a given bucket.
+     * 
+ * + * MAX_NOTIFICATION_CONFIGS_PER_BUCKET = 100; + */ + public static final int MAX_NOTIFICATION_CONFIGS_PER_BUCKET_VALUE = 100; + /** + * + * + *
+     * The maximum number of LifecycleRules that can be registered for a given
+     * bucket.
+     * 
+ * + * MAX_LIFECYCLE_RULES_PER_BUCKET = 100; + */ + public static final int MAX_LIFECYCLE_RULES_PER_BUCKET_VALUE = 100; + /** + * + * + *
+     * The maximum number of custom attributes per NotificationConfigs.
+     * 
+ * + * MAX_NOTIFICATION_CUSTOM_ATTRIBUTES = 5; + */ + public static final int MAX_NOTIFICATION_CUSTOM_ATTRIBUTES_VALUE = 5; + /** + * + * + *
+     * The maximum length of a custom attribute key included in
+     * NotificationConfig.
+     * 
+ * + * MAX_NOTIFICATION_CUSTOM_ATTRIBUTE_KEY_LENGTH = 256; + */ + public static final int MAX_NOTIFICATION_CUSTOM_ATTRIBUTE_KEY_LENGTH_VALUE = 256; + /** + * + * + *
+     * The maximum length of a custom attribute value included in a
+     * NotificationConfig.
+     * 
+ * + * MAX_NOTIFICATION_CUSTOM_ATTRIBUTE_VALUE_LENGTH = 1024; + */ + public static final int MAX_NOTIFICATION_CUSTOM_ATTRIBUTE_VALUE_LENGTH_VALUE = 1024; + /** + * + * + *
+     * The maximum number of key/value entries per bucket label.
+     * 
+ * + * MAX_LABELS_ENTRIES_COUNT = 64; + */ + public static final int MAX_LABELS_ENTRIES_COUNT_VALUE = 64; + /** + * + * + *
+     * The maximum character length of the key or value in a bucket
+     * label map.
+     * 
+ * + * MAX_LABELS_KEY_VALUE_LENGTH = 63; + */ + public static final int MAX_LABELS_KEY_VALUE_LENGTH_VALUE = 63; + /** + * + * + *
+     * The maximum byte size of the key or value in a bucket label
+     * map.
+     * 
+ * + * MAX_LABELS_KEY_VALUE_BYTES = 128; + */ + public static final int MAX_LABELS_KEY_VALUE_BYTES_VALUE = 128; + /** + * + * + *
+     * The maximum number of object IDs that can be included in a
+     * DeleteObjectsRequest.
+     * 
+ * + * MAX_OBJECT_IDS_PER_DELETE_OBJECTS_REQUEST = 1000; + */ + public static final int MAX_OBJECT_IDS_PER_DELETE_OBJECTS_REQUEST_VALUE = 1000; + /** + * + * + *
+     * The maximum number of days for which a token returned by the
+     * GetListObjectsSplitPoints RPC is valid.
+     * 
+ * + * SPLIT_TOKEN_MAX_VALID_DAYS = 14; + */ + public static final int SPLIT_TOKEN_MAX_VALID_DAYS_VALUE = 14; + + public final int getNumber() { + if (index == -1) { + 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 Values 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 Values forNumber(int value) { + switch (value) { + case 0: + return VALUES_UNSPECIFIED; + case 2097152: + return MAX_READ_CHUNK_BYTES; + case 5242880: + return MAX_OBJECT_SIZE_MB; + case 1024: + return MAX_CUSTOM_METADATA_FIELD_NAME_BYTES; + case 4096: + return MAX_CUSTOM_METADATA_FIELD_VALUE_BYTES; + case 8192: + return MAX_CUSTOM_METADATA_TOTAL_SIZE_BYTES; + case 20480: + return MAX_BUCKET_METADATA_TOTAL_SIZE_BYTES; + case 100: + return MAX_NOTIFICATION_CONFIGS_PER_BUCKET; + case 5: + return MAX_NOTIFICATION_CUSTOM_ATTRIBUTES; + case 256: + return MAX_NOTIFICATION_CUSTOM_ATTRIBUTE_KEY_LENGTH; + case 64: + return MAX_LABELS_ENTRIES_COUNT; + case 63: + return MAX_LABELS_KEY_VALUE_LENGTH; + case 128: + return MAX_LABELS_KEY_VALUE_BYTES; + case 1000: + return MAX_OBJECT_IDS_PER_DELETE_OBJECTS_REQUEST; + case 14: + return SPLIT_TOKEN_MAX_VALID_DAYS; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Values findValueByNumber(int number) { + return Values.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (index == -1) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(index); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.storage.v2.ServiceConstants.getDescriptor().getEnumTypes().get(0); + } + + private static final Values[] VALUES = getStaticValuesArray(); + + private static Values[] getStaticValuesArray() { + return new Values[] { + VALUES_UNSPECIFIED, + MAX_READ_CHUNK_BYTES, + MAX_WRITE_CHUNK_BYTES, + MAX_OBJECT_SIZE_MB, + MAX_CUSTOM_METADATA_FIELD_NAME_BYTES, + MAX_CUSTOM_METADATA_FIELD_VALUE_BYTES, + MAX_CUSTOM_METADATA_TOTAL_SIZE_BYTES, + MAX_BUCKET_METADATA_TOTAL_SIZE_BYTES, + MAX_NOTIFICATION_CONFIGS_PER_BUCKET, + MAX_LIFECYCLE_RULES_PER_BUCKET, + MAX_NOTIFICATION_CUSTOM_ATTRIBUTES, + MAX_NOTIFICATION_CUSTOM_ATTRIBUTE_KEY_LENGTH, + MAX_NOTIFICATION_CUSTOM_ATTRIBUTE_VALUE_LENGTH, + MAX_LABELS_ENTRIES_COUNT, + MAX_LABELS_KEY_VALUE_LENGTH, + MAX_LABELS_KEY_VALUE_BYTES, + MAX_OBJECT_IDS_PER_DELETE_OBJECTS_REQUEST, + SPLIT_TOKEN_MAX_VALID_DAYS, + }; + } + + public static Values valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int index; + private final int value; + + private Values(int index, int value) { + this.index = index; + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.storage.v2.ServiceConstants.Values) + } + + 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 { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + 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.ServiceConstants)) { + return super.equals(obj); + } + com.google.storage.v2.ServiceConstants other = (com.google.storage.v2.ServiceConstants) obj; + + 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 = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.v2.ServiceConstants parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.ServiceConstants 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.ServiceConstants parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.ServiceConstants 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.ServiceConstants parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.ServiceConstants parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.ServiceConstants parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.ServiceConstants 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.ServiceConstants parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.v2.ServiceConstants 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.ServiceConstants parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.ServiceConstants 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.ServiceConstants 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; + } + /** + * + * + *
+   * Shared constants.
+   * 
+ * + * Protobuf type {@code google.storage.v2.ServiceConstants} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.ServiceConstants) + com.google.storage.v2.ServiceConstantsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ServiceConstants_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ServiceConstants_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.ServiceConstants.class, + com.google.storage.v2.ServiceConstants.Builder.class); + } + + // Construct using com.google.storage.v2.ServiceConstants.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_ServiceConstants_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.ServiceConstants getDefaultInstanceForType() { + return com.google.storage.v2.ServiceConstants.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.ServiceConstants build() { + com.google.storage.v2.ServiceConstants result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.ServiceConstants buildPartial() { + com.google.storage.v2.ServiceConstants result = + new com.google.storage.v2.ServiceConstants(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.storage.v2.ServiceConstants) { + return mergeFrom((com.google.storage.v2.ServiceConstants) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.ServiceConstants other) { + if (other == com.google.storage.v2.ServiceConstants.getDefaultInstance()) return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.storage.v2.ServiceConstants parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.storage.v2.ServiceConstants) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + 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.ServiceConstants) + } + + // @@protoc_insertion_point(class_scope:google.storage.v2.ServiceConstants) + private static final com.google.storage.v2.ServiceConstants DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.v2.ServiceConstants(); + } + + public static com.google.storage.v2.ServiceConstants getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ServiceConstants parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ServiceConstants(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.storage.v2.ServiceConstants getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ServiceConstantsOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ServiceConstantsOrBuilder.java new file mode 100644 index 0000000000..9722940ed4 --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ServiceConstantsOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +package com.google.storage.v2; + +public interface ServiceConstantsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.ServiceConstants) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteRequest.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteRequest.java new file mode 100644 index 0000000000..62b80bbf6c --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteRequest.java @@ -0,0 +1,1297 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +package com.google.storage.v2; + +/** + * + * + *
+ * Request message StartResumableWrite.
+ * 
+ * + * Protobuf type {@code google.storage.v2.StartResumableWriteRequest} + */ +public final class StartResumableWriteRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.v2.StartResumableWriteRequest) + StartResumableWriteRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use StartResumableWriteRequest.newBuilder() to construct. + private StartResumableWriteRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StartResumableWriteRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StartResumableWriteRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private StartResumableWriteRequest( + 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.WriteObjectSpec.Builder subBuilder = null; + if (writeObjectSpec_ != null) { + subBuilder = writeObjectSpec_.toBuilder(); + } + writeObjectSpec_ = + input.readMessage( + com.google.storage.v2.WriteObjectSpec.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(writeObjectSpec_); + writeObjectSpec_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.storage.v2.CommonObjectRequestParams.Builder subBuilder = null; + if (commonObjectRequestParams_ != null) { + subBuilder = commonObjectRequestParams_.toBuilder(); + } + commonObjectRequestParams_ = + input.readMessage( + com.google.storage.v2.CommonObjectRequestParams.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(commonObjectRequestParams_); + commonObjectRequestParams_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + com.google.storage.v2.CommonRequestParams.Builder subBuilder = null; + if (commonRequestParams_ != null) { + subBuilder = commonRequestParams_.toBuilder(); + } + commonRequestParams_ = + input.readMessage( + com.google.storage.v2.CommonRequestParams.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(commonRequestParams_); + commonRequestParams_ = 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_StartResumableWriteRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_StartResumableWriteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.StartResumableWriteRequest.class, + com.google.storage.v2.StartResumableWriteRequest.Builder.class); + } + + public static final int WRITE_OBJECT_SPEC_FIELD_NUMBER = 1; + private com.google.storage.v2.WriteObjectSpec writeObjectSpec_; + /** + * + * + *
+   * The destination bucket, object, and metadata, as well as any preconditions.
+   * 
+ * + * .google.storage.v2.WriteObjectSpec write_object_spec = 1; + * + * @return Whether the writeObjectSpec field is set. + */ + @java.lang.Override + public boolean hasWriteObjectSpec() { + return writeObjectSpec_ != null; + } + /** + * + * + *
+   * The destination bucket, object, and metadata, as well as any preconditions.
+   * 
+ * + * .google.storage.v2.WriteObjectSpec write_object_spec = 1; + * + * @return The writeObjectSpec. + */ + @java.lang.Override + public com.google.storage.v2.WriteObjectSpec getWriteObjectSpec() { + return writeObjectSpec_ == null + ? com.google.storage.v2.WriteObjectSpec.getDefaultInstance() + : writeObjectSpec_; + } + /** + * + * + *
+   * The destination bucket, object, and metadata, as well as any preconditions.
+   * 
+ * + * .google.storage.v2.WriteObjectSpec write_object_spec = 1; + */ + @java.lang.Override + public com.google.storage.v2.WriteObjectSpecOrBuilder getWriteObjectSpecOrBuilder() { + return getWriteObjectSpec(); + } + + public static final int COMMON_OBJECT_REQUEST_PARAMS_FIELD_NUMBER = 3; + private com.google.storage.v2.CommonObjectRequestParams commonObjectRequestParams_; + /** + * + * + *
+   * A set of parameters common to Storage API requests concerning an object.
+   * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; + * + * @return Whether the commonObjectRequestParams field is set. + */ + @java.lang.Override + public boolean hasCommonObjectRequestParams() { + return commonObjectRequestParams_ != null; + } + /** + * + * + *
+   * A set of parameters common to Storage API requests concerning an object.
+   * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; + * + * @return The commonObjectRequestParams. + */ + @java.lang.Override + public com.google.storage.v2.CommonObjectRequestParams getCommonObjectRequestParams() { + return commonObjectRequestParams_ == null + ? com.google.storage.v2.CommonObjectRequestParams.getDefaultInstance() + : commonObjectRequestParams_; + } + /** + * + * + *
+   * A set of parameters common to Storage API requests concerning an object.
+   * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; + */ + @java.lang.Override + public com.google.storage.v2.CommonObjectRequestParamsOrBuilder + getCommonObjectRequestParamsOrBuilder() { + return getCommonObjectRequestParams(); + } + + public static final int COMMON_REQUEST_PARAMS_FIELD_NUMBER = 4; + private com.google.storage.v2.CommonRequestParams commonRequestParams_; + /** + * + * + *
+   * A set of parameters common to all Storage API requests.
+   * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 4; + * + * @return Whether the commonRequestParams field is set. + */ + @java.lang.Override + public boolean hasCommonRequestParams() { + return commonRequestParams_ != null; + } + /** + * + * + *
+   * A set of parameters common to all Storage API requests.
+   * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 4; + * + * @return The commonRequestParams. + */ + @java.lang.Override + public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { + return commonRequestParams_ == null + ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() + : commonRequestParams_; + } + /** + * + * + *
+   * A set of parameters common to all Storage API requests.
+   * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 4; + */ + @java.lang.Override + public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { + return getCommonRequestParams(); + } + + 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 (writeObjectSpec_ != null) { + output.writeMessage(1, getWriteObjectSpec()); + } + if (commonObjectRequestParams_ != null) { + output.writeMessage(3, getCommonObjectRequestParams()); + } + if (commonRequestParams_ != null) { + output.writeMessage(4, getCommonRequestParams()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (writeObjectSpec_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getWriteObjectSpec()); + } + if (commonObjectRequestParams_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, getCommonObjectRequestParams()); + } + if (commonRequestParams_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCommonRequestParams()); + } + 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.StartResumableWriteRequest)) { + return super.equals(obj); + } + com.google.storage.v2.StartResumableWriteRequest other = + (com.google.storage.v2.StartResumableWriteRequest) obj; + + if (hasWriteObjectSpec() != other.hasWriteObjectSpec()) return false; + if (hasWriteObjectSpec()) { + if (!getWriteObjectSpec().equals(other.getWriteObjectSpec())) return false; + } + if (hasCommonObjectRequestParams() != other.hasCommonObjectRequestParams()) return false; + if (hasCommonObjectRequestParams()) { + if (!getCommonObjectRequestParams().equals(other.getCommonObjectRequestParams())) + return false; + } + if (hasCommonRequestParams() != other.hasCommonRequestParams()) return false; + if (hasCommonRequestParams()) { + if (!getCommonRequestParams().equals(other.getCommonRequestParams())) 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 (hasWriteObjectSpec()) { + hash = (37 * hash) + WRITE_OBJECT_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getWriteObjectSpec().hashCode(); + } + if (hasCommonObjectRequestParams()) { + hash = (37 * hash) + COMMON_OBJECT_REQUEST_PARAMS_FIELD_NUMBER; + hash = (53 * hash) + getCommonObjectRequestParams().hashCode(); + } + if (hasCommonRequestParams()) { + hash = (37 * hash) + COMMON_REQUEST_PARAMS_FIELD_NUMBER; + hash = (53 * hash) + getCommonRequestParams().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.v2.StartResumableWriteRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.StartResumableWriteRequest 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.StartResumableWriteRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.StartResumableWriteRequest 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.StartResumableWriteRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.StartResumableWriteRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.StartResumableWriteRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.StartResumableWriteRequest 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.StartResumableWriteRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.v2.StartResumableWriteRequest 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.StartResumableWriteRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.StartResumableWriteRequest 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.StartResumableWriteRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message StartResumableWrite.
+   * 
+ * + * Protobuf type {@code google.storage.v2.StartResumableWriteRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.StartResumableWriteRequest) + com.google.storage.v2.StartResumableWriteRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_StartResumableWriteRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_StartResumableWriteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.StartResumableWriteRequest.class, + com.google.storage.v2.StartResumableWriteRequest.Builder.class); + } + + // Construct using com.google.storage.v2.StartResumableWriteRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (writeObjectSpecBuilder_ == null) { + writeObjectSpec_ = null; + } else { + writeObjectSpec_ = null; + writeObjectSpecBuilder_ = null; + } + if (commonObjectRequestParamsBuilder_ == null) { + commonObjectRequestParams_ = null; + } else { + commonObjectRequestParams_ = null; + commonObjectRequestParamsBuilder_ = null; + } + if (commonRequestParamsBuilder_ == null) { + commonRequestParams_ = null; + } else { + commonRequestParams_ = null; + commonRequestParamsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_StartResumableWriteRequest_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.StartResumableWriteRequest getDefaultInstanceForType() { + return com.google.storage.v2.StartResumableWriteRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.StartResumableWriteRequest build() { + com.google.storage.v2.StartResumableWriteRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.StartResumableWriteRequest buildPartial() { + com.google.storage.v2.StartResumableWriteRequest result = + new com.google.storage.v2.StartResumableWriteRequest(this); + if (writeObjectSpecBuilder_ == null) { + result.writeObjectSpec_ = writeObjectSpec_; + } else { + result.writeObjectSpec_ = writeObjectSpecBuilder_.build(); + } + if (commonObjectRequestParamsBuilder_ == null) { + result.commonObjectRequestParams_ = commonObjectRequestParams_; + } else { + result.commonObjectRequestParams_ = commonObjectRequestParamsBuilder_.build(); + } + if (commonRequestParamsBuilder_ == null) { + result.commonRequestParams_ = commonRequestParams_; + } else { + result.commonRequestParams_ = commonRequestParamsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.storage.v2.StartResumableWriteRequest) { + return mergeFrom((com.google.storage.v2.StartResumableWriteRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.StartResumableWriteRequest other) { + if (other == com.google.storage.v2.StartResumableWriteRequest.getDefaultInstance()) + return this; + if (other.hasWriteObjectSpec()) { + mergeWriteObjectSpec(other.getWriteObjectSpec()); + } + if (other.hasCommonObjectRequestParams()) { + mergeCommonObjectRequestParams(other.getCommonObjectRequestParams()); + } + if (other.hasCommonRequestParams()) { + mergeCommonRequestParams(other.getCommonRequestParams()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.storage.v2.StartResumableWriteRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.storage.v2.StartResumableWriteRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.storage.v2.WriteObjectSpec writeObjectSpec_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.WriteObjectSpec, + com.google.storage.v2.WriteObjectSpec.Builder, + com.google.storage.v2.WriteObjectSpecOrBuilder> + writeObjectSpecBuilder_; + /** + * + * + *
+     * The destination bucket, object, and metadata, as well as any preconditions.
+     * 
+ * + * .google.storage.v2.WriteObjectSpec write_object_spec = 1; + * + * @return Whether the writeObjectSpec field is set. + */ + public boolean hasWriteObjectSpec() { + return writeObjectSpecBuilder_ != null || writeObjectSpec_ != null; + } + /** + * + * + *
+     * The destination bucket, object, and metadata, as well as any preconditions.
+     * 
+ * + * .google.storage.v2.WriteObjectSpec write_object_spec = 1; + * + * @return The writeObjectSpec. + */ + public com.google.storage.v2.WriteObjectSpec getWriteObjectSpec() { + if (writeObjectSpecBuilder_ == null) { + return writeObjectSpec_ == null + ? com.google.storage.v2.WriteObjectSpec.getDefaultInstance() + : writeObjectSpec_; + } else { + return writeObjectSpecBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The destination bucket, object, and metadata, as well as any preconditions.
+     * 
+ * + * .google.storage.v2.WriteObjectSpec write_object_spec = 1; + */ + public Builder setWriteObjectSpec(com.google.storage.v2.WriteObjectSpec value) { + if (writeObjectSpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + writeObjectSpec_ = value; + onChanged(); + } else { + writeObjectSpecBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The destination bucket, object, and metadata, as well as any preconditions.
+     * 
+ * + * .google.storage.v2.WriteObjectSpec write_object_spec = 1; + */ + public Builder setWriteObjectSpec( + com.google.storage.v2.WriteObjectSpec.Builder builderForValue) { + if (writeObjectSpecBuilder_ == null) { + writeObjectSpec_ = builderForValue.build(); + onChanged(); + } else { + writeObjectSpecBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The destination bucket, object, and metadata, as well as any preconditions.
+     * 
+ * + * .google.storage.v2.WriteObjectSpec write_object_spec = 1; + */ + public Builder mergeWriteObjectSpec(com.google.storage.v2.WriteObjectSpec value) { + if (writeObjectSpecBuilder_ == null) { + if (writeObjectSpec_ != null) { + writeObjectSpec_ = + com.google.storage.v2.WriteObjectSpec.newBuilder(writeObjectSpec_) + .mergeFrom(value) + .buildPartial(); + } else { + writeObjectSpec_ = value; + } + onChanged(); + } else { + writeObjectSpecBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The destination bucket, object, and metadata, as well as any preconditions.
+     * 
+ * + * .google.storage.v2.WriteObjectSpec write_object_spec = 1; + */ + public Builder clearWriteObjectSpec() { + if (writeObjectSpecBuilder_ == null) { + writeObjectSpec_ = null; + onChanged(); + } else { + writeObjectSpec_ = null; + writeObjectSpecBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The destination bucket, object, and metadata, as well as any preconditions.
+     * 
+ * + * .google.storage.v2.WriteObjectSpec write_object_spec = 1; + */ + public com.google.storage.v2.WriteObjectSpec.Builder getWriteObjectSpecBuilder() { + + onChanged(); + return getWriteObjectSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The destination bucket, object, and metadata, as well as any preconditions.
+     * 
+ * + * .google.storage.v2.WriteObjectSpec write_object_spec = 1; + */ + public com.google.storage.v2.WriteObjectSpecOrBuilder getWriteObjectSpecOrBuilder() { + if (writeObjectSpecBuilder_ != null) { + return writeObjectSpecBuilder_.getMessageOrBuilder(); + } else { + return writeObjectSpec_ == null + ? com.google.storage.v2.WriteObjectSpec.getDefaultInstance() + : writeObjectSpec_; + } + } + /** + * + * + *
+     * The destination bucket, object, and metadata, as well as any preconditions.
+     * 
+ * + * .google.storage.v2.WriteObjectSpec write_object_spec = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.WriteObjectSpec, + com.google.storage.v2.WriteObjectSpec.Builder, + com.google.storage.v2.WriteObjectSpecOrBuilder> + getWriteObjectSpecFieldBuilder() { + if (writeObjectSpecBuilder_ == null) { + writeObjectSpecBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.WriteObjectSpec, + com.google.storage.v2.WriteObjectSpec.Builder, + com.google.storage.v2.WriteObjectSpecOrBuilder>( + getWriteObjectSpec(), getParentForChildren(), isClean()); + writeObjectSpec_ = null; + } + return writeObjectSpecBuilder_; + } + + private com.google.storage.v2.CommonObjectRequestParams commonObjectRequestParams_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.CommonObjectRequestParams, + com.google.storage.v2.CommonObjectRequestParams.Builder, + com.google.storage.v2.CommonObjectRequestParamsOrBuilder> + commonObjectRequestParamsBuilder_; + /** + * + * + *
+     * A set of parameters common to Storage API requests concerning an object.
+     * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; + * + * @return Whether the commonObjectRequestParams field is set. + */ + public boolean hasCommonObjectRequestParams() { + return commonObjectRequestParamsBuilder_ != null || commonObjectRequestParams_ != null; + } + /** + * + * + *
+     * A set of parameters common to Storage API requests concerning an object.
+     * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; + * + * @return The commonObjectRequestParams. + */ + public com.google.storage.v2.CommonObjectRequestParams getCommonObjectRequestParams() { + if (commonObjectRequestParamsBuilder_ == null) { + return commonObjectRequestParams_ == null + ? com.google.storage.v2.CommonObjectRequestParams.getDefaultInstance() + : commonObjectRequestParams_; + } else { + return commonObjectRequestParamsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * A set of parameters common to Storage API requests concerning an object.
+     * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; + */ + public Builder setCommonObjectRequestParams( + com.google.storage.v2.CommonObjectRequestParams value) { + if (commonObjectRequestParamsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + commonObjectRequestParams_ = value; + onChanged(); + } else { + commonObjectRequestParamsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * A set of parameters common to Storage API requests concerning an object.
+     * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; + */ + public Builder setCommonObjectRequestParams( + com.google.storage.v2.CommonObjectRequestParams.Builder builderForValue) { + if (commonObjectRequestParamsBuilder_ == null) { + commonObjectRequestParams_ = builderForValue.build(); + onChanged(); + } else { + commonObjectRequestParamsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * A set of parameters common to Storage API requests concerning an object.
+     * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; + */ + public Builder mergeCommonObjectRequestParams( + com.google.storage.v2.CommonObjectRequestParams value) { + if (commonObjectRequestParamsBuilder_ == null) { + if (commonObjectRequestParams_ != null) { + commonObjectRequestParams_ = + com.google.storage.v2.CommonObjectRequestParams.newBuilder(commonObjectRequestParams_) + .mergeFrom(value) + .buildPartial(); + } else { + commonObjectRequestParams_ = value; + } + onChanged(); + } else { + commonObjectRequestParamsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * A set of parameters common to Storage API requests concerning an object.
+     * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; + */ + public Builder clearCommonObjectRequestParams() { + if (commonObjectRequestParamsBuilder_ == null) { + commonObjectRequestParams_ = null; + onChanged(); + } else { + commonObjectRequestParams_ = null; + commonObjectRequestParamsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * A set of parameters common to Storage API requests concerning an object.
+     * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; + */ + public com.google.storage.v2.CommonObjectRequestParams.Builder + getCommonObjectRequestParamsBuilder() { + + onChanged(); + return getCommonObjectRequestParamsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A set of parameters common to Storage API requests concerning an object.
+     * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; + */ + public com.google.storage.v2.CommonObjectRequestParamsOrBuilder + getCommonObjectRequestParamsOrBuilder() { + if (commonObjectRequestParamsBuilder_ != null) { + return commonObjectRequestParamsBuilder_.getMessageOrBuilder(); + } else { + return commonObjectRequestParams_ == null + ? com.google.storage.v2.CommonObjectRequestParams.getDefaultInstance() + : commonObjectRequestParams_; + } + } + /** + * + * + *
+     * A set of parameters common to Storage API requests concerning an object.
+     * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.CommonObjectRequestParams, + com.google.storage.v2.CommonObjectRequestParams.Builder, + com.google.storage.v2.CommonObjectRequestParamsOrBuilder> + getCommonObjectRequestParamsFieldBuilder() { + if (commonObjectRequestParamsBuilder_ == null) { + commonObjectRequestParamsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.CommonObjectRequestParams, + com.google.storage.v2.CommonObjectRequestParams.Builder, + com.google.storage.v2.CommonObjectRequestParamsOrBuilder>( + getCommonObjectRequestParams(), getParentForChildren(), isClean()); + commonObjectRequestParams_ = null; + } + return commonObjectRequestParamsBuilder_; + } + + private com.google.storage.v2.CommonRequestParams commonRequestParams_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.CommonRequestParams, + com.google.storage.v2.CommonRequestParams.Builder, + com.google.storage.v2.CommonRequestParamsOrBuilder> + commonRequestParamsBuilder_; + /** + * + * + *
+     * A set of parameters common to all Storage API requests.
+     * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 4; + * + * @return Whether the commonRequestParams field is set. + */ + public boolean hasCommonRequestParams() { + return commonRequestParamsBuilder_ != null || commonRequestParams_ != null; + } + /** + * + * + *
+     * A set of parameters common to all Storage API requests.
+     * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 4; + * + * @return The commonRequestParams. + */ + public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { + if (commonRequestParamsBuilder_ == null) { + return commonRequestParams_ == null + ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() + : commonRequestParams_; + } else { + return commonRequestParamsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * A set of parameters common to all Storage API requests.
+     * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 4; + */ + public Builder setCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { + if (commonRequestParamsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + commonRequestParams_ = value; + onChanged(); + } else { + commonRequestParamsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * A set of parameters common to all Storage API requests.
+     * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 4; + */ + public Builder setCommonRequestParams( + com.google.storage.v2.CommonRequestParams.Builder builderForValue) { + if (commonRequestParamsBuilder_ == null) { + commonRequestParams_ = builderForValue.build(); + onChanged(); + } else { + commonRequestParamsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * A set of parameters common to all Storage API requests.
+     * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 4; + */ + public Builder mergeCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { + if (commonRequestParamsBuilder_ == null) { + if (commonRequestParams_ != null) { + commonRequestParams_ = + com.google.storage.v2.CommonRequestParams.newBuilder(commonRequestParams_) + .mergeFrom(value) + .buildPartial(); + } else { + commonRequestParams_ = value; + } + onChanged(); + } else { + commonRequestParamsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * A set of parameters common to all Storage API requests.
+     * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 4; + */ + public Builder clearCommonRequestParams() { + if (commonRequestParamsBuilder_ == null) { + commonRequestParams_ = null; + onChanged(); + } else { + commonRequestParams_ = null; + commonRequestParamsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * A set of parameters common to all Storage API requests.
+     * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 4; + */ + public com.google.storage.v2.CommonRequestParams.Builder getCommonRequestParamsBuilder() { + + onChanged(); + return getCommonRequestParamsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A set of parameters common to all Storage API requests.
+     * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 4; + */ + public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { + if (commonRequestParamsBuilder_ != null) { + return commonRequestParamsBuilder_.getMessageOrBuilder(); + } else { + return commonRequestParams_ == null + ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() + : commonRequestParams_; + } + } + /** + * + * + *
+     * A set of parameters common to all Storage API requests.
+     * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.CommonRequestParams, + com.google.storage.v2.CommonRequestParams.Builder, + com.google.storage.v2.CommonRequestParamsOrBuilder> + getCommonRequestParamsFieldBuilder() { + if (commonRequestParamsBuilder_ == null) { + commonRequestParamsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.CommonRequestParams, + com.google.storage.v2.CommonRequestParams.Builder, + com.google.storage.v2.CommonRequestParamsOrBuilder>( + getCommonRequestParams(), getParentForChildren(), isClean()); + commonRequestParams_ = null; + } + return commonRequestParamsBuilder_; + } + + @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.StartResumableWriteRequest) + } + + // @@protoc_insertion_point(class_scope:google.storage.v2.StartResumableWriteRequest) + private static final com.google.storage.v2.StartResumableWriteRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.v2.StartResumableWriteRequest(); + } + + public static com.google.storage.v2.StartResumableWriteRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StartResumableWriteRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StartResumableWriteRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.storage.v2.StartResumableWriteRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteRequestOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteRequestOrBuilder.java new file mode 100644 index 0000000000..9889f461ac --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteRequestOrBuilder.java @@ -0,0 +1,130 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +package com.google.storage.v2; + +public interface StartResumableWriteRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.StartResumableWriteRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The destination bucket, object, and metadata, as well as any preconditions.
+   * 
+ * + * .google.storage.v2.WriteObjectSpec write_object_spec = 1; + * + * @return Whether the writeObjectSpec field is set. + */ + boolean hasWriteObjectSpec(); + /** + * + * + *
+   * The destination bucket, object, and metadata, as well as any preconditions.
+   * 
+ * + * .google.storage.v2.WriteObjectSpec write_object_spec = 1; + * + * @return The writeObjectSpec. + */ + com.google.storage.v2.WriteObjectSpec getWriteObjectSpec(); + /** + * + * + *
+   * The destination bucket, object, and metadata, as well as any preconditions.
+   * 
+ * + * .google.storage.v2.WriteObjectSpec write_object_spec = 1; + */ + com.google.storage.v2.WriteObjectSpecOrBuilder getWriteObjectSpecOrBuilder(); + + /** + * + * + *
+   * A set of parameters common to Storage API requests concerning an object.
+   * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; + * + * @return Whether the commonObjectRequestParams field is set. + */ + boolean hasCommonObjectRequestParams(); + /** + * + * + *
+   * A set of parameters common to Storage API requests concerning an object.
+   * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; + * + * @return The commonObjectRequestParams. + */ + com.google.storage.v2.CommonObjectRequestParams getCommonObjectRequestParams(); + /** + * + * + *
+   * A set of parameters common to Storage API requests concerning an object.
+   * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 3; + */ + com.google.storage.v2.CommonObjectRequestParamsOrBuilder getCommonObjectRequestParamsOrBuilder(); + + /** + * + * + *
+   * A set of parameters common to all Storage API requests.
+   * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 4; + * + * @return Whether the commonRequestParams field is set. + */ + boolean hasCommonRequestParams(); + /** + * + * + *
+   * A set of parameters common to all Storage API requests.
+   * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 4; + * + * @return The commonRequestParams. + */ + com.google.storage.v2.CommonRequestParams getCommonRequestParams(); + /** + * + * + *
+   * A set of parameters common to all Storage API requests.
+   * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 4; + */ + com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder(); +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteResponse.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteResponse.java new file mode 100644 index 0000000000..48f6f14e34 --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteResponse.java @@ -0,0 +1,643 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +package com.google.storage.v2; + +/** + * + * + *
+ * Response object for `StartResumableWrite`.
+ * 
+ * + * Protobuf type {@code google.storage.v2.StartResumableWriteResponse} + */ +public final class StartResumableWriteResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.v2.StartResumableWriteResponse) + StartResumableWriteResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use StartResumableWriteResponse.newBuilder() to construct. + private StartResumableWriteResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StartResumableWriteResponse() { + uploadId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StartResumableWriteResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private StartResumableWriteResponse( + 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(); + + uploadId_ = 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_StartResumableWriteResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_StartResumableWriteResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.StartResumableWriteResponse.class, + com.google.storage.v2.StartResumableWriteResponse.Builder.class); + } + + public static final int UPLOAD_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object uploadId_; + /** + * + * + *
+   * The upload_id of the newly started resumable write operation. This
+   * value should be copied into the `WriteObjectRequest.upload_id` field.
+   * 
+ * + * string upload_id = 1; + * + * @return The uploadId. + */ + @java.lang.Override + public java.lang.String getUploadId() { + java.lang.Object ref = uploadId_; + 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(); + uploadId_ = s; + return s; + } + } + /** + * + * + *
+   * The upload_id of the newly started resumable write operation. This
+   * value should be copied into the `WriteObjectRequest.upload_id` field.
+   * 
+ * + * string upload_id = 1; + * + * @return The bytes for uploadId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUploadIdBytes() { + java.lang.Object ref = uploadId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uploadId_ = 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 (!getUploadIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uploadId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getUploadIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, uploadId_); + } + 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.StartResumableWriteResponse)) { + return super.equals(obj); + } + com.google.storage.v2.StartResumableWriteResponse other = + (com.google.storage.v2.StartResumableWriteResponse) obj; + + if (!getUploadId().equals(other.getUploadId())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + UPLOAD_ID_FIELD_NUMBER; + hash = (53 * hash) + getUploadId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.v2.StartResumableWriteResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.StartResumableWriteResponse 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.StartResumableWriteResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.StartResumableWriteResponse 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.StartResumableWriteResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.StartResumableWriteResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.StartResumableWriteResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.StartResumableWriteResponse 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.StartResumableWriteResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.v2.StartResumableWriteResponse 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.StartResumableWriteResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.StartResumableWriteResponse 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.StartResumableWriteResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response object for `StartResumableWrite`.
+   * 
+ * + * Protobuf type {@code google.storage.v2.StartResumableWriteResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.StartResumableWriteResponse) + com.google.storage.v2.StartResumableWriteResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_StartResumableWriteResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_StartResumableWriteResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.StartResumableWriteResponse.class, + com.google.storage.v2.StartResumableWriteResponse.Builder.class); + } + + // Construct using com.google.storage.v2.StartResumableWriteResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + uploadId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_StartResumableWriteResponse_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.StartResumableWriteResponse getDefaultInstanceForType() { + return com.google.storage.v2.StartResumableWriteResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.StartResumableWriteResponse build() { + com.google.storage.v2.StartResumableWriteResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.StartResumableWriteResponse buildPartial() { + com.google.storage.v2.StartResumableWriteResponse result = + new com.google.storage.v2.StartResumableWriteResponse(this); + result.uploadId_ = uploadId_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.storage.v2.StartResumableWriteResponse) { + return mergeFrom((com.google.storage.v2.StartResumableWriteResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.StartResumableWriteResponse other) { + if (other == com.google.storage.v2.StartResumableWriteResponse.getDefaultInstance()) + return this; + if (!other.getUploadId().isEmpty()) { + uploadId_ = other.uploadId_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.storage.v2.StartResumableWriteResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.storage.v2.StartResumableWriteResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object uploadId_ = ""; + /** + * + * + *
+     * The upload_id of the newly started resumable write operation. This
+     * value should be copied into the `WriteObjectRequest.upload_id` field.
+     * 
+ * + * string upload_id = 1; + * + * @return The uploadId. + */ + public java.lang.String getUploadId() { + java.lang.Object ref = uploadId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uploadId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The upload_id of the newly started resumable write operation. This
+     * value should be copied into the `WriteObjectRequest.upload_id` field.
+     * 
+ * + * string upload_id = 1; + * + * @return The bytes for uploadId. + */ + public com.google.protobuf.ByteString getUploadIdBytes() { + java.lang.Object ref = uploadId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uploadId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The upload_id of the newly started resumable write operation. This
+     * value should be copied into the `WriteObjectRequest.upload_id` field.
+     * 
+ * + * string upload_id = 1; + * + * @param value The uploadId to set. + * @return This builder for chaining. + */ + public Builder setUploadId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + uploadId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The upload_id of the newly started resumable write operation. This
+     * value should be copied into the `WriteObjectRequest.upload_id` field.
+     * 
+ * + * string upload_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearUploadId() { + + uploadId_ = getDefaultInstance().getUploadId(); + onChanged(); + return this; + } + /** + * + * + *
+     * The upload_id of the newly started resumable write operation. This
+     * value should be copied into the `WriteObjectRequest.upload_id` field.
+     * 
+ * + * string upload_id = 1; + * + * @param value The bytes for uploadId to set. + * @return This builder for chaining. + */ + public Builder setUploadIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + uploadId_ = 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.StartResumableWriteResponse) + } + + // @@protoc_insertion_point(class_scope:google.storage.v2.StartResumableWriteResponse) + private static final com.google.storage.v2.StartResumableWriteResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.v2.StartResumableWriteResponse(); + } + + public static com.google.storage.v2.StartResumableWriteResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StartResumableWriteResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StartResumableWriteResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.storage.v2.StartResumableWriteResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteResponseOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteResponseOrBuilder.java new file mode 100644 index 0000000000..4936df9ca2 --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteResponseOrBuilder.java @@ -0,0 +1,52 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +package com.google.storage.v2; + +public interface StartResumableWriteResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.StartResumableWriteResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The upload_id of the newly started resumable write operation. This
+   * value should be copied into the `WriteObjectRequest.upload_id` field.
+   * 
+ * + * string upload_id = 1; + * + * @return The uploadId. + */ + java.lang.String getUploadId(); + /** + * + * + *
+   * The upload_id of the newly started resumable write operation. This
+   * value should be copied into the `WriteObjectRequest.upload_id` field.
+   * 
+ * + * string upload_id = 1; + * + * @return The bytes for uploadId. + */ + com.google.protobuf.ByteString getUploadIdBytes(); +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageProto.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageProto.java new file mode 100644 index 0000000000..a4db7e2ed1 --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageProto.java @@ -0,0 +1,855 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +package com.google.storage.v2; + +public final class StorageProto { + private StorageProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_ReadObjectRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_ReadObjectRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_ReadObjectResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_ReadObjectResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_WriteObjectSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_WriteObjectSpec_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_WriteObjectRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_WriteObjectRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_WriteObjectResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_WriteObjectResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_QueryWriteStatusRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_QueryWriteStatusRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_QueryWriteStatusResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_QueryWriteStatusResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_StartResumableWriteRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_StartResumableWriteRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_StartResumableWriteResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_StartResumableWriteResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_CommonObjectRequestParams_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_CommonObjectRequestParams_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_CommonRequestParams_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_CommonRequestParams_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_ServiceConstants_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_ServiceConstants_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_Bucket_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_Bucket_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_Bucket_Billing_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_Bucket_Billing_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_Bucket_Cors_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_Bucket_Cors_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_Bucket_Encryption_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_Bucket_Encryption_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_Bucket_IamConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_Bucket_IamConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_Bucket_IamConfig_UniformBucketLevelAccess_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_Bucket_IamConfig_UniformBucketLevelAccess_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_Bucket_Lifecycle_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_Bucket_Lifecycle_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_Bucket_Lifecycle_Rule_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_Bucket_Lifecycle_Rule_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_Bucket_Lifecycle_Rule_Action_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_Bucket_Lifecycle_Rule_Action_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_Bucket_Lifecycle_Rule_Condition_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_Bucket_Lifecycle_Rule_Condition_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_Bucket_Logging_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_Bucket_Logging_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_Bucket_RetentionPolicy_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_Bucket_RetentionPolicy_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_Bucket_Versioning_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_Bucket_Versioning_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_Bucket_Website_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_Bucket_Website_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_Bucket_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_Bucket_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_BucketAccessControl_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_BucketAccessControl_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_ChecksummedData_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_ChecksummedData_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_ObjectChecksums_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_ObjectChecksums_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_Object_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_Object_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_Object_CustomerEncryption_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_Object_CustomerEncryption_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_Object_MetadataEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_Object_MetadataEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_ObjectAccessControl_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_ObjectAccessControl_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_ProjectTeam_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_ProjectTeam_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_Owner_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_Owner_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_v2_ContentRange_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_v2_ContentRange_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n\037google/storage/v2/storage.proto\022\021googl" + + "e.storage.v2\032\027google/api/client.proto\032\037g" + + "oogle/api/field_behavior.proto\032\031google/a" + + "pi/resource.proto\032\036google/iam/v1/iam_pol" + + "icy.proto\032\032google/iam/v1/policy.proto\032\033g" + + "oogle/protobuf/empty.proto\032 google/proto" + + "buf/field_mask.proto\032\037google/protobuf/ti" + + "mestamp.proto\032\026google/type/date.proto\"\325\004" + + "\n\021ReadObjectRequest\022\016\n\006bucket\030\001 \001(\t\022\016\n\006o" + + "bject\030\002 \001(\t\022\022\n\ngeneration\030\003 \001(\003\022\023\n\013read_" + + "offset\030\004 \001(\003\022\022\n\nread_limit\030\005 \001(\003\022 \n\023if_g" + + "eneration_match\030\006 \001(\003H\000\210\001\001\022$\n\027if_generat" + + "ion_not_match\030\007 \001(\003H\001\210\001\001\022$\n\027if_metagener" + + "ation_match\030\010 \001(\003H\002\210\001\001\022(\n\033if_metagenerat" + + "ion_not_match\030\t \001(\003H\003\210\001\001\022R\n\034common_objec" + + "t_request_params\030\n \001(\0132,.google.storage." + + "v2.CommonObjectRequestParams\022E\n\025common_r" + + "equest_params\030\013 \001(\0132&.google.storage.v2." + + "CommonRequestParams\0222\n\tread_mask\030\014 \001(\0132\032" + + ".google.protobuf.FieldMaskH\004\210\001\001B\026\n\024_if_g" + + "eneration_matchB\032\n\030_if_generation_not_ma" + + "tchB\032\n\030_if_metageneration_matchB\036\n\034_if_m" + + "etageneration_not_matchB\014\n\n_read_mask\"\365\001" + + "\n\022ReadObjectResponse\022<\n\020checksummed_data" + + "\030\001 \001(\0132\".google.storage.v2.ChecksummedDa" + + "ta\022<\n\020object_checksums\030\002 \001(\0132\".google.st" + + "orage.v2.ObjectChecksums\0226\n\rcontent_rang" + + "e\030\003 \001(\0132\037.google.storage.v2.ContentRange" + + "\022+\n\010metadata\030\004 \001(\0132\031.google.storage.v2.O" + + "bject\"\206\003\n\017WriteObjectSpec\022+\n\010resource\030\001 " + + "\001(\0132\031.google.storage.v2.Object\022>\n\016predef" + + "ined_acl\030\002 \001(\0162&.google.storage.v2.Prede" + + "finedObjectAcl\022 \n\023if_generation_match\030\003 " + + "\001(\003H\000\210\001\001\022$\n\027if_generation_not_match\030\004 \001(" + + "\003H\001\210\001\001\022$\n\027if_metageneration_match\030\005 \001(\003H" + + "\002\210\001\001\022(\n\033if_metageneration_not_match\030\006 \001(" + + "\003H\003\210\001\001B\026\n\024_if_generation_matchB\032\n\030_if_ge" + + "neration_not_matchB\032\n\030_if_metageneration" + + "_matchB\036\n\034_if_metageneration_not_match\"\315" + + "\003\n\022WriteObjectRequest\022\023\n\tupload_id\030\001 \001(\t" + + "H\000\022?\n\021write_object_spec\030\002 \001(\0132\".google.s" + + "torage.v2.WriteObjectSpecH\000\022\031\n\014write_off" + + "set\030\003 \001(\003B\003\340A\002\022>\n\020checksummed_data\030\004 \001(\013" + + "2\".google.storage.v2.ChecksummedDataH\001\022<" + + "\n\020object_checksums\030\006 \001(\0132\".google.storag" + + "e.v2.ObjectChecksums\022\024\n\014finish_write\030\007 \001" + + "(\010\022R\n\034common_object_request_params\030\010 \001(\013" + + "2,.google.storage.v2.CommonObjectRequest" + + "Params\022E\n\025common_request_params\030\t \001(\0132&." + + "google.storage.v2.CommonRequestParamsB\017\n" + + "\rfirst_messageB\006\n\004data\"n\n\023WriteObjectRes" + + "ponse\022\030\n\016committed_size\030\001 \001(\003H\000\022-\n\010resou" + + "rce\030\002 \001(\0132\031.google.storage.v2.ObjectH\000B\016" + + "\n\014write_status\"\314\001\n\027QueryWriteStatusReque" + + "st\022\026\n\tupload_id\030\001 \001(\tB\003\340A\002\022R\n\034common_obj" + + "ect_request_params\030\002 \001(\0132,.google.storag" + + "e.v2.CommonObjectRequestParams\022E\n\025common" + + "_request_params\030\003 \001(\0132&.google.storage.v" + + "2.CommonRequestParams\"s\n\030QueryWriteStatu" + + "sResponse\022\030\n\016committed_size\030\001 \001(\003H\000\022-\n\010r" + + "esource\030\002 \001(\0132\031.google.storage.v2.Object" + + "H\000B\016\n\014write_status\"\366\001\n\032StartResumableWri" + + "teRequest\022=\n\021write_object_spec\030\001 \001(\0132\".g" + + "oogle.storage.v2.WriteObjectSpec\022R\n\034comm" + + "on_object_request_params\030\003 \001(\0132,.google." + + "storage.v2.CommonObjectRequestParams\022E\n\025" + + "common_request_params\030\004 \001(\0132&.google.sto" + + "rage.v2.CommonRequestParams\"0\n\033StartResu" + + "mableWriteResponse\022\021\n\tupload_id\030\001 \001(\t\"|\n" + + "\031CommonObjectRequestParams\022\034\n\024encryption" + + "_algorithm\030\001 \001(\t\022\034\n\024encryption_key_bytes" + + "\030\004 \001(\014\022#\n\033encryption_key_sha256_bytes\030\005 " + + "\001(\014\"`\n\023CommonRequestParams\022I\n\014user_proje" + + "ct\030\001 \001(\tB3\340A\002\372A-\n+cloudresourcemanager.g" + + "oogleapis.com/Project\"\312\005\n\020ServiceConstan" + + "ts\"\265\005\n\006Values\022\026\n\022VALUES_UNSPECIFIED\020\000\022\033\n" + + "\024MAX_READ_CHUNK_BYTES\020\200\200\200\001\022\034\n\025MAX_WRITE_" + + "CHUNK_BYTES\020\200\200\200\001\022\031\n\022MAX_OBJECT_SIZE_MB\020\200" + + "\200\300\002\022)\n$MAX_CUSTOM_METADATA_FIELD_NAME_BY" + + "TES\020\200\010\022*\n%MAX_CUSTOM_METADATA_FIELD_VALU" + + "E_BYTES\020\200 \022)\n$MAX_CUSTOM_METADATA_TOTAL_" + + "SIZE_BYTES\020\200@\022*\n$MAX_BUCKET_METADATA_TOT" + + "AL_SIZE_BYTES\020\200\240\001\022\'\n#MAX_NOTIFICATION_CO" + + "NFIGS_PER_BUCKET\020d\022\"\n\036MAX_LIFECYCLE_RULE" + + "S_PER_BUCKET\020d\022&\n\"MAX_NOTIFICATION_CUSTO" + + "M_ATTRIBUTES\020\005\0221\n,MAX_NOTIFICATION_CUSTO" + + "M_ATTRIBUTE_KEY_LENGTH\020\200\002\0223\n.MAX_NOTIFIC" + + "ATION_CUSTOM_ATTRIBUTE_VALUE_LENGTH\020\200\010\022\034" + + "\n\030MAX_LABELS_ENTRIES_COUNT\020@\022\037\n\033MAX_LABE" + + "LS_KEY_VALUE_LENGTH\020?\022\037\n\032MAX_LABELS_KEY_" + + "VALUE_BYTES\020\200\001\022.\n)MAX_OBJECT_IDS_PER_DEL" + + "ETE_OBJECTS_REQUEST\020\350\007\022\036\n\032SPLIT_TOKEN_MA" + + "X_VALID_DAYS\020\016\032\002\020\001\"\204\026\n\006Bucket\022\021\n\004name\030\001 " + + "\001(\tB\003\340A\005\022\026\n\tbucket_id\030\002 \001(\tB\003\340A\003\022D\n\007proj" + + "ect\030\003 \001(\tB3\340A\005\372A-\n+cloudresourcemanager." + + "googleapis.com/Project\022\033\n\016metageneration" + + "\030\004 \001(\003B\003\340A\003\022\025\n\010location\030\005 \001(\tB\003\340A\005\022\032\n\rlo" + + "cation_type\030\006 \001(\tB\003\340A\003\022\025\n\rstorage_class\030" + + "\007 \001(\t\0223\n\003acl\030\010 \003(\0132&.google.storage.v2.B" + + "ucketAccessControl\022B\n\022default_object_acl" + + "\030\t \003(\0132&.google.storage.v2.ObjectAccessC" + + "ontrol\0226\n\tlifecycle\030\n \001(\0132#.google.stora" + + "ge.v2.Bucket.Lifecycle\0224\n\013create_time\030\013 " + + "\001(\0132\032.google.protobuf.TimestampB\003\340A\003\022,\n\004" + + "cors\030\014 \003(\0132\036.google.storage.v2.Bucket.Co" + + "rs\0224\n\013update_time\030\r \001(\0132\032.google.protobu" + + "f.TimestampB\003\340A\003\022 \n\030default_event_based_" + + "hold\030\016 \001(\010\0225\n\006labels\030\017 \003(\0132%.google.stor" + + "age.v2.Bucket.LabelsEntry\0222\n\007website\030\020 \001" + + "(\0132!.google.storage.v2.Bucket.Website\0228\n" + + "\nversioning\030\021 \001(\0132$.google.storage.v2.Bu" + + "cket.Versioning\0222\n\007logging\030\022 \001(\0132!.googl" + + "e.storage.v2.Bucket.Logging\022,\n\005owner\030\023 \001" + + "(\0132\030.google.storage.v2.OwnerB\003\340A\003\0228\n\nenc" + + "ryption\030\024 \001(\0132$.google.storage.v2.Bucket" + + ".Encryption\0222\n\007billing\030\025 \001(\0132!.google.st" + + "orage.v2.Bucket.Billing\022C\n\020retention_pol" + + "icy\030\026 \001(\0132).google.storage.v2.Bucket.Ret" + + "entionPolicy\0227\n\niam_config\030\027 \001(\0132#.googl" + + "e.storage.v2.Bucket.IamConfig\022\032\n\rzone_af" + + "finity\030\030 \003(\tB\003\340A\005\022\025\n\rsatisfies_pzs\030\031 \001(\010" + + "\032!\n\007Billing\022\026\n\016requester_pays\030\001 \001(\010\032X\n\004C" + + "ors\022\016\n\006origin\030\001 \003(\t\022\016\n\006method\030\002 \003(\t\022\027\n\017r" + + "esponse_header\030\003 \003(\t\022\027\n\017max_age_seconds\030" + + "\004 \001(\005\032M\n\nEncryption\022?\n\017default_kms_key\030\001" + + " \001(\tB&\372A#\n!cloudkms.googleapis.com/Crypt" + + "oKey\032\372\002\n\tIamConfig\022a\n\033uniform_bucket_lev" + + "el_access\030\001 \001(\0132<.google.storage.v2.Buck" + + "et.IamConfig.UniformBucketLevelAccess\022\\\n" + + "\030public_access_prevention\030\002 \001(\0162:.google" + + ".storage.v2.Bucket.IamConfig.PublicAcces" + + "sPrevention\032Z\n\030UniformBucketLevelAccess\022" + + "\017\n\007enabled\030\001 \001(\010\022-\n\tlock_time\030\002 \001(\0132\032.go" + + "ogle.protobuf.Timestamp\"P\n\026PublicAccessP" + + "revention\022(\n$PUBLIC_ACCESS_PREVENTION_UN" + + "SPECIFIED\020\000\022\014\n\010ENFORCED\020\001\032\303\005\n\tLifecycle\022" + + "6\n\004rule\030\001 \003(\0132(.google.storage.v2.Bucket" + + ".Lifecycle.Rule\032\375\004\n\004Rule\022?\n\006action\030\001 \001(\013" + + "2/.google.storage.v2.Bucket.Lifecycle.Ru" + + "le.Action\022E\n\tcondition\030\002 \001(\01322.google.st" + + "orage.v2.Bucket.Lifecycle.Rule.Condition" + + "\032-\n\006Action\022\014\n\004type\030\001 \001(\t\022\025\n\rstorage_clas" + + "s\030\002 \001(\t\032\275\003\n\tCondition\022\025\n\010age_days\030\001 \001(\005H" + + "\000\210\001\001\022)\n\016created_before\030\002 \001(\0132\021.google.ty" + + "pe.Date\022\024\n\007is_live\030\003 \001(\010H\001\210\001\001\022\037\n\022num_new" + + "er_versions\030\004 \001(\005H\002\210\001\001\022\035\n\025matches_storag" + + "e_class\030\005 \003(\t\022#\n\026days_since_custom_time\030" + + "\007 \001(\005H\003\210\001\001\022-\n\022custom_time_before\030\010 \001(\0132\021" + + ".google.type.Date\022\'\n\032days_since_noncurre" + + "nt_time\030\t \001(\005H\004\210\001\001\0221\n\026noncurrent_time_be" + + "fore\030\n \001(\0132\021.google.type.DateB\013\n\t_age_da" + + "ysB\n\n\010_is_liveB\025\n\023_num_newer_versionsB\031\n" + + "\027_days_since_custom_timeB\035\n\033_days_since_" + + "noncurrent_time\0328\n\007Logging\022\022\n\nlog_bucket" + + "\030\001 \001(\t\022\031\n\021log_object_prefix\030\002 \001(\t\032r\n\017Ret" + + "entionPolicy\0222\n\016effective_time\030\001 \001(\0132\032.g" + + "oogle.protobuf.Timestamp\022\021\n\tis_locked\030\002 " + + "\001(\010\022\030\n\020retention_period\030\003 \001(\003\032\035\n\nVersion" + + "ing\022\017\n\007enabled\030\001 \001(\010\032;\n\007Website\022\030\n\020main_" + + "page_suffix\030\001 \001(\t\022\026\n\016not_found_page\030\002 \001(" + + "\t\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002" + + " \001(\t:\0028\001:G\352AD\n\035storage.googleapis.com/Bu" + + "cket\022#projects/{project}/buckets/{bucket" + + "}\"\247\001\n\023BucketAccessControl\022\014\n\004role\030\001 \001(\t\022" + + "\n\n\002id\030\002 \001(\t\022\016\n\006entity\030\003 \001(\t\022\021\n\tentity_id" + + "\030\004 \001(\t\022\r\n\005email\030\005 \001(\t\022\016\n\006domain\030\006 \001(\t\0224\n" + + "\014project_team\030\007 \001(\0132\036.google.storage.v2." + + "ProjectTeam\"B\n\017ChecksummedData\022\017\n\007conten" + + "t\030\001 \001(\014\022\023\n\006crc32c\030\002 \001(\007H\000\210\001\001B\t\n\007_crc32c\"" + + "C\n\017ObjectChecksums\022\023\n\006crc32c\030\001 \001(\007H\000\210\001\001\022" + + "\020\n\010md5_hash\030\002 \001(\014B\t\n\007_crc32c\"\303\t\n\006Object\022" + + "\021\n\004name\030\001 \001(\tB\003\340A\005\0225\n\006bucket\030\002 \001(\tB%\340A\005\372" + + "A\037\n\035storage.googleapis.com/Bucket\022\027\n\ngen" + + "eration\030\003 \001(\003B\003\340A\005\022\033\n\016metageneration\030\004 \001" + + "(\003B\003\340A\003\022\025\n\rstorage_class\030\005 \001(\t\022\021\n\004size\030\006" + + " \001(\003B\003\340A\003\022\030\n\020content_encoding\030\007 \001(\t\022\033\n\023c" + + "ontent_disposition\030\010 \001(\t\022\025\n\rcache_contro" + + "l\030\t \001(\t\0223\n\003acl\030\n \003(\0132&.google.storage.v2" + + ".ObjectAccessControl\022\030\n\020content_language" + + "\030\013 \001(\t\0224\n\013delete_time\030\014 \001(\0132\032.google.pro" + + "tobuf.TimestampB\003\340A\003\022\024\n\014content_type\030\r \001" + + "(\t\0224\n\013create_time\030\016 \001(\0132\032.google.protobu" + + "f.TimestampB\003\340A\003\022\034\n\017component_count\030\017 \001(" + + "\005B\003\340A\003\022:\n\tchecksums\030\020 \001(\0132\".google.stora" + + "ge.v2.ObjectChecksumsB\003\340A\003\0224\n\013update_tim" + + "e\030\021 \001(\0132\032.google.protobuf.TimestampB\003\340A\003" + + "\0227\n\007kms_key\030\022 \001(\tB&\372A#\n!cloudkms.googlea" + + "pis.com/CryptoKey\022B\n\031update_storage_clas" + + "s_time\030\023 \001(\0132\032.google.protobuf.Timestamp" + + "B\003\340A\003\022\026\n\016temporary_hold\030\024 \001(\010\0229\n\025retenti" + + "on_expire_time\030\025 \001(\0132\032.google.protobuf.T" + + "imestamp\0229\n\010metadata\030\026 \003(\0132\'.google.stor" + + "age.v2.Object.MetadataEntry\022\035\n\020event_bas" + + "ed_hold\030\027 \001(\010H\000\210\001\001\022,\n\005owner\030\030 \001(\0132\030.goog" + + "le.storage.v2.OwnerB\003\340A\003\022I\n\023customer_enc" + + "ryption\030\031 \001(\0132,.google.storage.v2.Object" + + ".CustomerEncryption\022/\n\013custom_time\030\032 \001(\013" + + "2\032.google.protobuf.Timestamp\032F\n\022Customer" + + "Encryption\022\034\n\024encryption_algorithm\030\001 \001(\t" + + "\022\022\n\nkey_sha256\030\002 \001(\t\032/\n\rMetadataEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001B\023\n\021_event_" + + "based_hold\"\247\001\n\023ObjectAccessControl\022\014\n\004ro" + + "le\030\001 \001(\t\022\n\n\002id\030\002 \001(\t\022\016\n\006entity\030\003 \001(\t\022\021\n\t" + + "entity_id\030\004 \001(\t\022\r\n\005email\030\005 \001(\t\022\016\n\006domain" + + "\030\006 \001(\t\0224\n\014project_team\030\007 \001(\0132\036.google.st" + + "orage.v2.ProjectTeam\"3\n\013ProjectTeam\022\026\n\016p" + + "roject_number\030\001 \001(\t\022\014\n\004team\030\002 \001(\t\"*\n\005Own" + + "er\022\016\n\006entity\030\001 \001(\t\022\021\n\tentity_id\030\002 \001(\t\"C\n" + + "\014ContentRange\022\r\n\005start\030\001 \001(\003\022\013\n\003end\030\002 \001(" + + "\003\022\027\n\017complete_length\030\003 \001(\003*\377\001\n\023Predefine" + + "dObjectAcl\022%\n!PREDEFINED_OBJECT_ACL_UNSP" + + "ECIFIED\020\000\022!\n\035OBJECT_ACL_AUTHENTICATED_RE" + + "AD\020\001\022(\n$OBJECT_ACL_BUCKET_OWNER_FULL_CON" + + "TROL\020\002\022 \n\034OBJECT_ACL_BUCKET_OWNER_READ\020\003" + + "\022\026\n\022OBJECT_ACL_PRIVATE\020\004\022\036\n\032OBJECT_ACL_P" + + "ROJECT_PRIVATE\020\005\022\032\n\026OBJECT_ACL_PUBLIC_RE" + + "AD\020\0062\223\006\n\007Storage\022\210\001\n\nReadObject\022$.google" + + ".storage.v2.ReadObjectRequest\032%.google.s" + + "torage.v2.ReadObjectResponse\"+\332A\rbucket," + + "object\332A\030bucket,object,generation0\001\022`\n\013W" + + "riteObject\022%.google.storage.v2.WriteObje" + + "ctRequest\032&.google.storage.v2.WriteObjec" + + "tResponse\"\000(\001\022v\n\023StartResumableWrite\022-.g" + + "oogle.storage.v2.StartResumableWriteRequ" + + "est\032..google.storage.v2.StartResumableWr" + + "iteResponse\"\000\022y\n\020QueryWriteStatus\022*.goog" + + "le.storage.v2.QueryWriteStatusRequest\032+." + + "google.storage.v2.QueryWriteStatusRespon" + + "se\"\014\332A\tupload_id\032\247\002\312A\026storage.googleapis" + + ".com\322A\212\002https://www.googleapis.com/auth/" + + "cloud-platform,https://www.googleapis.co" + + "m/auth/cloud-platform.read-only,https://" + + "www.googleapis.com/auth/devstorage.full_" + + "control,https://www.googleapis.com/auth/" + + "devstorage.read_only,https://www.googlea" + + "pis.com/auth/devstorage.read_writeB\334\001\n\025c" + + "om.google.storage.v2B\014StorageProtoP\001Z8go" + + "ogle.golang.org/genproto/googleapis/stor" + + "age/v2;storage\352Ax\n!cloudkms.googleapis.c" + + "om/CryptoKey\022Sprojects/{project}/locatio" + + "ns/{location}/keyRings/{key_ring}/crypto" + + "Keys/{crypto_key}b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.iam.v1.IamPolicyProto.getDescriptor(), + com.google.iam.v1.PolicyProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.type.DateProto.getDescriptor(), + }); + internal_static_google_storage_v2_ReadObjectRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_storage_v2_ReadObjectRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_ReadObjectRequest_descriptor, + new java.lang.String[] { + "Bucket", + "Object", + "Generation", + "ReadOffset", + "ReadLimit", + "IfGenerationMatch", + "IfGenerationNotMatch", + "IfMetagenerationMatch", + "IfMetagenerationNotMatch", + "CommonObjectRequestParams", + "CommonRequestParams", + "ReadMask", + "IfGenerationMatch", + "IfGenerationNotMatch", + "IfMetagenerationMatch", + "IfMetagenerationNotMatch", + "ReadMask", + }); + internal_static_google_storage_v2_ReadObjectResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_storage_v2_ReadObjectResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_ReadObjectResponse_descriptor, + new java.lang.String[] { + "ChecksummedData", "ObjectChecksums", "ContentRange", "Metadata", + }); + internal_static_google_storage_v2_WriteObjectSpec_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_storage_v2_WriteObjectSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_WriteObjectSpec_descriptor, + new java.lang.String[] { + "Resource", + "PredefinedAcl", + "IfGenerationMatch", + "IfGenerationNotMatch", + "IfMetagenerationMatch", + "IfMetagenerationNotMatch", + "IfGenerationMatch", + "IfGenerationNotMatch", + "IfMetagenerationMatch", + "IfMetagenerationNotMatch", + }); + internal_static_google_storage_v2_WriteObjectRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_storage_v2_WriteObjectRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_WriteObjectRequest_descriptor, + new java.lang.String[] { + "UploadId", + "WriteObjectSpec", + "WriteOffset", + "ChecksummedData", + "ObjectChecksums", + "FinishWrite", + "CommonObjectRequestParams", + "CommonRequestParams", + "FirstMessage", + "Data", + }); + internal_static_google_storage_v2_WriteObjectResponse_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_storage_v2_WriteObjectResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_WriteObjectResponse_descriptor, + new java.lang.String[] { + "CommittedSize", "Resource", "WriteStatus", + }); + internal_static_google_storage_v2_QueryWriteStatusRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_storage_v2_QueryWriteStatusRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_QueryWriteStatusRequest_descriptor, + new java.lang.String[] { + "UploadId", "CommonObjectRequestParams", "CommonRequestParams", + }); + internal_static_google_storage_v2_QueryWriteStatusResponse_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_storage_v2_QueryWriteStatusResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_QueryWriteStatusResponse_descriptor, + new java.lang.String[] { + "CommittedSize", "Resource", "WriteStatus", + }); + internal_static_google_storage_v2_StartResumableWriteRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_storage_v2_StartResumableWriteRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_StartResumableWriteRequest_descriptor, + new java.lang.String[] { + "WriteObjectSpec", "CommonObjectRequestParams", "CommonRequestParams", + }); + internal_static_google_storage_v2_StartResumableWriteResponse_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_storage_v2_StartResumableWriteResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_StartResumableWriteResponse_descriptor, + new java.lang.String[] { + "UploadId", + }); + internal_static_google_storage_v2_CommonObjectRequestParams_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_storage_v2_CommonObjectRequestParams_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_CommonObjectRequestParams_descriptor, + new java.lang.String[] { + "EncryptionAlgorithm", "EncryptionKeyBytes", "EncryptionKeySha256Bytes", + }); + internal_static_google_storage_v2_CommonRequestParams_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_storage_v2_CommonRequestParams_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_CommonRequestParams_descriptor, + new java.lang.String[] { + "UserProject", + }); + internal_static_google_storage_v2_ServiceConstants_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_storage_v2_ServiceConstants_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_ServiceConstants_descriptor, + new java.lang.String[] {}); + internal_static_google_storage_v2_Bucket_descriptor = getDescriptor().getMessageTypes().get(12); + internal_static_google_storage_v2_Bucket_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_Bucket_descriptor, + new java.lang.String[] { + "Name", + "BucketId", + "Project", + "Metageneration", + "Location", + "LocationType", + "StorageClass", + "Acl", + "DefaultObjectAcl", + "Lifecycle", + "CreateTime", + "Cors", + "UpdateTime", + "DefaultEventBasedHold", + "Labels", + "Website", + "Versioning", + "Logging", + "Owner", + "Encryption", + "Billing", + "RetentionPolicy", + "IamConfig", + "ZoneAffinity", + "SatisfiesPzs", + }); + internal_static_google_storage_v2_Bucket_Billing_descriptor = + internal_static_google_storage_v2_Bucket_descriptor.getNestedTypes().get(0); + internal_static_google_storage_v2_Bucket_Billing_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_Bucket_Billing_descriptor, + new java.lang.String[] { + "RequesterPays", + }); + internal_static_google_storage_v2_Bucket_Cors_descriptor = + internal_static_google_storage_v2_Bucket_descriptor.getNestedTypes().get(1); + internal_static_google_storage_v2_Bucket_Cors_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_Bucket_Cors_descriptor, + new java.lang.String[] { + "Origin", "Method", "ResponseHeader", "MaxAgeSeconds", + }); + internal_static_google_storage_v2_Bucket_Encryption_descriptor = + internal_static_google_storage_v2_Bucket_descriptor.getNestedTypes().get(2); + internal_static_google_storage_v2_Bucket_Encryption_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_Bucket_Encryption_descriptor, + new java.lang.String[] { + "DefaultKmsKey", + }); + internal_static_google_storage_v2_Bucket_IamConfig_descriptor = + internal_static_google_storage_v2_Bucket_descriptor.getNestedTypes().get(3); + internal_static_google_storage_v2_Bucket_IamConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_Bucket_IamConfig_descriptor, + new java.lang.String[] { + "UniformBucketLevelAccess", "PublicAccessPrevention", + }); + internal_static_google_storage_v2_Bucket_IamConfig_UniformBucketLevelAccess_descriptor = + internal_static_google_storage_v2_Bucket_IamConfig_descriptor.getNestedTypes().get(0); + internal_static_google_storage_v2_Bucket_IamConfig_UniformBucketLevelAccess_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_Bucket_IamConfig_UniformBucketLevelAccess_descriptor, + new java.lang.String[] { + "Enabled", "LockTime", + }); + internal_static_google_storage_v2_Bucket_Lifecycle_descriptor = + internal_static_google_storage_v2_Bucket_descriptor.getNestedTypes().get(4); + internal_static_google_storage_v2_Bucket_Lifecycle_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_Bucket_Lifecycle_descriptor, + new java.lang.String[] { + "Rule", + }); + internal_static_google_storage_v2_Bucket_Lifecycle_Rule_descriptor = + internal_static_google_storage_v2_Bucket_Lifecycle_descriptor.getNestedTypes().get(0); + internal_static_google_storage_v2_Bucket_Lifecycle_Rule_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_Bucket_Lifecycle_Rule_descriptor, + new java.lang.String[] { + "Action", "Condition", + }); + internal_static_google_storage_v2_Bucket_Lifecycle_Rule_Action_descriptor = + internal_static_google_storage_v2_Bucket_Lifecycle_Rule_descriptor.getNestedTypes().get(0); + internal_static_google_storage_v2_Bucket_Lifecycle_Rule_Action_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_Bucket_Lifecycle_Rule_Action_descriptor, + new java.lang.String[] { + "Type", "StorageClass", + }); + internal_static_google_storage_v2_Bucket_Lifecycle_Rule_Condition_descriptor = + internal_static_google_storage_v2_Bucket_Lifecycle_Rule_descriptor.getNestedTypes().get(1); + internal_static_google_storage_v2_Bucket_Lifecycle_Rule_Condition_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_Bucket_Lifecycle_Rule_Condition_descriptor, + new java.lang.String[] { + "AgeDays", + "CreatedBefore", + "IsLive", + "NumNewerVersions", + "MatchesStorageClass", + "DaysSinceCustomTime", + "CustomTimeBefore", + "DaysSinceNoncurrentTime", + "NoncurrentTimeBefore", + "AgeDays", + "IsLive", + "NumNewerVersions", + "DaysSinceCustomTime", + "DaysSinceNoncurrentTime", + }); + internal_static_google_storage_v2_Bucket_Logging_descriptor = + internal_static_google_storage_v2_Bucket_descriptor.getNestedTypes().get(5); + internal_static_google_storage_v2_Bucket_Logging_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_Bucket_Logging_descriptor, + new java.lang.String[] { + "LogBucket", "LogObjectPrefix", + }); + internal_static_google_storage_v2_Bucket_RetentionPolicy_descriptor = + internal_static_google_storage_v2_Bucket_descriptor.getNestedTypes().get(6); + internal_static_google_storage_v2_Bucket_RetentionPolicy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_Bucket_RetentionPolicy_descriptor, + new java.lang.String[] { + "EffectiveTime", "IsLocked", "RetentionPeriod", + }); + internal_static_google_storage_v2_Bucket_Versioning_descriptor = + internal_static_google_storage_v2_Bucket_descriptor.getNestedTypes().get(7); + internal_static_google_storage_v2_Bucket_Versioning_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_Bucket_Versioning_descriptor, + new java.lang.String[] { + "Enabled", + }); + internal_static_google_storage_v2_Bucket_Website_descriptor = + internal_static_google_storage_v2_Bucket_descriptor.getNestedTypes().get(8); + internal_static_google_storage_v2_Bucket_Website_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_Bucket_Website_descriptor, + new java.lang.String[] { + "MainPageSuffix", "NotFoundPage", + }); + internal_static_google_storage_v2_Bucket_LabelsEntry_descriptor = + internal_static_google_storage_v2_Bucket_descriptor.getNestedTypes().get(9); + internal_static_google_storage_v2_Bucket_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_Bucket_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_storage_v2_BucketAccessControl_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_storage_v2_BucketAccessControl_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_BucketAccessControl_descriptor, + new java.lang.String[] { + "Role", "Id", "Entity", "EntityId", "Email", "Domain", "ProjectTeam", + }); + internal_static_google_storage_v2_ChecksummedData_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_storage_v2_ChecksummedData_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_ChecksummedData_descriptor, + new java.lang.String[] { + "Content", "Crc32C", "Crc32C", + }); + internal_static_google_storage_v2_ObjectChecksums_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_storage_v2_ObjectChecksums_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_ObjectChecksums_descriptor, + new java.lang.String[] { + "Crc32C", "Md5Hash", "Crc32C", + }); + internal_static_google_storage_v2_Object_descriptor = getDescriptor().getMessageTypes().get(16); + internal_static_google_storage_v2_Object_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_Object_descriptor, + new java.lang.String[] { + "Name", + "Bucket", + "Generation", + "Metageneration", + "StorageClass", + "Size", + "ContentEncoding", + "ContentDisposition", + "CacheControl", + "Acl", + "ContentLanguage", + "DeleteTime", + "ContentType", + "CreateTime", + "ComponentCount", + "Checksums", + "UpdateTime", + "KmsKey", + "UpdateStorageClassTime", + "TemporaryHold", + "RetentionExpireTime", + "Metadata", + "EventBasedHold", + "Owner", + "CustomerEncryption", + "CustomTime", + "EventBasedHold", + }); + internal_static_google_storage_v2_Object_CustomerEncryption_descriptor = + internal_static_google_storage_v2_Object_descriptor.getNestedTypes().get(0); + internal_static_google_storage_v2_Object_CustomerEncryption_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_Object_CustomerEncryption_descriptor, + new java.lang.String[] { + "EncryptionAlgorithm", "KeySha256", + }); + internal_static_google_storage_v2_Object_MetadataEntry_descriptor = + internal_static_google_storage_v2_Object_descriptor.getNestedTypes().get(1); + internal_static_google_storage_v2_Object_MetadataEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_Object_MetadataEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_storage_v2_ObjectAccessControl_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_storage_v2_ObjectAccessControl_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_ObjectAccessControl_descriptor, + new java.lang.String[] { + "Role", "Id", "Entity", "EntityId", "Email", "Domain", "ProjectTeam", + }); + internal_static_google_storage_v2_ProjectTeam_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_google_storage_v2_ProjectTeam_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_ProjectTeam_descriptor, + new java.lang.String[] { + "ProjectNumber", "Team", + }); + internal_static_google_storage_v2_Owner_descriptor = getDescriptor().getMessageTypes().get(19); + internal_static_google_storage_v2_Owner_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_Owner_descriptor, + new java.lang.String[] { + "Entity", "EntityId", + }); + internal_static_google_storage_v2_ContentRange_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_google_storage_v2_ContentRange_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_v2_ContentRange_descriptor, + new java.lang.String[] { + "Start", "End", "CompleteLength", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceDefinition); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.iam.v1.IamPolicyProto.getDescriptor(); + com.google.iam.v1.PolicyProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.type.DateProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectRequest.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectRequest.java new file mode 100644 index 0000000000..34f53ff189 --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectRequest.java @@ -0,0 +1,2592 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +package com.google.storage.v2; + +/** + * + * + *
+ * Request message for WriteObject.
+ * 
+ * + * Protobuf type {@code google.storage.v2.WriteObjectRequest} + */ +public final class WriteObjectRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.v2.WriteObjectRequest) + WriteObjectRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use WriteObjectRequest.newBuilder() to construct. + private WriteObjectRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private WriteObjectRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new WriteObjectRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private WriteObjectRequest( + 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(); + firstMessageCase_ = 1; + firstMessage_ = s; + break; + } + case 18: + { + com.google.storage.v2.WriteObjectSpec.Builder subBuilder = null; + if (firstMessageCase_ == 2) { + subBuilder = ((com.google.storage.v2.WriteObjectSpec) firstMessage_).toBuilder(); + } + firstMessage_ = + input.readMessage( + com.google.storage.v2.WriteObjectSpec.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.storage.v2.WriteObjectSpec) firstMessage_); + firstMessage_ = subBuilder.buildPartial(); + } + firstMessageCase_ = 2; + break; + } + case 24: + { + writeOffset_ = input.readInt64(); + break; + } + case 34: + { + com.google.storage.v2.ChecksummedData.Builder subBuilder = null; + if (dataCase_ == 4) { + subBuilder = ((com.google.storage.v2.ChecksummedData) data_).toBuilder(); + } + data_ = + input.readMessage( + com.google.storage.v2.ChecksummedData.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.storage.v2.ChecksummedData) data_); + data_ = subBuilder.buildPartial(); + } + dataCase_ = 4; + break; + } + case 50: + { + com.google.storage.v2.ObjectChecksums.Builder subBuilder = null; + if (objectChecksums_ != null) { + subBuilder = objectChecksums_.toBuilder(); + } + objectChecksums_ = + input.readMessage( + com.google.storage.v2.ObjectChecksums.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(objectChecksums_); + objectChecksums_ = subBuilder.buildPartial(); + } + + break; + } + case 56: + { + finishWrite_ = input.readBool(); + break; + } + case 66: + { + com.google.storage.v2.CommonObjectRequestParams.Builder subBuilder = null; + if (commonObjectRequestParams_ != null) { + subBuilder = commonObjectRequestParams_.toBuilder(); + } + commonObjectRequestParams_ = + input.readMessage( + com.google.storage.v2.CommonObjectRequestParams.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(commonObjectRequestParams_); + commonObjectRequestParams_ = subBuilder.buildPartial(); + } + + break; + } + case 74: + { + com.google.storage.v2.CommonRequestParams.Builder subBuilder = null; + if (commonRequestParams_ != null) { + subBuilder = commonRequestParams_.toBuilder(); + } + commonRequestParams_ = + input.readMessage( + com.google.storage.v2.CommonRequestParams.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(commonRequestParams_); + commonRequestParams_ = 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_WriteObjectRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_WriteObjectRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.WriteObjectRequest.class, + com.google.storage.v2.WriteObjectRequest.Builder.class); + } + + private int firstMessageCase_ = 0; + private java.lang.Object firstMessage_; + + public enum FirstMessageCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + UPLOAD_ID(1), + WRITE_OBJECT_SPEC(2), + FIRSTMESSAGE_NOT_SET(0); + private final int value; + + private FirstMessageCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static FirstMessageCase valueOf(int value) { + return forNumber(value); + } + + public static FirstMessageCase forNumber(int value) { + switch (value) { + case 1: + return UPLOAD_ID; + case 2: + return WRITE_OBJECT_SPEC; + case 0: + return FIRSTMESSAGE_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public FirstMessageCase getFirstMessageCase() { + return FirstMessageCase.forNumber(firstMessageCase_); + } + + private int dataCase_ = 0; + private java.lang.Object data_; + + public enum DataCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + CHECKSUMMED_DATA(4), + DATA_NOT_SET(0); + private final int value; + + private DataCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static DataCase valueOf(int value) { + return forNumber(value); + } + + public static DataCase forNumber(int value) { + switch (value) { + case 4: + return CHECKSUMMED_DATA; + case 0: + return DATA_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public DataCase getDataCase() { + return DataCase.forNumber(dataCase_); + } + + public static final int UPLOAD_ID_FIELD_NUMBER = 1; + /** + * + * + *
+   * For resumable uploads. This should be the `upload_id` returned from a
+   * call to `StartResumableWriteResponse`.
+   * 
+ * + * string upload_id = 1; + * + * @return Whether the uploadId field is set. + */ + public boolean hasUploadId() { + return firstMessageCase_ == 1; + } + /** + * + * + *
+   * For resumable uploads. This should be the `upload_id` returned from a
+   * call to `StartResumableWriteResponse`.
+   * 
+ * + * string upload_id = 1; + * + * @return The uploadId. + */ + public java.lang.String getUploadId() { + java.lang.Object ref = ""; + if (firstMessageCase_ == 1) { + ref = firstMessage_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (firstMessageCase_ == 1) { + firstMessage_ = s; + } + return s; + } + } + /** + * + * + *
+   * For resumable uploads. This should be the `upload_id` returned from a
+   * call to `StartResumableWriteResponse`.
+   * 
+ * + * string upload_id = 1; + * + * @return The bytes for uploadId. + */ + public com.google.protobuf.ByteString getUploadIdBytes() { + java.lang.Object ref = ""; + if (firstMessageCase_ == 1) { + ref = firstMessage_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (firstMessageCase_ == 1) { + firstMessage_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int WRITE_OBJECT_SPEC_FIELD_NUMBER = 2; + /** + * + * + *
+   * For non-resumable uploads. Describes the overall upload, including the
+   * destination bucket and object name, preconditions, etc.
+   * 
+ * + * .google.storage.v2.WriteObjectSpec write_object_spec = 2; + * + * @return Whether the writeObjectSpec field is set. + */ + @java.lang.Override + public boolean hasWriteObjectSpec() { + return firstMessageCase_ == 2; + } + /** + * + * + *
+   * For non-resumable uploads. Describes the overall upload, including the
+   * destination bucket and object name, preconditions, etc.
+   * 
+ * + * .google.storage.v2.WriteObjectSpec write_object_spec = 2; + * + * @return The writeObjectSpec. + */ + @java.lang.Override + public com.google.storage.v2.WriteObjectSpec getWriteObjectSpec() { + if (firstMessageCase_ == 2) { + return (com.google.storage.v2.WriteObjectSpec) firstMessage_; + } + return com.google.storage.v2.WriteObjectSpec.getDefaultInstance(); + } + /** + * + * + *
+   * For non-resumable uploads. Describes the overall upload, including the
+   * destination bucket and object name, preconditions, etc.
+   * 
+ * + * .google.storage.v2.WriteObjectSpec write_object_spec = 2; + */ + @java.lang.Override + public com.google.storage.v2.WriteObjectSpecOrBuilder getWriteObjectSpecOrBuilder() { + if (firstMessageCase_ == 2) { + return (com.google.storage.v2.WriteObjectSpec) firstMessage_; + } + return com.google.storage.v2.WriteObjectSpec.getDefaultInstance(); + } + + public static final int WRITE_OFFSET_FIELD_NUMBER = 3; + private long writeOffset_; + /** + * + * + *
+   * Required. The offset from the beginning of the object at which the data should be
+   * written.
+   * In the first `WriteObjectRequest` of a `WriteObject()` action, it
+   * indicates the initial offset for the `Write()` call. The value **must** be
+   * equal to the `committed_size` that a call to `QueryWriteStatus()` would
+   * return (0 if this is the first write to the object).
+   * On subsequent calls, this value **must** be no larger than the sum of the
+   * first `write_offset` and the sizes of all `data` chunks sent previously on
+   * this stream.
+   * An incorrect value will cause an error.
+   * 
+ * + * int64 write_offset = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The writeOffset. + */ + @java.lang.Override + public long getWriteOffset() { + return writeOffset_; + } + + public static final int CHECKSUMMED_DATA_FIELD_NUMBER = 4; + /** + * + * + *
+   * The data to insert. If a crc32c checksum is provided that doesn't match
+   * the checksum computed by the service, the request will fail.
+   * 
+ * + * .google.storage.v2.ChecksummedData checksummed_data = 4; + * + * @return Whether the checksummedData field is set. + */ + @java.lang.Override + public boolean hasChecksummedData() { + return dataCase_ == 4; + } + /** + * + * + *
+   * The data to insert. If a crc32c checksum is provided that doesn't match
+   * the checksum computed by the service, the request will fail.
+   * 
+ * + * .google.storage.v2.ChecksummedData checksummed_data = 4; + * + * @return The checksummedData. + */ + @java.lang.Override + public com.google.storage.v2.ChecksummedData getChecksummedData() { + if (dataCase_ == 4) { + return (com.google.storage.v2.ChecksummedData) data_; + } + return com.google.storage.v2.ChecksummedData.getDefaultInstance(); + } + /** + * + * + *
+   * The data to insert. If a crc32c checksum is provided that doesn't match
+   * the checksum computed by the service, the request will fail.
+   * 
+ * + * .google.storage.v2.ChecksummedData checksummed_data = 4; + */ + @java.lang.Override + public com.google.storage.v2.ChecksummedDataOrBuilder getChecksummedDataOrBuilder() { + if (dataCase_ == 4) { + return (com.google.storage.v2.ChecksummedData) data_; + } + return com.google.storage.v2.ChecksummedData.getDefaultInstance(); + } + + public static final int OBJECT_CHECKSUMS_FIELD_NUMBER = 6; + private com.google.storage.v2.ObjectChecksums objectChecksums_; + /** + * + * + *
+   * Checksums for the complete object. If the checksums computed by the service
+   * don't match the specifified checksums the call will fail. May only be
+   * provided in the first or last request (either with first_message, or
+   * finish_write set).
+   * 
+ * + * .google.storage.v2.ObjectChecksums object_checksums = 6; + * + * @return Whether the objectChecksums field is set. + */ + @java.lang.Override + public boolean hasObjectChecksums() { + return objectChecksums_ != null; + } + /** + * + * + *
+   * Checksums for the complete object. If the checksums computed by the service
+   * don't match the specifified checksums the call will fail. May only be
+   * provided in the first or last request (either with first_message, or
+   * finish_write set).
+   * 
+ * + * .google.storage.v2.ObjectChecksums object_checksums = 6; + * + * @return The objectChecksums. + */ + @java.lang.Override + public com.google.storage.v2.ObjectChecksums getObjectChecksums() { + return objectChecksums_ == null + ? com.google.storage.v2.ObjectChecksums.getDefaultInstance() + : objectChecksums_; + } + /** + * + * + *
+   * Checksums for the complete object. If the checksums computed by the service
+   * don't match the specifified checksums the call will fail. May only be
+   * provided in the first or last request (either with first_message, or
+   * finish_write set).
+   * 
+ * + * .google.storage.v2.ObjectChecksums object_checksums = 6; + */ + @java.lang.Override + public com.google.storage.v2.ObjectChecksumsOrBuilder getObjectChecksumsOrBuilder() { + return getObjectChecksums(); + } + + public static final int FINISH_WRITE_FIELD_NUMBER = 7; + private boolean finishWrite_; + /** + * + * + *
+   * If `true`, this indicates that the write is complete. Sending any
+   * `WriteObjectRequest`s subsequent to one in which `finish_write` is `true`
+   * will cause an error.
+   * For a non-resumable write (where the upload_id was not set in the first
+   * message), it is an error not to set this field in the final message of the
+   * stream.
+   * 
+ * + * bool finish_write = 7; + * + * @return The finishWrite. + */ + @java.lang.Override + public boolean getFinishWrite() { + return finishWrite_; + } + + public static final int COMMON_OBJECT_REQUEST_PARAMS_FIELD_NUMBER = 8; + private com.google.storage.v2.CommonObjectRequestParams commonObjectRequestParams_; + /** + * + * + *
+   * A set of parameters common to Storage API requests concerning an object.
+   * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; + * + * @return Whether the commonObjectRequestParams field is set. + */ + @java.lang.Override + public boolean hasCommonObjectRequestParams() { + return commonObjectRequestParams_ != null; + } + /** + * + * + *
+   * A set of parameters common to Storage API requests concerning an object.
+   * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; + * + * @return The commonObjectRequestParams. + */ + @java.lang.Override + public com.google.storage.v2.CommonObjectRequestParams getCommonObjectRequestParams() { + return commonObjectRequestParams_ == null + ? com.google.storage.v2.CommonObjectRequestParams.getDefaultInstance() + : commonObjectRequestParams_; + } + /** + * + * + *
+   * A set of parameters common to Storage API requests concerning an object.
+   * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; + */ + @java.lang.Override + public com.google.storage.v2.CommonObjectRequestParamsOrBuilder + getCommonObjectRequestParamsOrBuilder() { + return getCommonObjectRequestParams(); + } + + public static final int COMMON_REQUEST_PARAMS_FIELD_NUMBER = 9; + private com.google.storage.v2.CommonRequestParams commonRequestParams_; + /** + * + * + *
+   * A set of parameters common to all Storage API requests.
+   * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 9; + * + * @return Whether the commonRequestParams field is set. + */ + @java.lang.Override + public boolean hasCommonRequestParams() { + return commonRequestParams_ != null; + } + /** + * + * + *
+   * A set of parameters common to all Storage API requests.
+   * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 9; + * + * @return The commonRequestParams. + */ + @java.lang.Override + public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { + return commonRequestParams_ == null + ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() + : commonRequestParams_; + } + /** + * + * + *
+   * A set of parameters common to all Storage API requests.
+   * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 9; + */ + @java.lang.Override + public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { + return getCommonRequestParams(); + } + + 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 (firstMessageCase_ == 1) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, firstMessage_); + } + if (firstMessageCase_ == 2) { + output.writeMessage(2, (com.google.storage.v2.WriteObjectSpec) firstMessage_); + } + if (writeOffset_ != 0L) { + output.writeInt64(3, writeOffset_); + } + if (dataCase_ == 4) { + output.writeMessage(4, (com.google.storage.v2.ChecksummedData) data_); + } + if (objectChecksums_ != null) { + output.writeMessage(6, getObjectChecksums()); + } + if (finishWrite_ != false) { + output.writeBool(7, finishWrite_); + } + if (commonObjectRequestParams_ != null) { + output.writeMessage(8, getCommonObjectRequestParams()); + } + if (commonRequestParams_ != null) { + output.writeMessage(9, getCommonRequestParams()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (firstMessageCase_ == 1) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, firstMessage_); + } + if (firstMessageCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.storage.v2.WriteObjectSpec) firstMessage_); + } + if (writeOffset_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, writeOffset_); + } + if (dataCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.storage.v2.ChecksummedData) data_); + } + if (objectChecksums_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getObjectChecksums()); + } + if (finishWrite_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(7, finishWrite_); + } + if (commonObjectRequestParams_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 8, getCommonObjectRequestParams()); + } + if (commonRequestParams_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getCommonRequestParams()); + } + 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.WriteObjectRequest)) { + return super.equals(obj); + } + com.google.storage.v2.WriteObjectRequest other = (com.google.storage.v2.WriteObjectRequest) obj; + + if (getWriteOffset() != other.getWriteOffset()) return false; + if (hasObjectChecksums() != other.hasObjectChecksums()) return false; + if (hasObjectChecksums()) { + if (!getObjectChecksums().equals(other.getObjectChecksums())) return false; + } + if (getFinishWrite() != other.getFinishWrite()) return false; + if (hasCommonObjectRequestParams() != other.hasCommonObjectRequestParams()) return false; + if (hasCommonObjectRequestParams()) { + if (!getCommonObjectRequestParams().equals(other.getCommonObjectRequestParams())) + return false; + } + if (hasCommonRequestParams() != other.hasCommonRequestParams()) return false; + if (hasCommonRequestParams()) { + if (!getCommonRequestParams().equals(other.getCommonRequestParams())) return false; + } + if (!getFirstMessageCase().equals(other.getFirstMessageCase())) return false; + switch (firstMessageCase_) { + case 1: + if (!getUploadId().equals(other.getUploadId())) return false; + break; + case 2: + if (!getWriteObjectSpec().equals(other.getWriteObjectSpec())) return false; + break; + case 0: + default: + } + if (!getDataCase().equals(other.getDataCase())) return false; + switch (dataCase_) { + case 4: + if (!getChecksummedData().equals(other.getChecksummedData())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + WRITE_OFFSET_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getWriteOffset()); + if (hasObjectChecksums()) { + hash = (37 * hash) + OBJECT_CHECKSUMS_FIELD_NUMBER; + hash = (53 * hash) + getObjectChecksums().hashCode(); + } + hash = (37 * hash) + FINISH_WRITE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getFinishWrite()); + if (hasCommonObjectRequestParams()) { + hash = (37 * hash) + COMMON_OBJECT_REQUEST_PARAMS_FIELD_NUMBER; + hash = (53 * hash) + getCommonObjectRequestParams().hashCode(); + } + if (hasCommonRequestParams()) { + hash = (37 * hash) + COMMON_REQUEST_PARAMS_FIELD_NUMBER; + hash = (53 * hash) + getCommonRequestParams().hashCode(); + } + switch (firstMessageCase_) { + case 1: + hash = (37 * hash) + UPLOAD_ID_FIELD_NUMBER; + hash = (53 * hash) + getUploadId().hashCode(); + break; + case 2: + hash = (37 * hash) + WRITE_OBJECT_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getWriteObjectSpec().hashCode(); + break; + case 0: + default: + } + switch (dataCase_) { + case 4: + hash = (37 * hash) + CHECKSUMMED_DATA_FIELD_NUMBER; + hash = (53 * hash) + getChecksummedData().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.v2.WriteObjectRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.WriteObjectRequest 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.WriteObjectRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.WriteObjectRequest 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.WriteObjectRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.WriteObjectRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.WriteObjectRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.WriteObjectRequest 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.WriteObjectRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.v2.WriteObjectRequest 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.WriteObjectRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.WriteObjectRequest 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.WriteObjectRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for WriteObject.
+   * 
+ * + * Protobuf type {@code google.storage.v2.WriteObjectRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.WriteObjectRequest) + com.google.storage.v2.WriteObjectRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_WriteObjectRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_WriteObjectRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.WriteObjectRequest.class, + com.google.storage.v2.WriteObjectRequest.Builder.class); + } + + // Construct using com.google.storage.v2.WriteObjectRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + writeOffset_ = 0L; + + if (objectChecksumsBuilder_ == null) { + objectChecksums_ = null; + } else { + objectChecksums_ = null; + objectChecksumsBuilder_ = null; + } + finishWrite_ = false; + + if (commonObjectRequestParamsBuilder_ == null) { + commonObjectRequestParams_ = null; + } else { + commonObjectRequestParams_ = null; + commonObjectRequestParamsBuilder_ = null; + } + if (commonRequestParamsBuilder_ == null) { + commonRequestParams_ = null; + } else { + commonRequestParams_ = null; + commonRequestParamsBuilder_ = null; + } + firstMessageCase_ = 0; + firstMessage_ = null; + dataCase_ = 0; + data_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_WriteObjectRequest_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.WriteObjectRequest getDefaultInstanceForType() { + return com.google.storage.v2.WriteObjectRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.WriteObjectRequest build() { + com.google.storage.v2.WriteObjectRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.WriteObjectRequest buildPartial() { + com.google.storage.v2.WriteObjectRequest result = + new com.google.storage.v2.WriteObjectRequest(this); + if (firstMessageCase_ == 1) { + result.firstMessage_ = firstMessage_; + } + if (firstMessageCase_ == 2) { + if (writeObjectSpecBuilder_ == null) { + result.firstMessage_ = firstMessage_; + } else { + result.firstMessage_ = writeObjectSpecBuilder_.build(); + } + } + result.writeOffset_ = writeOffset_; + if (dataCase_ == 4) { + if (checksummedDataBuilder_ == null) { + result.data_ = data_; + } else { + result.data_ = checksummedDataBuilder_.build(); + } + } + if (objectChecksumsBuilder_ == null) { + result.objectChecksums_ = objectChecksums_; + } else { + result.objectChecksums_ = objectChecksumsBuilder_.build(); + } + result.finishWrite_ = finishWrite_; + if (commonObjectRequestParamsBuilder_ == null) { + result.commonObjectRequestParams_ = commonObjectRequestParams_; + } else { + result.commonObjectRequestParams_ = commonObjectRequestParamsBuilder_.build(); + } + if (commonRequestParamsBuilder_ == null) { + result.commonRequestParams_ = commonRequestParams_; + } else { + result.commonRequestParams_ = commonRequestParamsBuilder_.build(); + } + result.firstMessageCase_ = firstMessageCase_; + result.dataCase_ = dataCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.storage.v2.WriteObjectRequest) { + return mergeFrom((com.google.storage.v2.WriteObjectRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.WriteObjectRequest other) { + if (other == com.google.storage.v2.WriteObjectRequest.getDefaultInstance()) return this; + if (other.getWriteOffset() != 0L) { + setWriteOffset(other.getWriteOffset()); + } + if (other.hasObjectChecksums()) { + mergeObjectChecksums(other.getObjectChecksums()); + } + if (other.getFinishWrite() != false) { + setFinishWrite(other.getFinishWrite()); + } + if (other.hasCommonObjectRequestParams()) { + mergeCommonObjectRequestParams(other.getCommonObjectRequestParams()); + } + if (other.hasCommonRequestParams()) { + mergeCommonRequestParams(other.getCommonRequestParams()); + } + switch (other.getFirstMessageCase()) { + case UPLOAD_ID: + { + firstMessageCase_ = 1; + firstMessage_ = other.firstMessage_; + onChanged(); + break; + } + case WRITE_OBJECT_SPEC: + { + mergeWriteObjectSpec(other.getWriteObjectSpec()); + break; + } + case FIRSTMESSAGE_NOT_SET: + { + break; + } + } + switch (other.getDataCase()) { + case CHECKSUMMED_DATA: + { + mergeChecksummedData(other.getChecksummedData()); + break; + } + case DATA_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.storage.v2.WriteObjectRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.storage.v2.WriteObjectRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int firstMessageCase_ = 0; + private java.lang.Object firstMessage_; + + public FirstMessageCase getFirstMessageCase() { + return FirstMessageCase.forNumber(firstMessageCase_); + } + + public Builder clearFirstMessage() { + firstMessageCase_ = 0; + firstMessage_ = null; + onChanged(); + return this; + } + + private int dataCase_ = 0; + private java.lang.Object data_; + + public DataCase getDataCase() { + return DataCase.forNumber(dataCase_); + } + + public Builder clearData() { + dataCase_ = 0; + data_ = null; + onChanged(); + return this; + } + + /** + * + * + *
+     * For resumable uploads. This should be the `upload_id` returned from a
+     * call to `StartResumableWriteResponse`.
+     * 
+ * + * string upload_id = 1; + * + * @return Whether the uploadId field is set. + */ + @java.lang.Override + public boolean hasUploadId() { + return firstMessageCase_ == 1; + } + /** + * + * + *
+     * For resumable uploads. This should be the `upload_id` returned from a
+     * call to `StartResumableWriteResponse`.
+     * 
+ * + * string upload_id = 1; + * + * @return The uploadId. + */ + @java.lang.Override + public java.lang.String getUploadId() { + java.lang.Object ref = ""; + if (firstMessageCase_ == 1) { + ref = firstMessage_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (firstMessageCase_ == 1) { + firstMessage_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * For resumable uploads. This should be the `upload_id` returned from a
+     * call to `StartResumableWriteResponse`.
+     * 
+ * + * string upload_id = 1; + * + * @return The bytes for uploadId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUploadIdBytes() { + java.lang.Object ref = ""; + if (firstMessageCase_ == 1) { + ref = firstMessage_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (firstMessageCase_ == 1) { + firstMessage_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * For resumable uploads. This should be the `upload_id` returned from a
+     * call to `StartResumableWriteResponse`.
+     * 
+ * + * string upload_id = 1; + * + * @param value The uploadId to set. + * @return This builder for chaining. + */ + public Builder setUploadId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + firstMessageCase_ = 1; + firstMessage_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * For resumable uploads. This should be the `upload_id` returned from a
+     * call to `StartResumableWriteResponse`.
+     * 
+ * + * string upload_id = 1; + * + * @return This builder for chaining. + */ + public Builder clearUploadId() { + if (firstMessageCase_ == 1) { + firstMessageCase_ = 0; + firstMessage_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * For resumable uploads. This should be the `upload_id` returned from a
+     * call to `StartResumableWriteResponse`.
+     * 
+ * + * string upload_id = 1; + * + * @param value The bytes for uploadId to set. + * @return This builder for chaining. + */ + public Builder setUploadIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + firstMessageCase_ = 1; + firstMessage_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.WriteObjectSpec, + com.google.storage.v2.WriteObjectSpec.Builder, + com.google.storage.v2.WriteObjectSpecOrBuilder> + writeObjectSpecBuilder_; + /** + * + * + *
+     * For non-resumable uploads. Describes the overall upload, including the
+     * destination bucket and object name, preconditions, etc.
+     * 
+ * + * .google.storage.v2.WriteObjectSpec write_object_spec = 2; + * + * @return Whether the writeObjectSpec field is set. + */ + @java.lang.Override + public boolean hasWriteObjectSpec() { + return firstMessageCase_ == 2; + } + /** + * + * + *
+     * For non-resumable uploads. Describes the overall upload, including the
+     * destination bucket and object name, preconditions, etc.
+     * 
+ * + * .google.storage.v2.WriteObjectSpec write_object_spec = 2; + * + * @return The writeObjectSpec. + */ + @java.lang.Override + public com.google.storage.v2.WriteObjectSpec getWriteObjectSpec() { + if (writeObjectSpecBuilder_ == null) { + if (firstMessageCase_ == 2) { + return (com.google.storage.v2.WriteObjectSpec) firstMessage_; + } + return com.google.storage.v2.WriteObjectSpec.getDefaultInstance(); + } else { + if (firstMessageCase_ == 2) { + return writeObjectSpecBuilder_.getMessage(); + } + return com.google.storage.v2.WriteObjectSpec.getDefaultInstance(); + } + } + /** + * + * + *
+     * For non-resumable uploads. Describes the overall upload, including the
+     * destination bucket and object name, preconditions, etc.
+     * 
+ * + * .google.storage.v2.WriteObjectSpec write_object_spec = 2; + */ + public Builder setWriteObjectSpec(com.google.storage.v2.WriteObjectSpec value) { + if (writeObjectSpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + firstMessage_ = value; + onChanged(); + } else { + writeObjectSpecBuilder_.setMessage(value); + } + firstMessageCase_ = 2; + return this; + } + /** + * + * + *
+     * For non-resumable uploads. Describes the overall upload, including the
+     * destination bucket and object name, preconditions, etc.
+     * 
+ * + * .google.storage.v2.WriteObjectSpec write_object_spec = 2; + */ + public Builder setWriteObjectSpec( + com.google.storage.v2.WriteObjectSpec.Builder builderForValue) { + if (writeObjectSpecBuilder_ == null) { + firstMessage_ = builderForValue.build(); + onChanged(); + } else { + writeObjectSpecBuilder_.setMessage(builderForValue.build()); + } + firstMessageCase_ = 2; + return this; + } + /** + * + * + *
+     * For non-resumable uploads. Describes the overall upload, including the
+     * destination bucket and object name, preconditions, etc.
+     * 
+ * + * .google.storage.v2.WriteObjectSpec write_object_spec = 2; + */ + public Builder mergeWriteObjectSpec(com.google.storage.v2.WriteObjectSpec value) { + if (writeObjectSpecBuilder_ == null) { + if (firstMessageCase_ == 2 + && firstMessage_ != com.google.storage.v2.WriteObjectSpec.getDefaultInstance()) { + firstMessage_ = + com.google.storage.v2.WriteObjectSpec.newBuilder( + (com.google.storage.v2.WriteObjectSpec) firstMessage_) + .mergeFrom(value) + .buildPartial(); + } else { + firstMessage_ = value; + } + onChanged(); + } else { + if (firstMessageCase_ == 2) { + writeObjectSpecBuilder_.mergeFrom(value); + } + writeObjectSpecBuilder_.setMessage(value); + } + firstMessageCase_ = 2; + return this; + } + /** + * + * + *
+     * For non-resumable uploads. Describes the overall upload, including the
+     * destination bucket and object name, preconditions, etc.
+     * 
+ * + * .google.storage.v2.WriteObjectSpec write_object_spec = 2; + */ + public Builder clearWriteObjectSpec() { + if (writeObjectSpecBuilder_ == null) { + if (firstMessageCase_ == 2) { + firstMessageCase_ = 0; + firstMessage_ = null; + onChanged(); + } + } else { + if (firstMessageCase_ == 2) { + firstMessageCase_ = 0; + firstMessage_ = null; + } + writeObjectSpecBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * For non-resumable uploads. Describes the overall upload, including the
+     * destination bucket and object name, preconditions, etc.
+     * 
+ * + * .google.storage.v2.WriteObjectSpec write_object_spec = 2; + */ + public com.google.storage.v2.WriteObjectSpec.Builder getWriteObjectSpecBuilder() { + return getWriteObjectSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * For non-resumable uploads. Describes the overall upload, including the
+     * destination bucket and object name, preconditions, etc.
+     * 
+ * + * .google.storage.v2.WriteObjectSpec write_object_spec = 2; + */ + @java.lang.Override + public com.google.storage.v2.WriteObjectSpecOrBuilder getWriteObjectSpecOrBuilder() { + if ((firstMessageCase_ == 2) && (writeObjectSpecBuilder_ != null)) { + return writeObjectSpecBuilder_.getMessageOrBuilder(); + } else { + if (firstMessageCase_ == 2) { + return (com.google.storage.v2.WriteObjectSpec) firstMessage_; + } + return com.google.storage.v2.WriteObjectSpec.getDefaultInstance(); + } + } + /** + * + * + *
+     * For non-resumable uploads. Describes the overall upload, including the
+     * destination bucket and object name, preconditions, etc.
+     * 
+ * + * .google.storage.v2.WriteObjectSpec write_object_spec = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.WriteObjectSpec, + com.google.storage.v2.WriteObjectSpec.Builder, + com.google.storage.v2.WriteObjectSpecOrBuilder> + getWriteObjectSpecFieldBuilder() { + if (writeObjectSpecBuilder_ == null) { + if (!(firstMessageCase_ == 2)) { + firstMessage_ = com.google.storage.v2.WriteObjectSpec.getDefaultInstance(); + } + writeObjectSpecBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.WriteObjectSpec, + com.google.storage.v2.WriteObjectSpec.Builder, + com.google.storage.v2.WriteObjectSpecOrBuilder>( + (com.google.storage.v2.WriteObjectSpec) firstMessage_, + getParentForChildren(), + isClean()); + firstMessage_ = null; + } + firstMessageCase_ = 2; + onChanged(); + ; + return writeObjectSpecBuilder_; + } + + private long writeOffset_; + /** + * + * + *
+     * Required. The offset from the beginning of the object at which the data should be
+     * written.
+     * In the first `WriteObjectRequest` of a `WriteObject()` action, it
+     * indicates the initial offset for the `Write()` call. The value **must** be
+     * equal to the `committed_size` that a call to `QueryWriteStatus()` would
+     * return (0 if this is the first write to the object).
+     * On subsequent calls, this value **must** be no larger than the sum of the
+     * first `write_offset` and the sizes of all `data` chunks sent previously on
+     * this stream.
+     * An incorrect value will cause an error.
+     * 
+ * + * int64 write_offset = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The writeOffset. + */ + @java.lang.Override + public long getWriteOffset() { + return writeOffset_; + } + /** + * + * + *
+     * Required. The offset from the beginning of the object at which the data should be
+     * written.
+     * In the first `WriteObjectRequest` of a `WriteObject()` action, it
+     * indicates the initial offset for the `Write()` call. The value **must** be
+     * equal to the `committed_size` that a call to `QueryWriteStatus()` would
+     * return (0 if this is the first write to the object).
+     * On subsequent calls, this value **must** be no larger than the sum of the
+     * first `write_offset` and the sizes of all `data` chunks sent previously on
+     * this stream.
+     * An incorrect value will cause an error.
+     * 
+ * + * int64 write_offset = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The writeOffset to set. + * @return This builder for chaining. + */ + public Builder setWriteOffset(long value) { + + writeOffset_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The offset from the beginning of the object at which the data should be
+     * written.
+     * In the first `WriteObjectRequest` of a `WriteObject()` action, it
+     * indicates the initial offset for the `Write()` call. The value **must** be
+     * equal to the `committed_size` that a call to `QueryWriteStatus()` would
+     * return (0 if this is the first write to the object).
+     * On subsequent calls, this value **must** be no larger than the sum of the
+     * first `write_offset` and the sizes of all `data` chunks sent previously on
+     * this stream.
+     * An incorrect value will cause an error.
+     * 
+ * + * int64 write_offset = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearWriteOffset() { + + writeOffset_ = 0L; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.ChecksummedData, + com.google.storage.v2.ChecksummedData.Builder, + com.google.storage.v2.ChecksummedDataOrBuilder> + checksummedDataBuilder_; + /** + * + * + *
+     * The data to insert. If a crc32c checksum is provided that doesn't match
+     * the checksum computed by the service, the request will fail.
+     * 
+ * + * .google.storage.v2.ChecksummedData checksummed_data = 4; + * + * @return Whether the checksummedData field is set. + */ + @java.lang.Override + public boolean hasChecksummedData() { + return dataCase_ == 4; + } + /** + * + * + *
+     * The data to insert. If a crc32c checksum is provided that doesn't match
+     * the checksum computed by the service, the request will fail.
+     * 
+ * + * .google.storage.v2.ChecksummedData checksummed_data = 4; + * + * @return The checksummedData. + */ + @java.lang.Override + public com.google.storage.v2.ChecksummedData getChecksummedData() { + if (checksummedDataBuilder_ == null) { + if (dataCase_ == 4) { + return (com.google.storage.v2.ChecksummedData) data_; + } + return com.google.storage.v2.ChecksummedData.getDefaultInstance(); + } else { + if (dataCase_ == 4) { + return checksummedDataBuilder_.getMessage(); + } + return com.google.storage.v2.ChecksummedData.getDefaultInstance(); + } + } + /** + * + * + *
+     * The data to insert. If a crc32c checksum is provided that doesn't match
+     * the checksum computed by the service, the request will fail.
+     * 
+ * + * .google.storage.v2.ChecksummedData checksummed_data = 4; + */ + public Builder setChecksummedData(com.google.storage.v2.ChecksummedData value) { + if (checksummedDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + data_ = value; + onChanged(); + } else { + checksummedDataBuilder_.setMessage(value); + } + dataCase_ = 4; + return this; + } + /** + * + * + *
+     * The data to insert. If a crc32c checksum is provided that doesn't match
+     * the checksum computed by the service, the request will fail.
+     * 
+ * + * .google.storage.v2.ChecksummedData checksummed_data = 4; + */ + public Builder setChecksummedData( + com.google.storage.v2.ChecksummedData.Builder builderForValue) { + if (checksummedDataBuilder_ == null) { + data_ = builderForValue.build(); + onChanged(); + } else { + checksummedDataBuilder_.setMessage(builderForValue.build()); + } + dataCase_ = 4; + return this; + } + /** + * + * + *
+     * The data to insert. If a crc32c checksum is provided that doesn't match
+     * the checksum computed by the service, the request will fail.
+     * 
+ * + * .google.storage.v2.ChecksummedData checksummed_data = 4; + */ + public Builder mergeChecksummedData(com.google.storage.v2.ChecksummedData value) { + if (checksummedDataBuilder_ == null) { + if (dataCase_ == 4 && data_ != com.google.storage.v2.ChecksummedData.getDefaultInstance()) { + data_ = + com.google.storage.v2.ChecksummedData.newBuilder( + (com.google.storage.v2.ChecksummedData) data_) + .mergeFrom(value) + .buildPartial(); + } else { + data_ = value; + } + onChanged(); + } else { + if (dataCase_ == 4) { + checksummedDataBuilder_.mergeFrom(value); + } + checksummedDataBuilder_.setMessage(value); + } + dataCase_ = 4; + return this; + } + /** + * + * + *
+     * The data to insert. If a crc32c checksum is provided that doesn't match
+     * the checksum computed by the service, the request will fail.
+     * 
+ * + * .google.storage.v2.ChecksummedData checksummed_data = 4; + */ + public Builder clearChecksummedData() { + if (checksummedDataBuilder_ == null) { + if (dataCase_ == 4) { + dataCase_ = 0; + data_ = null; + onChanged(); + } + } else { + if (dataCase_ == 4) { + dataCase_ = 0; + data_ = null; + } + checksummedDataBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The data to insert. If a crc32c checksum is provided that doesn't match
+     * the checksum computed by the service, the request will fail.
+     * 
+ * + * .google.storage.v2.ChecksummedData checksummed_data = 4; + */ + public com.google.storage.v2.ChecksummedData.Builder getChecksummedDataBuilder() { + return getChecksummedDataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The data to insert. If a crc32c checksum is provided that doesn't match
+     * the checksum computed by the service, the request will fail.
+     * 
+ * + * .google.storage.v2.ChecksummedData checksummed_data = 4; + */ + @java.lang.Override + public com.google.storage.v2.ChecksummedDataOrBuilder getChecksummedDataOrBuilder() { + if ((dataCase_ == 4) && (checksummedDataBuilder_ != null)) { + return checksummedDataBuilder_.getMessageOrBuilder(); + } else { + if (dataCase_ == 4) { + return (com.google.storage.v2.ChecksummedData) data_; + } + return com.google.storage.v2.ChecksummedData.getDefaultInstance(); + } + } + /** + * + * + *
+     * The data to insert. If a crc32c checksum is provided that doesn't match
+     * the checksum computed by the service, the request will fail.
+     * 
+ * + * .google.storage.v2.ChecksummedData checksummed_data = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.ChecksummedData, + com.google.storage.v2.ChecksummedData.Builder, + com.google.storage.v2.ChecksummedDataOrBuilder> + getChecksummedDataFieldBuilder() { + if (checksummedDataBuilder_ == null) { + if (!(dataCase_ == 4)) { + data_ = com.google.storage.v2.ChecksummedData.getDefaultInstance(); + } + checksummedDataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.ChecksummedData, + com.google.storage.v2.ChecksummedData.Builder, + com.google.storage.v2.ChecksummedDataOrBuilder>( + (com.google.storage.v2.ChecksummedData) data_, getParentForChildren(), isClean()); + data_ = null; + } + dataCase_ = 4; + onChanged(); + ; + return checksummedDataBuilder_; + } + + private com.google.storage.v2.ObjectChecksums objectChecksums_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.ObjectChecksums, + com.google.storage.v2.ObjectChecksums.Builder, + com.google.storage.v2.ObjectChecksumsOrBuilder> + objectChecksumsBuilder_; + /** + * + * + *
+     * Checksums for the complete object. If the checksums computed by the service
+     * don't match the specifified checksums the call will fail. May only be
+     * provided in the first or last request (either with first_message, or
+     * finish_write set).
+     * 
+ * + * .google.storage.v2.ObjectChecksums object_checksums = 6; + * + * @return Whether the objectChecksums field is set. + */ + public boolean hasObjectChecksums() { + return objectChecksumsBuilder_ != null || objectChecksums_ != null; + } + /** + * + * + *
+     * Checksums for the complete object. If the checksums computed by the service
+     * don't match the specifified checksums the call will fail. May only be
+     * provided in the first or last request (either with first_message, or
+     * finish_write set).
+     * 
+ * + * .google.storage.v2.ObjectChecksums object_checksums = 6; + * + * @return The objectChecksums. + */ + public com.google.storage.v2.ObjectChecksums getObjectChecksums() { + if (objectChecksumsBuilder_ == null) { + return objectChecksums_ == null + ? com.google.storage.v2.ObjectChecksums.getDefaultInstance() + : objectChecksums_; + } else { + return objectChecksumsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Checksums for the complete object. If the checksums computed by the service
+     * don't match the specifified checksums the call will fail. May only be
+     * provided in the first or last request (either with first_message, or
+     * finish_write set).
+     * 
+ * + * .google.storage.v2.ObjectChecksums object_checksums = 6; + */ + public Builder setObjectChecksums(com.google.storage.v2.ObjectChecksums value) { + if (objectChecksumsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + objectChecksums_ = value; + onChanged(); + } else { + objectChecksumsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Checksums for the complete object. If the checksums computed by the service
+     * don't match the specifified checksums the call will fail. May only be
+     * provided in the first or last request (either with first_message, or
+     * finish_write set).
+     * 
+ * + * .google.storage.v2.ObjectChecksums object_checksums = 6; + */ + public Builder setObjectChecksums( + com.google.storage.v2.ObjectChecksums.Builder builderForValue) { + if (objectChecksumsBuilder_ == null) { + objectChecksums_ = builderForValue.build(); + onChanged(); + } else { + objectChecksumsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Checksums for the complete object. If the checksums computed by the service
+     * don't match the specifified checksums the call will fail. May only be
+     * provided in the first or last request (either with first_message, or
+     * finish_write set).
+     * 
+ * + * .google.storage.v2.ObjectChecksums object_checksums = 6; + */ + public Builder mergeObjectChecksums(com.google.storage.v2.ObjectChecksums value) { + if (objectChecksumsBuilder_ == null) { + if (objectChecksums_ != null) { + objectChecksums_ = + com.google.storage.v2.ObjectChecksums.newBuilder(objectChecksums_) + .mergeFrom(value) + .buildPartial(); + } else { + objectChecksums_ = value; + } + onChanged(); + } else { + objectChecksumsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Checksums for the complete object. If the checksums computed by the service
+     * don't match the specifified checksums the call will fail. May only be
+     * provided in the first or last request (either with first_message, or
+     * finish_write set).
+     * 
+ * + * .google.storage.v2.ObjectChecksums object_checksums = 6; + */ + public Builder clearObjectChecksums() { + if (objectChecksumsBuilder_ == null) { + objectChecksums_ = null; + onChanged(); + } else { + objectChecksums_ = null; + objectChecksumsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Checksums for the complete object. If the checksums computed by the service
+     * don't match the specifified checksums the call will fail. May only be
+     * provided in the first or last request (either with first_message, or
+     * finish_write set).
+     * 
+ * + * .google.storage.v2.ObjectChecksums object_checksums = 6; + */ + public com.google.storage.v2.ObjectChecksums.Builder getObjectChecksumsBuilder() { + + onChanged(); + return getObjectChecksumsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Checksums for the complete object. If the checksums computed by the service
+     * don't match the specifified checksums the call will fail. May only be
+     * provided in the first or last request (either with first_message, or
+     * finish_write set).
+     * 
+ * + * .google.storage.v2.ObjectChecksums object_checksums = 6; + */ + public com.google.storage.v2.ObjectChecksumsOrBuilder getObjectChecksumsOrBuilder() { + if (objectChecksumsBuilder_ != null) { + return objectChecksumsBuilder_.getMessageOrBuilder(); + } else { + return objectChecksums_ == null + ? com.google.storage.v2.ObjectChecksums.getDefaultInstance() + : objectChecksums_; + } + } + /** + * + * + *
+     * Checksums for the complete object. If the checksums computed by the service
+     * don't match the specifified checksums the call will fail. May only be
+     * provided in the first or last request (either with first_message, or
+     * finish_write set).
+     * 
+ * + * .google.storage.v2.ObjectChecksums object_checksums = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.ObjectChecksums, + com.google.storage.v2.ObjectChecksums.Builder, + com.google.storage.v2.ObjectChecksumsOrBuilder> + getObjectChecksumsFieldBuilder() { + if (objectChecksumsBuilder_ == null) { + objectChecksumsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.ObjectChecksums, + com.google.storage.v2.ObjectChecksums.Builder, + com.google.storage.v2.ObjectChecksumsOrBuilder>( + getObjectChecksums(), getParentForChildren(), isClean()); + objectChecksums_ = null; + } + return objectChecksumsBuilder_; + } + + private boolean finishWrite_; + /** + * + * + *
+     * If `true`, this indicates that the write is complete. Sending any
+     * `WriteObjectRequest`s subsequent to one in which `finish_write` is `true`
+     * will cause an error.
+     * For a non-resumable write (where the upload_id was not set in the first
+     * message), it is an error not to set this field in the final message of the
+     * stream.
+     * 
+ * + * bool finish_write = 7; + * + * @return The finishWrite. + */ + @java.lang.Override + public boolean getFinishWrite() { + return finishWrite_; + } + /** + * + * + *
+     * If `true`, this indicates that the write is complete. Sending any
+     * `WriteObjectRequest`s subsequent to one in which `finish_write` is `true`
+     * will cause an error.
+     * For a non-resumable write (where the upload_id was not set in the first
+     * message), it is an error not to set this field in the final message of the
+     * stream.
+     * 
+ * + * bool finish_write = 7; + * + * @param value The finishWrite to set. + * @return This builder for chaining. + */ + public Builder setFinishWrite(boolean value) { + + finishWrite_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If `true`, this indicates that the write is complete. Sending any
+     * `WriteObjectRequest`s subsequent to one in which `finish_write` is `true`
+     * will cause an error.
+     * For a non-resumable write (where the upload_id was not set in the first
+     * message), it is an error not to set this field in the final message of the
+     * stream.
+     * 
+ * + * bool finish_write = 7; + * + * @return This builder for chaining. + */ + public Builder clearFinishWrite() { + + finishWrite_ = false; + onChanged(); + return this; + } + + private com.google.storage.v2.CommonObjectRequestParams commonObjectRequestParams_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.CommonObjectRequestParams, + com.google.storage.v2.CommonObjectRequestParams.Builder, + com.google.storage.v2.CommonObjectRequestParamsOrBuilder> + commonObjectRequestParamsBuilder_; + /** + * + * + *
+     * A set of parameters common to Storage API requests concerning an object.
+     * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; + * + * @return Whether the commonObjectRequestParams field is set. + */ + public boolean hasCommonObjectRequestParams() { + return commonObjectRequestParamsBuilder_ != null || commonObjectRequestParams_ != null; + } + /** + * + * + *
+     * A set of parameters common to Storage API requests concerning an object.
+     * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; + * + * @return The commonObjectRequestParams. + */ + public com.google.storage.v2.CommonObjectRequestParams getCommonObjectRequestParams() { + if (commonObjectRequestParamsBuilder_ == null) { + return commonObjectRequestParams_ == null + ? com.google.storage.v2.CommonObjectRequestParams.getDefaultInstance() + : commonObjectRequestParams_; + } else { + return commonObjectRequestParamsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * A set of parameters common to Storage API requests concerning an object.
+     * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; + */ + public Builder setCommonObjectRequestParams( + com.google.storage.v2.CommonObjectRequestParams value) { + if (commonObjectRequestParamsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + commonObjectRequestParams_ = value; + onChanged(); + } else { + commonObjectRequestParamsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * A set of parameters common to Storage API requests concerning an object.
+     * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; + */ + public Builder setCommonObjectRequestParams( + com.google.storage.v2.CommonObjectRequestParams.Builder builderForValue) { + if (commonObjectRequestParamsBuilder_ == null) { + commonObjectRequestParams_ = builderForValue.build(); + onChanged(); + } else { + commonObjectRequestParamsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * A set of parameters common to Storage API requests concerning an object.
+     * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; + */ + public Builder mergeCommonObjectRequestParams( + com.google.storage.v2.CommonObjectRequestParams value) { + if (commonObjectRequestParamsBuilder_ == null) { + if (commonObjectRequestParams_ != null) { + commonObjectRequestParams_ = + com.google.storage.v2.CommonObjectRequestParams.newBuilder(commonObjectRequestParams_) + .mergeFrom(value) + .buildPartial(); + } else { + commonObjectRequestParams_ = value; + } + onChanged(); + } else { + commonObjectRequestParamsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * A set of parameters common to Storage API requests concerning an object.
+     * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; + */ + public Builder clearCommonObjectRequestParams() { + if (commonObjectRequestParamsBuilder_ == null) { + commonObjectRequestParams_ = null; + onChanged(); + } else { + commonObjectRequestParams_ = null; + commonObjectRequestParamsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * A set of parameters common to Storage API requests concerning an object.
+     * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; + */ + public com.google.storage.v2.CommonObjectRequestParams.Builder + getCommonObjectRequestParamsBuilder() { + + onChanged(); + return getCommonObjectRequestParamsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A set of parameters common to Storage API requests concerning an object.
+     * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; + */ + public com.google.storage.v2.CommonObjectRequestParamsOrBuilder + getCommonObjectRequestParamsOrBuilder() { + if (commonObjectRequestParamsBuilder_ != null) { + return commonObjectRequestParamsBuilder_.getMessageOrBuilder(); + } else { + return commonObjectRequestParams_ == null + ? com.google.storage.v2.CommonObjectRequestParams.getDefaultInstance() + : commonObjectRequestParams_; + } + } + /** + * + * + *
+     * A set of parameters common to Storage API requests concerning an object.
+     * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.CommonObjectRequestParams, + com.google.storage.v2.CommonObjectRequestParams.Builder, + com.google.storage.v2.CommonObjectRequestParamsOrBuilder> + getCommonObjectRequestParamsFieldBuilder() { + if (commonObjectRequestParamsBuilder_ == null) { + commonObjectRequestParamsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.CommonObjectRequestParams, + com.google.storage.v2.CommonObjectRequestParams.Builder, + com.google.storage.v2.CommonObjectRequestParamsOrBuilder>( + getCommonObjectRequestParams(), getParentForChildren(), isClean()); + commonObjectRequestParams_ = null; + } + return commonObjectRequestParamsBuilder_; + } + + private com.google.storage.v2.CommonRequestParams commonRequestParams_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.CommonRequestParams, + com.google.storage.v2.CommonRequestParams.Builder, + com.google.storage.v2.CommonRequestParamsOrBuilder> + commonRequestParamsBuilder_; + /** + * + * + *
+     * A set of parameters common to all Storage API requests.
+     * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 9; + * + * @return Whether the commonRequestParams field is set. + */ + public boolean hasCommonRequestParams() { + return commonRequestParamsBuilder_ != null || commonRequestParams_ != null; + } + /** + * + * + *
+     * A set of parameters common to all Storage API requests.
+     * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 9; + * + * @return The commonRequestParams. + */ + public com.google.storage.v2.CommonRequestParams getCommonRequestParams() { + if (commonRequestParamsBuilder_ == null) { + return commonRequestParams_ == null + ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() + : commonRequestParams_; + } else { + return commonRequestParamsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * A set of parameters common to all Storage API requests.
+     * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 9; + */ + public Builder setCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { + if (commonRequestParamsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + commonRequestParams_ = value; + onChanged(); + } else { + commonRequestParamsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * A set of parameters common to all Storage API requests.
+     * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 9; + */ + public Builder setCommonRequestParams( + com.google.storage.v2.CommonRequestParams.Builder builderForValue) { + if (commonRequestParamsBuilder_ == null) { + commonRequestParams_ = builderForValue.build(); + onChanged(); + } else { + commonRequestParamsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * A set of parameters common to all Storage API requests.
+     * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 9; + */ + public Builder mergeCommonRequestParams(com.google.storage.v2.CommonRequestParams value) { + if (commonRequestParamsBuilder_ == null) { + if (commonRequestParams_ != null) { + commonRequestParams_ = + com.google.storage.v2.CommonRequestParams.newBuilder(commonRequestParams_) + .mergeFrom(value) + .buildPartial(); + } else { + commonRequestParams_ = value; + } + onChanged(); + } else { + commonRequestParamsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * A set of parameters common to all Storage API requests.
+     * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 9; + */ + public Builder clearCommonRequestParams() { + if (commonRequestParamsBuilder_ == null) { + commonRequestParams_ = null; + onChanged(); + } else { + commonRequestParams_ = null; + commonRequestParamsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * A set of parameters common to all Storage API requests.
+     * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 9; + */ + public com.google.storage.v2.CommonRequestParams.Builder getCommonRequestParamsBuilder() { + + onChanged(); + return getCommonRequestParamsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A set of parameters common to all Storage API requests.
+     * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 9; + */ + public com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder() { + if (commonRequestParamsBuilder_ != null) { + return commonRequestParamsBuilder_.getMessageOrBuilder(); + } else { + return commonRequestParams_ == null + ? com.google.storage.v2.CommonRequestParams.getDefaultInstance() + : commonRequestParams_; + } + } + /** + * + * + *
+     * A set of parameters common to all Storage API requests.
+     * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.CommonRequestParams, + com.google.storage.v2.CommonRequestParams.Builder, + com.google.storage.v2.CommonRequestParamsOrBuilder> + getCommonRequestParamsFieldBuilder() { + if (commonRequestParamsBuilder_ == null) { + commonRequestParamsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.CommonRequestParams, + com.google.storage.v2.CommonRequestParams.Builder, + com.google.storage.v2.CommonRequestParamsOrBuilder>( + getCommonRequestParams(), getParentForChildren(), isClean()); + commonRequestParams_ = null; + } + return commonRequestParamsBuilder_; + } + + @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.WriteObjectRequest) + } + + // @@protoc_insertion_point(class_scope:google.storage.v2.WriteObjectRequest) + private static final com.google.storage.v2.WriteObjectRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.v2.WriteObjectRequest(); + } + + public static com.google.storage.v2.WriteObjectRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WriteObjectRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new WriteObjectRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.storage.v2.WriteObjectRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectRequestOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectRequestOrBuilder.java new file mode 100644 index 0000000000..2e787f95c5 --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectRequestOrBuilder.java @@ -0,0 +1,299 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +package com.google.storage.v2; + +public interface WriteObjectRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.WriteObjectRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * For resumable uploads. This should be the `upload_id` returned from a
+   * call to `StartResumableWriteResponse`.
+   * 
+ * + * string upload_id = 1; + * + * @return Whether the uploadId field is set. + */ + boolean hasUploadId(); + /** + * + * + *
+   * For resumable uploads. This should be the `upload_id` returned from a
+   * call to `StartResumableWriteResponse`.
+   * 
+ * + * string upload_id = 1; + * + * @return The uploadId. + */ + java.lang.String getUploadId(); + /** + * + * + *
+   * For resumable uploads. This should be the `upload_id` returned from a
+   * call to `StartResumableWriteResponse`.
+   * 
+ * + * string upload_id = 1; + * + * @return The bytes for uploadId. + */ + com.google.protobuf.ByteString getUploadIdBytes(); + + /** + * + * + *
+   * For non-resumable uploads. Describes the overall upload, including the
+   * destination bucket and object name, preconditions, etc.
+   * 
+ * + * .google.storage.v2.WriteObjectSpec write_object_spec = 2; + * + * @return Whether the writeObjectSpec field is set. + */ + boolean hasWriteObjectSpec(); + /** + * + * + *
+   * For non-resumable uploads. Describes the overall upload, including the
+   * destination bucket and object name, preconditions, etc.
+   * 
+ * + * .google.storage.v2.WriteObjectSpec write_object_spec = 2; + * + * @return The writeObjectSpec. + */ + com.google.storage.v2.WriteObjectSpec getWriteObjectSpec(); + /** + * + * + *
+   * For non-resumable uploads. Describes the overall upload, including the
+   * destination bucket and object name, preconditions, etc.
+   * 
+ * + * .google.storage.v2.WriteObjectSpec write_object_spec = 2; + */ + com.google.storage.v2.WriteObjectSpecOrBuilder getWriteObjectSpecOrBuilder(); + + /** + * + * + *
+   * Required. The offset from the beginning of the object at which the data should be
+   * written.
+   * In the first `WriteObjectRequest` of a `WriteObject()` action, it
+   * indicates the initial offset for the `Write()` call. The value **must** be
+   * equal to the `committed_size` that a call to `QueryWriteStatus()` would
+   * return (0 if this is the first write to the object).
+   * On subsequent calls, this value **must** be no larger than the sum of the
+   * first `write_offset` and the sizes of all `data` chunks sent previously on
+   * this stream.
+   * An incorrect value will cause an error.
+   * 
+ * + * int64 write_offset = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The writeOffset. + */ + long getWriteOffset(); + + /** + * + * + *
+   * The data to insert. If a crc32c checksum is provided that doesn't match
+   * the checksum computed by the service, the request will fail.
+   * 
+ * + * .google.storage.v2.ChecksummedData checksummed_data = 4; + * + * @return Whether the checksummedData field is set. + */ + boolean hasChecksummedData(); + /** + * + * + *
+   * The data to insert. If a crc32c checksum is provided that doesn't match
+   * the checksum computed by the service, the request will fail.
+   * 
+ * + * .google.storage.v2.ChecksummedData checksummed_data = 4; + * + * @return The checksummedData. + */ + com.google.storage.v2.ChecksummedData getChecksummedData(); + /** + * + * + *
+   * The data to insert. If a crc32c checksum is provided that doesn't match
+   * the checksum computed by the service, the request will fail.
+   * 
+ * + * .google.storage.v2.ChecksummedData checksummed_data = 4; + */ + com.google.storage.v2.ChecksummedDataOrBuilder getChecksummedDataOrBuilder(); + + /** + * + * + *
+   * Checksums for the complete object. If the checksums computed by the service
+   * don't match the specifified checksums the call will fail. May only be
+   * provided in the first or last request (either with first_message, or
+   * finish_write set).
+   * 
+ * + * .google.storage.v2.ObjectChecksums object_checksums = 6; + * + * @return Whether the objectChecksums field is set. + */ + boolean hasObjectChecksums(); + /** + * + * + *
+   * Checksums for the complete object. If the checksums computed by the service
+   * don't match the specifified checksums the call will fail. May only be
+   * provided in the first or last request (either with first_message, or
+   * finish_write set).
+   * 
+ * + * .google.storage.v2.ObjectChecksums object_checksums = 6; + * + * @return The objectChecksums. + */ + com.google.storage.v2.ObjectChecksums getObjectChecksums(); + /** + * + * + *
+   * Checksums for the complete object. If the checksums computed by the service
+   * don't match the specifified checksums the call will fail. May only be
+   * provided in the first or last request (either with first_message, or
+   * finish_write set).
+   * 
+ * + * .google.storage.v2.ObjectChecksums object_checksums = 6; + */ + com.google.storage.v2.ObjectChecksumsOrBuilder getObjectChecksumsOrBuilder(); + + /** + * + * + *
+   * If `true`, this indicates that the write is complete. Sending any
+   * `WriteObjectRequest`s subsequent to one in which `finish_write` is `true`
+   * will cause an error.
+   * For a non-resumable write (where the upload_id was not set in the first
+   * message), it is an error not to set this field in the final message of the
+   * stream.
+   * 
+ * + * bool finish_write = 7; + * + * @return The finishWrite. + */ + boolean getFinishWrite(); + + /** + * + * + *
+   * A set of parameters common to Storage API requests concerning an object.
+   * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; + * + * @return Whether the commonObjectRequestParams field is set. + */ + boolean hasCommonObjectRequestParams(); + /** + * + * + *
+   * A set of parameters common to Storage API requests concerning an object.
+   * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; + * + * @return The commonObjectRequestParams. + */ + com.google.storage.v2.CommonObjectRequestParams getCommonObjectRequestParams(); + /** + * + * + *
+   * A set of parameters common to Storage API requests concerning an object.
+   * 
+ * + * .google.storage.v2.CommonObjectRequestParams common_object_request_params = 8; + */ + com.google.storage.v2.CommonObjectRequestParamsOrBuilder getCommonObjectRequestParamsOrBuilder(); + + /** + * + * + *
+   * A set of parameters common to all Storage API requests.
+   * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 9; + * + * @return Whether the commonRequestParams field is set. + */ + boolean hasCommonRequestParams(); + /** + * + * + *
+   * A set of parameters common to all Storage API requests.
+   * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 9; + * + * @return The commonRequestParams. + */ + com.google.storage.v2.CommonRequestParams getCommonRequestParams(); + /** + * + * + *
+   * A set of parameters common to all Storage API requests.
+   * 
+ * + * .google.storage.v2.CommonRequestParams common_request_params = 9; + */ + com.google.storage.v2.CommonRequestParamsOrBuilder getCommonRequestParamsOrBuilder(); + + public com.google.storage.v2.WriteObjectRequest.FirstMessageCase getFirstMessageCase(); + + public com.google.storage.v2.WriteObjectRequest.DataCase getDataCase(); +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectResponse.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectResponse.java new file mode 100644 index 0000000000..4c3b8c4cfb --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectResponse.java @@ -0,0 +1,982 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +package com.google.storage.v2; + +/** + * + * + *
+ * Response message for WriteObject.
+ * 
+ * + * Protobuf type {@code google.storage.v2.WriteObjectResponse} + */ +public final class WriteObjectResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.v2.WriteObjectResponse) + WriteObjectResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use WriteObjectResponse.newBuilder() to construct. + private WriteObjectResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private WriteObjectResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new WriteObjectResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private WriteObjectResponse( + 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: + { + writeStatusCase_ = 1; + writeStatus_ = input.readInt64(); + break; + } + case 18: + { + com.google.storage.v2.Object.Builder subBuilder = null; + if (writeStatusCase_ == 2) { + subBuilder = ((com.google.storage.v2.Object) writeStatus_).toBuilder(); + } + writeStatus_ = + input.readMessage(com.google.storage.v2.Object.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.storage.v2.Object) writeStatus_); + writeStatus_ = subBuilder.buildPartial(); + } + writeStatusCase_ = 2; + 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_WriteObjectResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_WriteObjectResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.WriteObjectResponse.class, + com.google.storage.v2.WriteObjectResponse.Builder.class); + } + + private int writeStatusCase_ = 0; + private java.lang.Object writeStatus_; + + public enum WriteStatusCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + COMMITTED_SIZE(1), + RESOURCE(2), + WRITESTATUS_NOT_SET(0); + private final int value; + + private WriteStatusCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static WriteStatusCase valueOf(int value) { + return forNumber(value); + } + + public static WriteStatusCase forNumber(int value) { + switch (value) { + case 1: + return COMMITTED_SIZE; + case 2: + return RESOURCE; + case 0: + return WRITESTATUS_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public WriteStatusCase getWriteStatusCase() { + return WriteStatusCase.forNumber(writeStatusCase_); + } + + public static final int COMMITTED_SIZE_FIELD_NUMBER = 1; + /** + * + * + *
+   * The total number of bytes that have been processed for the given object
+   * from all `WriteObject` calls. Only set if the upload has not finalized.
+   * 
+ * + * int64 committed_size = 1; + * + * @return Whether the committedSize field is set. + */ + @java.lang.Override + public boolean hasCommittedSize() { + return writeStatusCase_ == 1; + } + /** + * + * + *
+   * The total number of bytes that have been processed for the given object
+   * from all `WriteObject` calls. Only set if the upload has not finalized.
+   * 
+ * + * int64 committed_size = 1; + * + * @return The committedSize. + */ + @java.lang.Override + public long getCommittedSize() { + if (writeStatusCase_ == 1) { + return (java.lang.Long) writeStatus_; + } + return 0L; + } + + public static final int RESOURCE_FIELD_NUMBER = 2; + /** + * + * + *
+   * A resource containing the metadata for the uploaded object. Only set if
+   * the upload has finalized.
+   * 
+ * + * .google.storage.v2.Object resource = 2; + * + * @return Whether the resource field is set. + */ + @java.lang.Override + public boolean hasResource() { + return writeStatusCase_ == 2; + } + /** + * + * + *
+   * A resource containing the metadata for the uploaded object. Only set if
+   * the upload has finalized.
+   * 
+ * + * .google.storage.v2.Object resource = 2; + * + * @return The resource. + */ + @java.lang.Override + public com.google.storage.v2.Object getResource() { + if (writeStatusCase_ == 2) { + return (com.google.storage.v2.Object) writeStatus_; + } + return com.google.storage.v2.Object.getDefaultInstance(); + } + /** + * + * + *
+   * A resource containing the metadata for the uploaded object. Only set if
+   * the upload has finalized.
+   * 
+ * + * .google.storage.v2.Object resource = 2; + */ + @java.lang.Override + public com.google.storage.v2.ObjectOrBuilder getResourceOrBuilder() { + if (writeStatusCase_ == 2) { + return (com.google.storage.v2.Object) writeStatus_; + } + return com.google.storage.v2.Object.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (writeStatusCase_ == 1) { + output.writeInt64(1, (long) ((java.lang.Long) writeStatus_)); + } + if (writeStatusCase_ == 2) { + output.writeMessage(2, (com.google.storage.v2.Object) writeStatus_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (writeStatusCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeInt64Size( + 1, (long) ((java.lang.Long) writeStatus_)); + } + if (writeStatusCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.storage.v2.Object) writeStatus_); + } + 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.WriteObjectResponse)) { + return super.equals(obj); + } + com.google.storage.v2.WriteObjectResponse other = + (com.google.storage.v2.WriteObjectResponse) obj; + + if (!getWriteStatusCase().equals(other.getWriteStatusCase())) return false; + switch (writeStatusCase_) { + case 1: + if (getCommittedSize() != other.getCommittedSize()) return false; + break; + case 2: + if (!getResource().equals(other.getResource())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (writeStatusCase_) { + case 1: + hash = (37 * hash) + COMMITTED_SIZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getCommittedSize()); + break; + case 2: + hash = (37 * hash) + RESOURCE_FIELD_NUMBER; + hash = (53 * hash) + getResource().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.v2.WriteObjectResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.WriteObjectResponse 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.WriteObjectResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.WriteObjectResponse 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.WriteObjectResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.WriteObjectResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.WriteObjectResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.WriteObjectResponse 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.WriteObjectResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.v2.WriteObjectResponse 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.WriteObjectResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.WriteObjectResponse 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.WriteObjectResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for WriteObject.
+   * 
+ * + * Protobuf type {@code google.storage.v2.WriteObjectResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.WriteObjectResponse) + com.google.storage.v2.WriteObjectResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_WriteObjectResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_WriteObjectResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.WriteObjectResponse.class, + com.google.storage.v2.WriteObjectResponse.Builder.class); + } + + // Construct using com.google.storage.v2.WriteObjectResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + writeStatusCase_ = 0; + writeStatus_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_WriteObjectResponse_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.WriteObjectResponse getDefaultInstanceForType() { + return com.google.storage.v2.WriteObjectResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.WriteObjectResponse build() { + com.google.storage.v2.WriteObjectResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.WriteObjectResponse buildPartial() { + com.google.storage.v2.WriteObjectResponse result = + new com.google.storage.v2.WriteObjectResponse(this); + if (writeStatusCase_ == 1) { + result.writeStatus_ = writeStatus_; + } + if (writeStatusCase_ == 2) { + if (resourceBuilder_ == null) { + result.writeStatus_ = writeStatus_; + } else { + result.writeStatus_ = resourceBuilder_.build(); + } + } + result.writeStatusCase_ = writeStatusCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.storage.v2.WriteObjectResponse) { + return mergeFrom((com.google.storage.v2.WriteObjectResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.WriteObjectResponse other) { + if (other == com.google.storage.v2.WriteObjectResponse.getDefaultInstance()) return this; + switch (other.getWriteStatusCase()) { + case COMMITTED_SIZE: + { + setCommittedSize(other.getCommittedSize()); + break; + } + case RESOURCE: + { + mergeResource(other.getResource()); + break; + } + case WRITESTATUS_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.storage.v2.WriteObjectResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.storage.v2.WriteObjectResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int writeStatusCase_ = 0; + private java.lang.Object writeStatus_; + + public WriteStatusCase getWriteStatusCase() { + return WriteStatusCase.forNumber(writeStatusCase_); + } + + public Builder clearWriteStatus() { + writeStatusCase_ = 0; + writeStatus_ = null; + onChanged(); + return this; + } + + /** + * + * + *
+     * The total number of bytes that have been processed for the given object
+     * from all `WriteObject` calls. Only set if the upload has not finalized.
+     * 
+ * + * int64 committed_size = 1; + * + * @return Whether the committedSize field is set. + */ + public boolean hasCommittedSize() { + return writeStatusCase_ == 1; + } + /** + * + * + *
+     * The total number of bytes that have been processed for the given object
+     * from all `WriteObject` calls. Only set if the upload has not finalized.
+     * 
+ * + * int64 committed_size = 1; + * + * @return The committedSize. + */ + public long getCommittedSize() { + if (writeStatusCase_ == 1) { + return (java.lang.Long) writeStatus_; + } + return 0L; + } + /** + * + * + *
+     * The total number of bytes that have been processed for the given object
+     * from all `WriteObject` calls. Only set if the upload has not finalized.
+     * 
+ * + * int64 committed_size = 1; + * + * @param value The committedSize to set. + * @return This builder for chaining. + */ + public Builder setCommittedSize(long value) { + writeStatusCase_ = 1; + writeStatus_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The total number of bytes that have been processed for the given object
+     * from all `WriteObject` calls. Only set if the upload has not finalized.
+     * 
+ * + * int64 committed_size = 1; + * + * @return This builder for chaining. + */ + public Builder clearCommittedSize() { + if (writeStatusCase_ == 1) { + writeStatusCase_ = 0; + writeStatus_ = null; + onChanged(); + } + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Object, + com.google.storage.v2.Object.Builder, + com.google.storage.v2.ObjectOrBuilder> + resourceBuilder_; + /** + * + * + *
+     * A resource containing the metadata for the uploaded object. Only set if
+     * the upload has finalized.
+     * 
+ * + * .google.storage.v2.Object resource = 2; + * + * @return Whether the resource field is set. + */ + @java.lang.Override + public boolean hasResource() { + return writeStatusCase_ == 2; + } + /** + * + * + *
+     * A resource containing the metadata for the uploaded object. Only set if
+     * the upload has finalized.
+     * 
+ * + * .google.storage.v2.Object resource = 2; + * + * @return The resource. + */ + @java.lang.Override + public com.google.storage.v2.Object getResource() { + if (resourceBuilder_ == null) { + if (writeStatusCase_ == 2) { + return (com.google.storage.v2.Object) writeStatus_; + } + return com.google.storage.v2.Object.getDefaultInstance(); + } else { + if (writeStatusCase_ == 2) { + return resourceBuilder_.getMessage(); + } + return com.google.storage.v2.Object.getDefaultInstance(); + } + } + /** + * + * + *
+     * A resource containing the metadata for the uploaded object. Only set if
+     * the upload has finalized.
+     * 
+ * + * .google.storage.v2.Object resource = 2; + */ + public Builder setResource(com.google.storage.v2.Object value) { + if (resourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + writeStatus_ = value; + onChanged(); + } else { + resourceBuilder_.setMessage(value); + } + writeStatusCase_ = 2; + return this; + } + /** + * + * + *
+     * A resource containing the metadata for the uploaded object. Only set if
+     * the upload has finalized.
+     * 
+ * + * .google.storage.v2.Object resource = 2; + */ + public Builder setResource(com.google.storage.v2.Object.Builder builderForValue) { + if (resourceBuilder_ == null) { + writeStatus_ = builderForValue.build(); + onChanged(); + } else { + resourceBuilder_.setMessage(builderForValue.build()); + } + writeStatusCase_ = 2; + return this; + } + /** + * + * + *
+     * A resource containing the metadata for the uploaded object. Only set if
+     * the upload has finalized.
+     * 
+ * + * .google.storage.v2.Object resource = 2; + */ + public Builder mergeResource(com.google.storage.v2.Object value) { + if (resourceBuilder_ == null) { + if (writeStatusCase_ == 2 + && writeStatus_ != com.google.storage.v2.Object.getDefaultInstance()) { + writeStatus_ = + com.google.storage.v2.Object.newBuilder((com.google.storage.v2.Object) writeStatus_) + .mergeFrom(value) + .buildPartial(); + } else { + writeStatus_ = value; + } + onChanged(); + } else { + if (writeStatusCase_ == 2) { + resourceBuilder_.mergeFrom(value); + } + resourceBuilder_.setMessage(value); + } + writeStatusCase_ = 2; + return this; + } + /** + * + * + *
+     * A resource containing the metadata for the uploaded object. Only set if
+     * the upload has finalized.
+     * 
+ * + * .google.storage.v2.Object resource = 2; + */ + public Builder clearResource() { + if (resourceBuilder_ == null) { + if (writeStatusCase_ == 2) { + writeStatusCase_ = 0; + writeStatus_ = null; + onChanged(); + } + } else { + if (writeStatusCase_ == 2) { + writeStatusCase_ = 0; + writeStatus_ = null; + } + resourceBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A resource containing the metadata for the uploaded object. Only set if
+     * the upload has finalized.
+     * 
+ * + * .google.storage.v2.Object resource = 2; + */ + public com.google.storage.v2.Object.Builder getResourceBuilder() { + return getResourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A resource containing the metadata for the uploaded object. Only set if
+     * the upload has finalized.
+     * 
+ * + * .google.storage.v2.Object resource = 2; + */ + @java.lang.Override + public com.google.storage.v2.ObjectOrBuilder getResourceOrBuilder() { + if ((writeStatusCase_ == 2) && (resourceBuilder_ != null)) { + return resourceBuilder_.getMessageOrBuilder(); + } else { + if (writeStatusCase_ == 2) { + return (com.google.storage.v2.Object) writeStatus_; + } + return com.google.storage.v2.Object.getDefaultInstance(); + } + } + /** + * + * + *
+     * A resource containing the metadata for the uploaded object. Only set if
+     * the upload has finalized.
+     * 
+ * + * .google.storage.v2.Object resource = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Object, + com.google.storage.v2.Object.Builder, + com.google.storage.v2.ObjectOrBuilder> + getResourceFieldBuilder() { + if (resourceBuilder_ == null) { + if (!(writeStatusCase_ == 2)) { + writeStatus_ = com.google.storage.v2.Object.getDefaultInstance(); + } + resourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Object, + com.google.storage.v2.Object.Builder, + com.google.storage.v2.ObjectOrBuilder>( + (com.google.storage.v2.Object) writeStatus_, getParentForChildren(), isClean()); + writeStatus_ = null; + } + writeStatusCase_ = 2; + onChanged(); + ; + return resourceBuilder_; + } + + @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.WriteObjectResponse) + } + + // @@protoc_insertion_point(class_scope:google.storage.v2.WriteObjectResponse) + private static final com.google.storage.v2.WriteObjectResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.v2.WriteObjectResponse(); + } + + public static com.google.storage.v2.WriteObjectResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WriteObjectResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new WriteObjectResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.storage.v2.WriteObjectResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectResponseOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectResponseOrBuilder.java new file mode 100644 index 0000000000..e587777b3d --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectResponseOrBuilder.java @@ -0,0 +1,92 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +package com.google.storage.v2; + +public interface WriteObjectResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.WriteObjectResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The total number of bytes that have been processed for the given object
+   * from all `WriteObject` calls. Only set if the upload has not finalized.
+   * 
+ * + * int64 committed_size = 1; + * + * @return Whether the committedSize field is set. + */ + boolean hasCommittedSize(); + /** + * + * + *
+   * The total number of bytes that have been processed for the given object
+   * from all `WriteObject` calls. Only set if the upload has not finalized.
+   * 
+ * + * int64 committed_size = 1; + * + * @return The committedSize. + */ + long getCommittedSize(); + + /** + * + * + *
+   * A resource containing the metadata for the uploaded object. Only set if
+   * the upload has finalized.
+   * 
+ * + * .google.storage.v2.Object resource = 2; + * + * @return Whether the resource field is set. + */ + boolean hasResource(); + /** + * + * + *
+   * A resource containing the metadata for the uploaded object. Only set if
+   * the upload has finalized.
+   * 
+ * + * .google.storage.v2.Object resource = 2; + * + * @return The resource. + */ + com.google.storage.v2.Object getResource(); + /** + * + * + *
+   * A resource containing the metadata for the uploaded object. Only set if
+   * the upload has finalized.
+   * 
+ * + * .google.storage.v2.Object resource = 2; + */ + com.google.storage.v2.ObjectOrBuilder getResourceOrBuilder(); + + public com.google.storage.v2.WriteObjectResponse.WriteStatusCase getWriteStatusCase(); +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectSpec.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectSpec.java new file mode 100644 index 0000000000..8aa73d3819 --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectSpec.java @@ -0,0 +1,1440 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +package com.google.storage.v2; + +/** + * + * + *
+ * Describes an attempt to insert an object, possibly over multiple requests.
+ * 
+ * + * Protobuf type {@code google.storage.v2.WriteObjectSpec} + */ +public final class WriteObjectSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.v2.WriteObjectSpec) + WriteObjectSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use WriteObjectSpec.newBuilder() to construct. + private WriteObjectSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private WriteObjectSpec() { + predefinedAcl_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new WriteObjectSpec(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private WriteObjectSpec( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.storage.v2.Object.Builder subBuilder = null; + if (resource_ != null) { + subBuilder = resource_.toBuilder(); + } + resource_ = + input.readMessage(com.google.storage.v2.Object.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(resource_); + resource_ = subBuilder.buildPartial(); + } + + break; + } + case 16: + { + int rawValue = input.readEnum(); + + predefinedAcl_ = rawValue; + break; + } + case 24: + { + bitField0_ |= 0x00000001; + ifGenerationMatch_ = input.readInt64(); + break; + } + case 32: + { + bitField0_ |= 0x00000002; + ifGenerationNotMatch_ = input.readInt64(); + break; + } + case 40: + { + bitField0_ |= 0x00000004; + ifMetagenerationMatch_ = input.readInt64(); + break; + } + case 48: + { + bitField0_ |= 0x00000008; + ifMetagenerationNotMatch_ = 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_WriteObjectSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_WriteObjectSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.WriteObjectSpec.class, + com.google.storage.v2.WriteObjectSpec.Builder.class); + } + + private int bitField0_; + public static final int RESOURCE_FIELD_NUMBER = 1; + private com.google.storage.v2.Object resource_; + /** + * + * + *
+   * Destination object, including its name and its metadata.
+   * 
+ * + * .google.storage.v2.Object resource = 1; + * + * @return Whether the resource field is set. + */ + @java.lang.Override + public boolean hasResource() { + return resource_ != null; + } + /** + * + * + *
+   * Destination object, including its name and its metadata.
+   * 
+ * + * .google.storage.v2.Object resource = 1; + * + * @return The resource. + */ + @java.lang.Override + public com.google.storage.v2.Object getResource() { + return resource_ == null ? com.google.storage.v2.Object.getDefaultInstance() : resource_; + } + /** + * + * + *
+   * Destination object, including its name and its metadata.
+   * 
+ * + * .google.storage.v2.Object resource = 1; + */ + @java.lang.Override + public com.google.storage.v2.ObjectOrBuilder getResourceOrBuilder() { + return getResource(); + } + + public static final int PREDEFINED_ACL_FIELD_NUMBER = 2; + private int predefinedAcl_; + /** + * + * + *
+   * Apply a predefined set of access controls to this object.
+   * 
+ * + * .google.storage.v2.PredefinedObjectAcl predefined_acl = 2; + * + * @return The enum numeric value on the wire for predefinedAcl. + */ + @java.lang.Override + public int getPredefinedAclValue() { + return predefinedAcl_; + } + /** + * + * + *
+   * Apply a predefined set of access controls to this object.
+   * 
+ * + * .google.storage.v2.PredefinedObjectAcl predefined_acl = 2; + * + * @return The predefinedAcl. + */ + @java.lang.Override + public com.google.storage.v2.PredefinedObjectAcl getPredefinedAcl() { + @SuppressWarnings("deprecation") + com.google.storage.v2.PredefinedObjectAcl result = + com.google.storage.v2.PredefinedObjectAcl.valueOf(predefinedAcl_); + return result == null ? com.google.storage.v2.PredefinedObjectAcl.UNRECOGNIZED : result; + } + + public static final int IF_GENERATION_MATCH_FIELD_NUMBER = 3; + private long ifGenerationMatch_; + /** + * + * + *
+   * Makes the operation conditional on whether the object's current
+   * generation matches the given value. Setting to 0 makes the operation
+   * succeed only if there are no live versions of the object.
+   * 
+ * + * int64 if_generation_match = 3; + * + * @return Whether the ifGenerationMatch field is set. + */ + @java.lang.Override + public boolean hasIfGenerationMatch() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Makes the operation conditional on whether the object's current
+   * generation matches the given value. Setting to 0 makes the operation
+   * succeed only if there are no live versions of the object.
+   * 
+ * + * int64 if_generation_match = 3; + * + * @return The ifGenerationMatch. + */ + @java.lang.Override + public long getIfGenerationMatch() { + return ifGenerationMatch_; + } + + public static final int IF_GENERATION_NOT_MATCH_FIELD_NUMBER = 4; + private long ifGenerationNotMatch_; + /** + * + * + *
+   * Makes the operation conditional on whether the object's current
+   * generation does not match the given value. If no live object exists, the
+   * precondition fails. Setting to 0 makes the operation succeed only if
+   * there is a live version of the object.
+   * 
+ * + * int64 if_generation_not_match = 4; + * + * @return Whether the ifGenerationNotMatch field is set. + */ + @java.lang.Override + public boolean hasIfGenerationNotMatch() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Makes the operation conditional on whether the object's current
+   * generation does not match the given value. If no live object exists, the
+   * precondition fails. Setting to 0 makes the operation succeed only if
+   * there is a live version of the object.
+   * 
+ * + * int64 if_generation_not_match = 4; + * + * @return The ifGenerationNotMatch. + */ + @java.lang.Override + public long getIfGenerationNotMatch() { + return ifGenerationNotMatch_; + } + + public static final int IF_METAGENERATION_MATCH_FIELD_NUMBER = 5; + private long ifMetagenerationMatch_; + /** + * + * + *
+   * Makes the operation conditional on whether the object's current
+   * metageneration matches the given value.
+   * 
+ * + * int64 if_metageneration_match = 5; + * + * @return Whether the ifMetagenerationMatch field is set. + */ + @java.lang.Override + public boolean hasIfMetagenerationMatch() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * Makes the operation conditional on whether the object's current
+   * metageneration matches the given value.
+   * 
+ * + * int64 if_metageneration_match = 5; + * + * @return The ifMetagenerationMatch. + */ + @java.lang.Override + public long getIfMetagenerationMatch() { + return ifMetagenerationMatch_; + } + + public static final int IF_METAGENERATION_NOT_MATCH_FIELD_NUMBER = 6; + private long ifMetagenerationNotMatch_; + /** + * + * + *
+   * Makes the operation conditional on whether the object's current
+   * metageneration does not match the given value.
+   * 
+ * + * int64 if_metageneration_not_match = 6; + * + * @return Whether the ifMetagenerationNotMatch field is set. + */ + @java.lang.Override + public boolean hasIfMetagenerationNotMatch() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+   * Makes the operation conditional on whether the object's current
+   * metageneration does not match the given value.
+   * 
+ * + * int64 if_metageneration_not_match = 6; + * + * @return The ifMetagenerationNotMatch. + */ + @java.lang.Override + public long getIfMetagenerationNotMatch() { + return ifMetagenerationNotMatch_; + } + + 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 (resource_ != null) { + output.writeMessage(1, getResource()); + } + if (predefinedAcl_ + != com.google.storage.v2.PredefinedObjectAcl.PREDEFINED_OBJECT_ACL_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, predefinedAcl_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt64(3, ifGenerationMatch_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeInt64(4, ifGenerationNotMatch_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeInt64(5, ifMetagenerationMatch_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeInt64(6, ifMetagenerationNotMatch_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (resource_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getResource()); + } + if (predefinedAcl_ + != com.google.storage.v2.PredefinedObjectAcl.PREDEFINED_OBJECT_ACL_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, predefinedAcl_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, ifGenerationMatch_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, ifGenerationNotMatch_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(5, ifMetagenerationMatch_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(6, ifMetagenerationNotMatch_); + } + 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.WriteObjectSpec)) { + return super.equals(obj); + } + com.google.storage.v2.WriteObjectSpec other = (com.google.storage.v2.WriteObjectSpec) obj; + + if (hasResource() != other.hasResource()) return false; + if (hasResource()) { + if (!getResource().equals(other.getResource())) return false; + } + if (predefinedAcl_ != other.predefinedAcl_) return false; + if (hasIfGenerationMatch() != other.hasIfGenerationMatch()) return false; + if (hasIfGenerationMatch()) { + if (getIfGenerationMatch() != other.getIfGenerationMatch()) return false; + } + if (hasIfGenerationNotMatch() != other.hasIfGenerationNotMatch()) return false; + if (hasIfGenerationNotMatch()) { + if (getIfGenerationNotMatch() != other.getIfGenerationNotMatch()) return false; + } + if (hasIfMetagenerationMatch() != other.hasIfMetagenerationMatch()) return false; + if (hasIfMetagenerationMatch()) { + if (getIfMetagenerationMatch() != other.getIfMetagenerationMatch()) return false; + } + if (hasIfMetagenerationNotMatch() != other.hasIfMetagenerationNotMatch()) return false; + if (hasIfMetagenerationNotMatch()) { + if (getIfMetagenerationNotMatch() != other.getIfMetagenerationNotMatch()) 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 (hasResource()) { + hash = (37 * hash) + RESOURCE_FIELD_NUMBER; + hash = (53 * hash) + getResource().hashCode(); + } + hash = (37 * hash) + PREDEFINED_ACL_FIELD_NUMBER; + hash = (53 * hash) + predefinedAcl_; + if (hasIfGenerationMatch()) { + hash = (37 * hash) + IF_GENERATION_MATCH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIfGenerationMatch()); + } + if (hasIfGenerationNotMatch()) { + hash = (37 * hash) + IF_GENERATION_NOT_MATCH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIfGenerationNotMatch()); + } + if (hasIfMetagenerationMatch()) { + hash = (37 * hash) + IF_METAGENERATION_MATCH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIfMetagenerationMatch()); + } + if (hasIfMetagenerationNotMatch()) { + hash = (37 * hash) + IF_METAGENERATION_NOT_MATCH_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getIfMetagenerationNotMatch()); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.v2.WriteObjectSpec parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.WriteObjectSpec 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.WriteObjectSpec parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.WriteObjectSpec 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.WriteObjectSpec parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.v2.WriteObjectSpec parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.v2.WriteObjectSpec parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.WriteObjectSpec 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.WriteObjectSpec parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.v2.WriteObjectSpec 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.WriteObjectSpec parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.v2.WriteObjectSpec 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.WriteObjectSpec prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Describes an attempt to insert an object, possibly over multiple requests.
+   * 
+ * + * Protobuf type {@code google.storage.v2.WriteObjectSpec} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.v2.WriteObjectSpec) + com.google.storage.v2.WriteObjectSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_WriteObjectSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_WriteObjectSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.v2.WriteObjectSpec.class, + com.google.storage.v2.WriteObjectSpec.Builder.class); + } + + // Construct using com.google.storage.v2.WriteObjectSpec.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (resourceBuilder_ == null) { + resource_ = null; + } else { + resource_ = null; + resourceBuilder_ = null; + } + predefinedAcl_ = 0; + + ifGenerationMatch_ = 0L; + bitField0_ = (bitField0_ & ~0x00000001); + ifGenerationNotMatch_ = 0L; + bitField0_ = (bitField0_ & ~0x00000002); + ifMetagenerationMatch_ = 0L; + bitField0_ = (bitField0_ & ~0x00000004); + ifMetagenerationNotMatch_ = 0L; + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.v2.StorageProto + .internal_static_google_storage_v2_WriteObjectSpec_descriptor; + } + + @java.lang.Override + public com.google.storage.v2.WriteObjectSpec getDefaultInstanceForType() { + return com.google.storage.v2.WriteObjectSpec.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.v2.WriteObjectSpec build() { + com.google.storage.v2.WriteObjectSpec result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.v2.WriteObjectSpec buildPartial() { + com.google.storage.v2.WriteObjectSpec result = + new com.google.storage.v2.WriteObjectSpec(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (resourceBuilder_ == null) { + result.resource_ = resource_; + } else { + result.resource_ = resourceBuilder_.build(); + } + result.predefinedAcl_ = predefinedAcl_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.ifGenerationMatch_ = ifGenerationMatch_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.ifGenerationNotMatch_ = ifGenerationNotMatch_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.ifMetagenerationMatch_ = ifMetagenerationMatch_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.ifMetagenerationNotMatch_ = ifMetagenerationNotMatch_; + to_bitField0_ |= 0x00000008; + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.storage.v2.WriteObjectSpec) { + return mergeFrom((com.google.storage.v2.WriteObjectSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.v2.WriteObjectSpec other) { + if (other == com.google.storage.v2.WriteObjectSpec.getDefaultInstance()) return this; + if (other.hasResource()) { + mergeResource(other.getResource()); + } + if (other.predefinedAcl_ != 0) { + setPredefinedAclValue(other.getPredefinedAclValue()); + } + if (other.hasIfGenerationMatch()) { + setIfGenerationMatch(other.getIfGenerationMatch()); + } + if (other.hasIfGenerationNotMatch()) { + setIfGenerationNotMatch(other.getIfGenerationNotMatch()); + } + if (other.hasIfMetagenerationMatch()) { + setIfMetagenerationMatch(other.getIfMetagenerationMatch()); + } + if (other.hasIfMetagenerationNotMatch()) { + setIfMetagenerationNotMatch(other.getIfMetagenerationNotMatch()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.storage.v2.WriteObjectSpec parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.storage.v2.WriteObjectSpec) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.storage.v2.Object resource_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Object, + com.google.storage.v2.Object.Builder, + com.google.storage.v2.ObjectOrBuilder> + resourceBuilder_; + /** + * + * + *
+     * Destination object, including its name and its metadata.
+     * 
+ * + * .google.storage.v2.Object resource = 1; + * + * @return Whether the resource field is set. + */ + public boolean hasResource() { + return resourceBuilder_ != null || resource_ != null; + } + /** + * + * + *
+     * Destination object, including its name and its metadata.
+     * 
+ * + * .google.storage.v2.Object resource = 1; + * + * @return The resource. + */ + public com.google.storage.v2.Object getResource() { + if (resourceBuilder_ == null) { + return resource_ == null ? com.google.storage.v2.Object.getDefaultInstance() : resource_; + } else { + return resourceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Destination object, including its name and its metadata.
+     * 
+ * + * .google.storage.v2.Object resource = 1; + */ + public Builder setResource(com.google.storage.v2.Object value) { + if (resourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resource_ = value; + onChanged(); + } else { + resourceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Destination object, including its name and its metadata.
+     * 
+ * + * .google.storage.v2.Object resource = 1; + */ + public Builder setResource(com.google.storage.v2.Object.Builder builderForValue) { + if (resourceBuilder_ == null) { + resource_ = builderForValue.build(); + onChanged(); + } else { + resourceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Destination object, including its name and its metadata.
+     * 
+ * + * .google.storage.v2.Object resource = 1; + */ + public Builder mergeResource(com.google.storage.v2.Object value) { + if (resourceBuilder_ == null) { + if (resource_ != null) { + resource_ = + com.google.storage.v2.Object.newBuilder(resource_).mergeFrom(value).buildPartial(); + } else { + resource_ = value; + } + onChanged(); + } else { + resourceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Destination object, including its name and its metadata.
+     * 
+ * + * .google.storage.v2.Object resource = 1; + */ + public Builder clearResource() { + if (resourceBuilder_ == null) { + resource_ = null; + onChanged(); + } else { + resource_ = null; + resourceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Destination object, including its name and its metadata.
+     * 
+ * + * .google.storage.v2.Object resource = 1; + */ + public com.google.storage.v2.Object.Builder getResourceBuilder() { + + onChanged(); + return getResourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Destination object, including its name and its metadata.
+     * 
+ * + * .google.storage.v2.Object resource = 1; + */ + public com.google.storage.v2.ObjectOrBuilder getResourceOrBuilder() { + if (resourceBuilder_ != null) { + return resourceBuilder_.getMessageOrBuilder(); + } else { + return resource_ == null ? com.google.storage.v2.Object.getDefaultInstance() : resource_; + } + } + /** + * + * + *
+     * Destination object, including its name and its metadata.
+     * 
+ * + * .google.storage.v2.Object resource = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Object, + com.google.storage.v2.Object.Builder, + com.google.storage.v2.ObjectOrBuilder> + getResourceFieldBuilder() { + if (resourceBuilder_ == null) { + resourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.v2.Object, + com.google.storage.v2.Object.Builder, + com.google.storage.v2.ObjectOrBuilder>( + getResource(), getParentForChildren(), isClean()); + resource_ = null; + } + return resourceBuilder_; + } + + private int predefinedAcl_ = 0; + /** + * + * + *
+     * Apply a predefined set of access controls to this object.
+     * 
+ * + * .google.storage.v2.PredefinedObjectAcl predefined_acl = 2; + * + * @return The enum numeric value on the wire for predefinedAcl. + */ + @java.lang.Override + public int getPredefinedAclValue() { + return predefinedAcl_; + } + /** + * + * + *
+     * Apply a predefined set of access controls to this object.
+     * 
+ * + * .google.storage.v2.PredefinedObjectAcl predefined_acl = 2; + * + * @param value The enum numeric value on the wire for predefinedAcl to set. + * @return This builder for chaining. + */ + public Builder setPredefinedAclValue(int value) { + + predefinedAcl_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Apply a predefined set of access controls to this object.
+     * 
+ * + * .google.storage.v2.PredefinedObjectAcl predefined_acl = 2; + * + * @return The predefinedAcl. + */ + @java.lang.Override + public com.google.storage.v2.PredefinedObjectAcl getPredefinedAcl() { + @SuppressWarnings("deprecation") + com.google.storage.v2.PredefinedObjectAcl result = + com.google.storage.v2.PredefinedObjectAcl.valueOf(predefinedAcl_); + return result == null ? com.google.storage.v2.PredefinedObjectAcl.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Apply a predefined set of access controls to this object.
+     * 
+ * + * .google.storage.v2.PredefinedObjectAcl predefined_acl = 2; + * + * @param value The predefinedAcl to set. + * @return This builder for chaining. + */ + public Builder setPredefinedAcl(com.google.storage.v2.PredefinedObjectAcl value) { + if (value == null) { + throw new NullPointerException(); + } + + predefinedAcl_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Apply a predefined set of access controls to this object.
+     * 
+ * + * .google.storage.v2.PredefinedObjectAcl predefined_acl = 2; + * + * @return This builder for chaining. + */ + public Builder clearPredefinedAcl() { + + predefinedAcl_ = 0; + onChanged(); + return this; + } + + private long ifGenerationMatch_; + /** + * + * + *
+     * Makes the operation conditional on whether the object's current
+     * generation matches the given value. Setting to 0 makes the operation
+     * succeed only if there are no live versions of the object.
+     * 
+ * + * int64 if_generation_match = 3; + * + * @return Whether the ifGenerationMatch field is set. + */ + @java.lang.Override + public boolean hasIfGenerationMatch() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Makes the operation conditional on whether the object's current
+     * generation matches the given value. Setting to 0 makes the operation
+     * succeed only if there are no live versions of the object.
+     * 
+ * + * int64 if_generation_match = 3; + * + * @return The ifGenerationMatch. + */ + @java.lang.Override + public long getIfGenerationMatch() { + return ifGenerationMatch_; + } + /** + * + * + *
+     * Makes the operation conditional on whether the object's current
+     * generation matches the given value. Setting to 0 makes the operation
+     * succeed only if there are no live versions of the object.
+     * 
+ * + * int64 if_generation_match = 3; + * + * @param value The ifGenerationMatch to set. + * @return This builder for chaining. + */ + public Builder setIfGenerationMatch(long value) { + bitField0_ |= 0x00000001; + ifGenerationMatch_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Makes the operation conditional on whether the object's current
+     * generation matches the given value. Setting to 0 makes the operation
+     * succeed only if there are no live versions of the object.
+     * 
+ * + * int64 if_generation_match = 3; + * + * @return This builder for chaining. + */ + public Builder clearIfGenerationMatch() { + bitField0_ = (bitField0_ & ~0x00000001); + ifGenerationMatch_ = 0L; + onChanged(); + return this; + } + + private long ifGenerationNotMatch_; + /** + * + * + *
+     * Makes the operation conditional on whether the object's current
+     * generation does not match the given value. If no live object exists, the
+     * precondition fails. Setting to 0 makes the operation succeed only if
+     * there is a live version of the object.
+     * 
+ * + * int64 if_generation_not_match = 4; + * + * @return Whether the ifGenerationNotMatch field is set. + */ + @java.lang.Override + public boolean hasIfGenerationNotMatch() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Makes the operation conditional on whether the object's current
+     * generation does not match the given value. If no live object exists, the
+     * precondition fails. Setting to 0 makes the operation succeed only if
+     * there is a live version of the object.
+     * 
+ * + * int64 if_generation_not_match = 4; + * + * @return The ifGenerationNotMatch. + */ + @java.lang.Override + public long getIfGenerationNotMatch() { + return ifGenerationNotMatch_; + } + /** + * + * + *
+     * Makes the operation conditional on whether the object's current
+     * generation does not match the given value. If no live object exists, the
+     * precondition fails. Setting to 0 makes the operation succeed only if
+     * there is a live version of the object.
+     * 
+ * + * int64 if_generation_not_match = 4; + * + * @param value The ifGenerationNotMatch to set. + * @return This builder for chaining. + */ + public Builder setIfGenerationNotMatch(long value) { + bitField0_ |= 0x00000002; + ifGenerationNotMatch_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Makes the operation conditional on whether the object's current
+     * generation does not match the given value. If no live object exists, the
+     * precondition fails. Setting to 0 makes the operation succeed only if
+     * there is a live version of the object.
+     * 
+ * + * int64 if_generation_not_match = 4; + * + * @return This builder for chaining. + */ + public Builder clearIfGenerationNotMatch() { + bitField0_ = (bitField0_ & ~0x00000002); + ifGenerationNotMatch_ = 0L; + onChanged(); + return this; + } + + private long ifMetagenerationMatch_; + /** + * + * + *
+     * Makes the operation conditional on whether the object's current
+     * metageneration matches the given value.
+     * 
+ * + * int64 if_metageneration_match = 5; + * + * @return Whether the ifMetagenerationMatch field is set. + */ + @java.lang.Override + public boolean hasIfMetagenerationMatch() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Makes the operation conditional on whether the object's current
+     * metageneration matches the given value.
+     * 
+ * + * int64 if_metageneration_match = 5; + * + * @return The ifMetagenerationMatch. + */ + @java.lang.Override + public long getIfMetagenerationMatch() { + return ifMetagenerationMatch_; + } + /** + * + * + *
+     * Makes the operation conditional on whether the object's current
+     * metageneration matches the given value.
+     * 
+ * + * int64 if_metageneration_match = 5; + * + * @param value The ifMetagenerationMatch to set. + * @return This builder for chaining. + */ + public Builder setIfMetagenerationMatch(long value) { + bitField0_ |= 0x00000004; + ifMetagenerationMatch_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Makes the operation conditional on whether the object's current
+     * metageneration matches the given value.
+     * 
+ * + * int64 if_metageneration_match = 5; + * + * @return This builder for chaining. + */ + public Builder clearIfMetagenerationMatch() { + bitField0_ = (bitField0_ & ~0x00000004); + ifMetagenerationMatch_ = 0L; + onChanged(); + return this; + } + + private long ifMetagenerationNotMatch_; + /** + * + * + *
+     * Makes the operation conditional on whether the object's current
+     * metageneration does not match the given value.
+     * 
+ * + * int64 if_metageneration_not_match = 6; + * + * @return Whether the ifMetagenerationNotMatch field is set. + */ + @java.lang.Override + public boolean hasIfMetagenerationNotMatch() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Makes the operation conditional on whether the object's current
+     * metageneration does not match the given value.
+     * 
+ * + * int64 if_metageneration_not_match = 6; + * + * @return The ifMetagenerationNotMatch. + */ + @java.lang.Override + public long getIfMetagenerationNotMatch() { + return ifMetagenerationNotMatch_; + } + /** + * + * + *
+     * Makes the operation conditional on whether the object's current
+     * metageneration does not match the given value.
+     * 
+ * + * int64 if_metageneration_not_match = 6; + * + * @param value The ifMetagenerationNotMatch to set. + * @return This builder for chaining. + */ + public Builder setIfMetagenerationNotMatch(long value) { + bitField0_ |= 0x00000008; + ifMetagenerationNotMatch_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Makes the operation conditional on whether the object's current
+     * metageneration does not match the given value.
+     * 
+ * + * int64 if_metageneration_not_match = 6; + * + * @return This builder for chaining. + */ + public Builder clearIfMetagenerationNotMatch() { + bitField0_ = (bitField0_ & ~0x00000008); + ifMetagenerationNotMatch_ = 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.WriteObjectSpec) + } + + // @@protoc_insertion_point(class_scope:google.storage.v2.WriteObjectSpec) + private static final com.google.storage.v2.WriteObjectSpec DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.v2.WriteObjectSpec(); + } + + public static com.google.storage.v2.WriteObjectSpec getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WriteObjectSpec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new WriteObjectSpec(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.storage.v2.WriteObjectSpec getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectSpecOrBuilder.java b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectSpecOrBuilder.java new file mode 100644 index 0000000000..61c4426ad8 --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectSpecOrBuilder.java @@ -0,0 +1,199 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/storage/v2/storage.proto + +package com.google.storage.v2; + +public interface WriteObjectSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.v2.WriteObjectSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Destination object, including its name and its metadata.
+   * 
+ * + * .google.storage.v2.Object resource = 1; + * + * @return Whether the resource field is set. + */ + boolean hasResource(); + /** + * + * + *
+   * Destination object, including its name and its metadata.
+   * 
+ * + * .google.storage.v2.Object resource = 1; + * + * @return The resource. + */ + com.google.storage.v2.Object getResource(); + /** + * + * + *
+   * Destination object, including its name and its metadata.
+   * 
+ * + * .google.storage.v2.Object resource = 1; + */ + com.google.storage.v2.ObjectOrBuilder getResourceOrBuilder(); + + /** + * + * + *
+   * Apply a predefined set of access controls to this object.
+   * 
+ * + * .google.storage.v2.PredefinedObjectAcl predefined_acl = 2; + * + * @return The enum numeric value on the wire for predefinedAcl. + */ + int getPredefinedAclValue(); + /** + * + * + *
+   * Apply a predefined set of access controls to this object.
+   * 
+ * + * .google.storage.v2.PredefinedObjectAcl predefined_acl = 2; + * + * @return The predefinedAcl. + */ + com.google.storage.v2.PredefinedObjectAcl getPredefinedAcl(); + + /** + * + * + *
+   * Makes the operation conditional on whether the object's current
+   * generation matches the given value. Setting to 0 makes the operation
+   * succeed only if there are no live versions of the object.
+   * 
+ * + * int64 if_generation_match = 3; + * + * @return Whether the ifGenerationMatch field is set. + */ + boolean hasIfGenerationMatch(); + /** + * + * + *
+   * Makes the operation conditional on whether the object's current
+   * generation matches the given value. Setting to 0 makes the operation
+   * succeed only if there are no live versions of the object.
+   * 
+ * + * int64 if_generation_match = 3; + * + * @return The ifGenerationMatch. + */ + long getIfGenerationMatch(); + + /** + * + * + *
+   * Makes the operation conditional on whether the object's current
+   * generation does not match the given value. If no live object exists, the
+   * precondition fails. Setting to 0 makes the operation succeed only if
+   * there is a live version of the object.
+   * 
+ * + * int64 if_generation_not_match = 4; + * + * @return Whether the ifGenerationNotMatch field is set. + */ + boolean hasIfGenerationNotMatch(); + /** + * + * + *
+   * Makes the operation conditional on whether the object's current
+   * generation does not match the given value. If no live object exists, the
+   * precondition fails. Setting to 0 makes the operation succeed only if
+   * there is a live version of the object.
+   * 
+ * + * int64 if_generation_not_match = 4; + * + * @return The ifGenerationNotMatch. + */ + long getIfGenerationNotMatch(); + + /** + * + * + *
+   * Makes the operation conditional on whether the object's current
+   * metageneration matches the given value.
+   * 
+ * + * int64 if_metageneration_match = 5; + * + * @return Whether the ifMetagenerationMatch field is set. + */ + boolean hasIfMetagenerationMatch(); + /** + * + * + *
+   * Makes the operation conditional on whether the object's current
+   * metageneration matches the given value.
+   * 
+ * + * int64 if_metageneration_match = 5; + * + * @return The ifMetagenerationMatch. + */ + long getIfMetagenerationMatch(); + + /** + * + * + *
+   * Makes the operation conditional on whether the object's current
+   * metageneration does not match the given value.
+   * 
+ * + * int64 if_metageneration_not_match = 6; + * + * @return Whether the ifMetagenerationNotMatch field is set. + */ + boolean hasIfMetagenerationNotMatch(); + /** + * + * + *
+   * Makes the operation conditional on whether the object's current
+   * metageneration does not match the given value.
+   * 
+ * + * int64 if_metageneration_not_match = 6; + * + * @return The ifMetagenerationNotMatch. + */ + long getIfMetagenerationNotMatch(); +} diff --git a/proto-google-cloud-storage-v2/src/main/proto/google/storage/v2/storage.proto b/proto-google-cloud-storage-v2/src/main/proto/google/storage/v2/storage.proto new file mode 100644 index 0000000000..a5fca6984c --- /dev/null +++ b/proto-google-cloud-storage-v2/src/main/proto/google/storage/v2/storage.proto @@ -0,0 +1,1129 @@ +// 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.storage.v2; + +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/date.proto"; + +option go_package = "google.golang.org/genproto/googleapis/storage/v2;storage"; +option java_multiple_files = true; +option java_outer_classname = "StorageProto"; +option java_package = "com.google.storage.v2"; +option (google.api.resource_definition) = { + type: "cloudkms.googleapis.com/CryptoKey" + pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}" +}; + +// Manages Google Cloud Storage resources. +service Storage { + option (google.api.default_host) = "storage.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only," + "https://www.googleapis.com/auth/devstorage.full_control," + "https://www.googleapis.com/auth/devstorage.read_only," + "https://www.googleapis.com/auth/devstorage.read_write"; + + // Reads an object's data. + rpc ReadObject(ReadObjectRequest) returns (stream ReadObjectResponse) { + option (google.api.method_signature) = "bucket,object"; + option (google.api.method_signature) = "bucket,object,generation"; + } + + // 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. + rpc WriteObject(stream WriteObjectRequest) returns (WriteObjectResponse) { + } + + // Starts a resumable write. How long the write operation remains valid, and + // what happens when the write operation becomes invalid, are + // service-dependent. + rpc StartResumableWrite(StartResumableWriteRequest) returns (StartResumableWriteResponse) { + } + + // 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. + rpc QueryWriteStatus(QueryWriteStatusRequest) returns (QueryWriteStatusResponse) { + option (google.api.method_signature) = "upload_id"; + } +} + +// Request message for ReadObject. +message ReadObjectRequest { + // The name of the bucket containing the object to read. + string bucket = 1; + + // The name of the object to read. + string object = 2; + + // If present, selects a specific revision of this object (as opposed + // to the latest version, the default). + int64 generation = 3; + + // The offset for the first byte to return in the read, relative to the start + // of the object. + // + // A negative `read_offset` value will be interpreted as the number of bytes + // back from the end of the object to be returned. For example, if an object's + // length is 15 bytes, a ReadObjectRequest with `read_offset` = -5 and + // `read_limit` = 3 would return bytes 10 through 12 of the object. Requesting + // a negative offset whose magnitude is larger than the size of the object + // will result in an error. + int64 read_offset = 4; + + // The maximum number of `data` bytes the server is allowed to return in the + // sum of all `Object` messages. A `read_limit` of zero indicates that there + // is no limit, and a negative `read_limit` will cause an error. + // + // If the stream returns fewer bytes than allowed by the `read_limit` and no + // error occurred, the stream includes all data from the `read_offset` to the + // end of the resource. + int64 read_limit = 5; + + // Makes the operation conditional on whether the object's current generation + // matches the given value. Setting to 0 makes the operation succeed only if + // there are no live versions of the object. + optional int64 if_generation_match = 6; + + // Makes the operation conditional on whether the object's current generation + // does not match the given value. If no live object exists, the precondition + // fails. Setting to 0 makes the operation succeed only if there is a live + // version of the object. + optional int64 if_generation_not_match = 7; + + // Makes the operation conditional on whether the object's current + // metageneration matches the given value. + optional int64 if_metageneration_match = 8; + + // Makes the operation conditional on whether the object's current + // metageneration does not match the given value. + optional int64 if_metageneration_not_match = 9; + + // A set of parameters common to Storage API requests concerning an object. + CommonObjectRequestParams common_object_request_params = 10; + + // A set of parameters common to all Storage API requests. + CommonRequestParams common_request_params = 11; + + // Mask specifying which fields to read. + // The checksummed_data field and its children will always be present. + // If no mask is specified, will default to all fields except metadata.owner + // and metadata.acl. + // * may be used to mean "all fields". + optional google.protobuf.FieldMask read_mask = 12; +} + +// Response message for GetObject. +message ReadObjectResponse { + // A portion of the data for the object. The service **may** leave `data` + // empty for any given `ReadResponse`. This enables the service to inform the + // client that the request is still live while it is running an operation to + // generate more data. + ChecksummedData checksummed_data = 1; + + // The checksums of the complete object. The client should compute one of + // these checksums over the downloaded object and compare it against the value + // provided here. + ObjectChecksums object_checksums = 2; + + // If read_offset and or read_limit was specified on the + // ReadObjectRequest, ContentRange will be populated on the first + // ReadObjectResponse message of the read stream. + ContentRange content_range = 3; + + // Metadata of the object whose media is being returned. + // Only populated in the first response in the stream. + Object metadata = 4; +} + +// Describes an attempt to insert an object, possibly over multiple requests. +message WriteObjectSpec { + // Destination object, including its name and its metadata. + Object resource = 1; + + // Apply a predefined set of access controls to this object. + PredefinedObjectAcl predefined_acl = 2; + + // Makes the operation conditional on whether the object's current + // generation matches the given value. Setting to 0 makes the operation + // succeed only if there are no live versions of the object. + optional int64 if_generation_match = 3; + + // Makes the operation conditional on whether the object's current + // generation does not match the given value. If no live object exists, the + // precondition fails. Setting to 0 makes the operation succeed only if + // there is a live version of the object. + optional int64 if_generation_not_match = 4; + + // Makes the operation conditional on whether the object's current + // metageneration matches the given value. + optional int64 if_metageneration_match = 5; + + // Makes the operation conditional on whether the object's current + // metageneration does not match the given value. + optional int64 if_metageneration_not_match = 6; +} + +// Request message for WriteObject. +message WriteObjectRequest { + // The first message of each stream should set one of the following. + oneof first_message { + // For resumable uploads. This should be the `upload_id` returned from a + // call to `StartResumableWriteResponse`. + string upload_id = 1; + + // For non-resumable uploads. Describes the overall upload, including the + // destination bucket and object name, preconditions, etc. + WriteObjectSpec write_object_spec = 2; + } + + // Required. The offset from the beginning of the object at which the data should be + // written. + // + // In the first `WriteObjectRequest` of a `WriteObject()` action, it + // indicates the initial offset for the `Write()` call. The value **must** be + // equal to the `committed_size` that a call to `QueryWriteStatus()` would + // return (0 if this is the first write to the object). + // + // On subsequent calls, this value **must** be no larger than the sum of the + // first `write_offset` and the sizes of all `data` chunks sent previously on + // this stream. + // + // An incorrect value will cause an error. + int64 write_offset = 3 [(google.api.field_behavior) = REQUIRED]; + + // A portion of the data for the object. + oneof data { + // The data to insert. If a crc32c checksum is provided that doesn't match + // the checksum computed by the service, the request will fail. + ChecksummedData checksummed_data = 4; + } + + // Checksums for the complete object. If the checksums computed by the service + // don't match the specifified checksums the call will fail. May only be + // provided in the first or last request (either with first_message, or + // finish_write set). + ObjectChecksums object_checksums = 6; + + // If `true`, this indicates that the write is complete. Sending any + // `WriteObjectRequest`s subsequent to one in which `finish_write` is `true` + // will cause an error. + // For a non-resumable write (where the upload_id was not set in the first + // message), it is an error not to set this field in the final message of the + // stream. + bool finish_write = 7; + + // A set of parameters common to Storage API requests concerning an object. + CommonObjectRequestParams common_object_request_params = 8; + + // A set of parameters common to all Storage API requests. + CommonRequestParams common_request_params = 9; +} + +// Response message for WriteObject. +message WriteObjectResponse { + // The response will set one of the following. + oneof write_status { + // The total number of bytes that have been processed for the given object + // from all `WriteObject` calls. Only set if the upload has not finalized. + int64 committed_size = 1; + + // A resource containing the metadata for the uploaded object. Only set if + // the upload has finalized. + Object resource = 2; + } +} + +// Request object for `QueryWriteStatus`. +message QueryWriteStatusRequest { + // Required. The name of the resume token for the object whose write status is being + // requested. + string upload_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // A set of parameters common to Storage API requests concerning an object. + CommonObjectRequestParams common_object_request_params = 2; + + // A set of parameters common to all Storage API requests. + CommonRequestParams common_request_params = 3; +} + +// Response object for `QueryWriteStatus`. +message QueryWriteStatusResponse { + // The response will set one of the following. + oneof write_status { + // The total number of bytes that have been processed for the given object + // from all `WriteObject` calls. This is the correct value for the + // 'write_offset' field to use when resuming the `WriteObject` operation. + // Only set if the upload has not finalized. + int64 committed_size = 1; + + // A resource containing the metadata for the uploaded object. Only set if + // the upload has finalized. + Object resource = 2; + } +} + +// Request message StartResumableWrite. +message StartResumableWriteRequest { + // The destination bucket, object, and metadata, as well as any preconditions. + WriteObjectSpec write_object_spec = 1; + + // A set of parameters common to Storage API requests concerning an object. + CommonObjectRequestParams common_object_request_params = 3; + + // A set of parameters common to all Storage API requests. + CommonRequestParams common_request_params = 4; +} + +// Response object for `StartResumableWrite`. +message StartResumableWriteResponse { + // The upload_id of the newly started resumable write operation. This + // value should be copied into the `WriteObjectRequest.upload_id` field. + string upload_id = 1; +} + +// Parameters that can be passed to any object request. +message CommonObjectRequestParams { + // Encryption algorithm used with Customer-Supplied Encryption Keys feature. + string encryption_algorithm = 1; + + // Encryption key used with Customer-Supplied Encryption Keys feature. + // In raw bytes format (not base64-encoded). + bytes encryption_key_bytes = 4; + + // SHA256 hash of encryption key used with Customer-Supplied Encryption Keys + // feature. + bytes encryption_key_sha256_bytes = 5; +} + +// Parameters that can be passed to any request. +message CommonRequestParams { + // Required. Required when using buckets with Requestor Pays feature enabled. + // Example: `projects/123456`. + string user_project = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; +} + +// Shared constants. +message ServiceConstants { + // A collection of constant values meaningful to the Storage API. + enum Values { + option allow_alias = true; + + // Unused. Proto3 requires first enum to be 0. + VALUES_UNSPECIFIED = 0; + + // The maximum size chunk that can will be returned in a single + // ReadRequest. + // 2 MiB. + MAX_READ_CHUNK_BYTES = 2097152; + + // The maximum size chunk that can be sent in a single WriteObjectRequest. + // 2 MiB. + MAX_WRITE_CHUNK_BYTES = 2097152; + + // The maximum size of an object in MB - whether written in a single stream + // or composed from multiple other objects. + // 5 TiB. + MAX_OBJECT_SIZE_MB = 5242880; + + // The maximum length field name that can be sent in a single + // custom metadata field. + // 1 KiB. + MAX_CUSTOM_METADATA_FIELD_NAME_BYTES = 1024; + + // The maximum length field value that can be sent in a single + // custom_metadata field. + // 4 KiB. + MAX_CUSTOM_METADATA_FIELD_VALUE_BYTES = 4096; + + // The maximum total bytes that can be populated into all field names and + // values of the custom_metadata for one object. + // 8 KiB. + MAX_CUSTOM_METADATA_TOTAL_SIZE_BYTES = 8192; + + // The maximum total bytes that can be populated into all bucket metadata + // fields. + // 20 KiB. + MAX_BUCKET_METADATA_TOTAL_SIZE_BYTES = 20480; + + // The maximum number of NotificationConfigs that can be registered + // for a given bucket. + MAX_NOTIFICATION_CONFIGS_PER_BUCKET = 100; + + // The maximum number of LifecycleRules that can be registered for a given + // bucket. + MAX_LIFECYCLE_RULES_PER_BUCKET = 100; + + // The maximum number of custom attributes per NotificationConfigs. + MAX_NOTIFICATION_CUSTOM_ATTRIBUTES = 5; + + // The maximum length of a custom attribute key included in + // NotificationConfig. + MAX_NOTIFICATION_CUSTOM_ATTRIBUTE_KEY_LENGTH = 256; + + // The maximum length of a custom attribute value included in a + // NotificationConfig. + MAX_NOTIFICATION_CUSTOM_ATTRIBUTE_VALUE_LENGTH = 1024; + + // The maximum number of key/value entries per bucket label. + MAX_LABELS_ENTRIES_COUNT = 64; + + // The maximum character length of the key or value in a bucket + // label map. + MAX_LABELS_KEY_VALUE_LENGTH = 63; + + // The maximum byte size of the key or value in a bucket label + // map. + MAX_LABELS_KEY_VALUE_BYTES = 128; + + // The maximum number of object IDs that can be included in a + // DeleteObjectsRequest. + MAX_OBJECT_IDS_PER_DELETE_OBJECTS_REQUEST = 1000; + + // The maximum number of days for which a token returned by the + // GetListObjectsSplitPoints RPC is valid. + SPLIT_TOKEN_MAX_VALID_DAYS = 14; + } + + +} + +// A bucket. +message Bucket { + option (google.api.resource) = { + type: "storage.googleapis.com/Bucket" + pattern: "projects/{project}/buckets/{bucket}" + }; + + // Billing properties of a bucket. + message Billing { + // When set to true, Requester Pays is enabled for this bucket. + bool requester_pays = 1; + } + + // 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. + message Cors { + // 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; + + // 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; + + // 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; + + // 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; + } + + // Encryption properties of a bucket. + message Encryption { + // 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) = { + type: "cloudkms.googleapis.com/CryptoKey" + }]; + } + + // Bucket restriction options. + message IamConfig { + // Settings for Uniform Bucket level access. + // See https://cloud.google.com/storage/docs/uniform-bucket-level-access. + message UniformBucketLevelAccess { + // If set, access checks only use bucket-level IAM policies or above. + bool enabled = 1; + + // 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 Access Prevention config values. + enum PublicAccessPrevention { + // 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; + + // Prevents access from being granted to public members 'allUsers' and + // 'allAuthenticatedUsers'. Prevents attempts to grant new access to + // public members. + ENFORCED = 1; + } + + // Bucket restriction options currently enforced on the bucket. + UniformBucketLevelAccess uniform_bucket_level_access = 1; + + // Whether IAM will enforce public access prevention. + PublicAccessPrevention public_access_prevention = 2; + } + + // Lifecycle properties of a bucket. + // For more information, see https://cloud.google.com/storage/docs/lifecycle. + message Lifecycle { + // A lifecycle Rule, combining an action to take on an object and a + // condition which will trigger that action. + message Rule { + // An action to take on an object. + message Action { + // Type of the action. Currently, only `Delete` and + // `SetStorageClass` are supported. + string type = 1; + + // Target storage class. Required iff the type of the action is + // SetStorageClass. + string storage_class = 2; + } + + // A condition of an object which triggers some action. + message Condition { + // 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. + optional int32 age_days = 1; + + // This condition is satisfied when an object is created before midnight + // of the specified date in UTC. + google.type.Date created_before = 2; + + // Relevant only for versioned objects. If the value is + // `true`, this condition matches live objects; if the value + // is `false`, it matches archived objects. + optional bool is_live = 3; + + // 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. + optional int32 num_newer_versions = 4; + + // 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; + + // Number of days that have elapsed since the custom timestamp set on an + // object. + // The value of the field must be a nonnegative integer. + optional int32 days_since_custom_time = 7; + + // 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; + + // 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. + optional int32 days_since_noncurrent_time = 9; + + // 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; + } + + // The action to take. + Action action = 1; + + // The condition(s) under which the action will be taken. + Condition condition = 2; + } + + // A lifecycle management rule, which is made of an action to take and the + // condition(s) under which the action will be taken. + repeated Rule rule = 1; + } + + // Logging-related properties of a bucket. + message Logging { + // The destination bucket where the current bucket's logs should be placed. + string log_bucket = 1; + + // A prefix for log object names. + string log_object_prefix = 2; + } + + // Retention policy properties of a bucket. + message RetentionPolicy { + // 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; + + // Once locked, an object retention policy cannot be modified. + bool is_locked = 2; + + // 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; + } + + // Properties of a bucket related to versioning. + // For more on Cloud Storage versioning, see + // https://cloud.google.com/storage/docs/object-versioning. + message Versioning { + // While set to true, versioning is fully enabled for this bucket. + bool enabled = 1; + } + + // Properties of a bucket related to accessing the contents as a static + // website. For more on hosting a static website via Cloud Storage, see + // https://cloud.google.com/storage/docs/hosting-static-website. + message Website { + // If the requested object path is missing, the service will ensure the path + // has a trailing '/', append this suffix, and attempt to retrieve the + // resulting object. This allows the creation of `index.html` + // objects to represent directory pages. + string main_page_suffix = 1; + + // If the requested object path is missing, and any + // `mainPageSuffix` object is missing, if applicable, the service + // will return the named object from this bucket as the content for a + // [https://tools.ietf.org/html/rfc7231#section-6.5.4][404 Not Found] + // result. + string not_found_page = 2; + } + + // Immutable. The name of the bucket. + // Global buckets will be of the format `projects/{project}/buckets/{bucket}`. + // Other sorts of buckets in the future are not guaranteed to follow this + // pattern. + // For globally unique bucket names, a `_` may be substituted for the project + // ID. + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. The user-chosen part of the bucket name. The `{bucket}` portion of the + // `name` field. For globally unique buckets, this is equal to the "bucket + // name" of other Cloud Storage APIs. Example: "pub". + string bucket_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Immutable. The project which owns this bucket. + // Format: projects/{project_number} + // Example: `projects/123456`. + string project = 3 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Output only. The metadata generation of this bucket. + // Attempting to set or update this field will result in a + // [FieldViolation][google.rpc.BadRequest.FieldViolation]. + int64 metageneration = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Immutable. The location of the bucket. Object data for objects in the bucket resides + // in physical storage within this region. Defaults to `US`. See the + // [https://developers.google.com/storage/docs/concepts-techniques#specifyinglocations"][developer's + // guide] for the authoritative list. Attempting to update this field after + // the bucket is created will result in an error. + string location = 5 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. The location type of the bucket (region, dual-region, multi-region, etc). + string location_type = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The bucket's default storage class, used whenever no storageClass is + // specified for a newly-created object. This defines how objects in the + // bucket are stored and determines the SLA and the cost of storage. + // If this value is not specified when the bucket is created, it will default + // to `STANDARD`. For more information, see + // https://developers.google.com/storage/docs/storage-classes. + string storage_class = 7; + + // Access controls on the bucket. + // If iamConfig.uniformBucketLevelAccess is enabled on this bucket, + // requests to set, read, or modify acl is an error. + repeated BucketAccessControl acl = 8; + + // Default access controls to apply to new objects when no ACL is provided. + // If iamConfig.uniformBucketLevelAccess is enabled on this bucket, + // requests to set, read, or modify acl is an error. + repeated ObjectAccessControl default_object_acl = 9; + + // The bucket's lifecycle config. See + // [https://developers.google.com/storage/docs/lifecycle]Lifecycle Management] + // for more information. + Lifecycle lifecycle = 10; + + // Output only. The creation time of the bucket in + // [https://tools.ietf.org/html/rfc3339][RFC 3339] format. + // Attempting to set or update this field will result in a + // [FieldViolation][google.rpc.BadRequest.FieldViolation]. + google.protobuf.Timestamp create_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing] + // (CORS) config. + repeated Cors cors = 12; + + // Output only. The modification time of the bucket. + // Attempting to set or update this field will result in a + // [FieldViolation][google.rpc.BadRequest.FieldViolation]. + google.protobuf.Timestamp update_time = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The default value for event-based hold on newly created objects in this + // bucket. Event-based hold is a way to retain objects indefinitely until an + // event occurs, signified by the + // hold's release. After being released, such objects will be subject to + // bucket-level retention (if any). One sample use case of this flag is for + // banks to hold loan documents for at least 3 years after loan is paid in + // full. Here, bucket-level retention is 3 years and the event is loan being + // paid in full. In this example, these objects will be held intact for any + // number of years until the event has occurred (event-based hold on the + // object is released) and then 3 more years after that. That means retention + // duration of the objects begins from the moment event-based hold + // transitioned from true to false. Objects under event-based hold cannot be + // deleted, overwritten or archived until the hold is removed. + bool default_event_based_hold = 14; + + // User-provided labels, in key/value pairs. + map labels = 15; + + // The bucket's website config, controlling how the service behaves + // when accessing bucket contents as a web site. See the + // [https://cloud.google.com/storage/docs/static-website][Static Website + // Examples] for more information. + Website website = 16; + + // The bucket's versioning config. + Versioning versioning = 17; + + // The bucket's logging config, which defines the destination bucket + // and name prefix (if any) for the current bucket's logs. + Logging logging = 18; + + // Output only. The owner of the bucket. This is always the project team's owner group. + Owner owner = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Encryption config for a bucket. + Encryption encryption = 20; + + // The bucket's billing config. + Billing billing = 21; + + // The bucket's retention policy. The retention policy enforces a minimum + // retention time for all objects contained in the bucket, based on their + // creation time. Any attempt to overwrite or delete objects younger than the + // retention period will result in a PERMISSION_DENIED error. An unlocked + // retention policy can be modified or removed from the bucket via a + // storage.buckets.update operation. A locked retention policy cannot be + // removed or shortened in duration for the lifetime of the bucket. + // Attempting to remove or decrease period of a locked retention policy will + // result in a PERMISSION_DENIED error. + RetentionPolicy retention_policy = 22; + + // The bucket's IAM config. + IamConfig iam_config = 23; + + // Immutable. The zone or zones from which the bucket is intended to use zonal quota. + // Requests for data from outside the specified affinities are still allowed + // but won't be able to use zonal quota. The values are case-insensitive. + // Attempting to update this field after bucket is created will result in an + // error. + repeated string zone_affinity = 24 [(google.api.field_behavior) = IMMUTABLE]; + + // Reserved for future use. + bool satisfies_pzs = 25; +} + +// An access-control entry. +message BucketAccessControl { + // The access permission for the entity. + string role = 1; + + // The ID of the access-control entry. + string id = 2; + + // The entity holding the permission, in one of the following forms: + // * `user-{userid}` + // * `user-{email}` + // * `group-{groupid}` + // * `group-{email}` + // * `domain-{domain}` + // * `project-{team-projectid}` + // * `allUsers` + // * `allAuthenticatedUsers` + // Examples: + // * The user `liz@example.com` would be `user-liz@example.com`. + // * The group `example@googlegroups.com` would be + // `group-example@googlegroups.com` + // * All members of the Google Apps for Business domain `example.com` would be + // `domain-example.com` + string entity = 3; + + // The ID for the entity, if any. + string entity_id = 4; + + // The email address associated with the entity, if any. + string email = 5; + + // The domain associated with the entity, if any. + string domain = 6; + + // The project team associated with the entity, if any. + ProjectTeam project_team = 7; +} + +// Message used to convey content being read or written, along with an optional +// checksum. +message ChecksummedData { + // The data. + bytes content = 1; + + // If set, the CRC32C digest of the content field. + optional fixed32 crc32c = 2; +} + +// Message used for storing full (not subrange) object checksums. +message ObjectChecksums { + // CRC32C digest of the object data. Computed by the Cloud Storage service for + // all written objects. + // If set in an WriteObjectRequest, service will validate that the stored + // object matches this checksum. + optional fixed32 crc32c = 1; + + // 128 bit MD5 hash of the object data. + // For more information about using the MD5 hash, see + // [https://cloud.google.com/storage/docs/hashes-etags#json-api][Hashes and + // ETags: Best Practices]. + // Not all objects will provide an MD5 hash. For example, composite objects + // provide only crc32c hashes. + // This value is equivalent to running `cat object.txt | openssl md5 -binary` + bytes md5_hash = 2; +} + +// An object. +message Object { + // Describes the customer-specified mechanism used to store the data at rest. + message CustomerEncryption { + // The encryption algorithm. + string encryption_algorithm = 1; + + // SHA256 hash value of the encryption key. + string key_sha256 = 2; + } + + // Immutable. The name of this object. Nearly any sequence of unicode characters is + // valid. See + // [Guidelines](https://cloud.google.com/storage/docs/naming-objects). + // Example: `test.txt` + // The `name` field by itself does not uniquely identify a Cloud Storage + // object. A Cloud Storage object is uniquely identified by the tuple of + // (bucket, object, generation). + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. The name of the bucket containing this object. + // Example: `projects/_/buckets/foo`. + string bucket = 2 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "storage.googleapis.com/Bucket" + } + ]; + + // Immutable. The content generation of this object. Used for object versioning. + // Attempting to set or update this field will result in a + // [FieldViolation][google.rpc.BadRequest.FieldViolation]. + int64 generation = 3 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. The version of the metadata for this generation of this object. Used for + // preconditions and for detecting changes in metadata. A metageneration + // number is only meaningful in the context of a particular generation of a + // particular object. + // Attempting to set or update this field will result in a + // [FieldViolation][google.rpc.BadRequest.FieldViolation]. + int64 metageneration = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Storage class of the object. + string storage_class = 5; + + // Output only. Content-Length of the object data in bytes, matching + // [https://tools.ietf.org/html/rfc7230#section-3.3.2][RFC 7230 §3.3.2]. + // Attempting to set or update this field will result in a + // [FieldViolation][google.rpc.BadRequest.FieldViolation]. + int64 size = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Content-Encoding of the object data, matching + // [https://tools.ietf.org/html/rfc7231#section-3.1.2.2][RFC 7231 §3.1.2.2] + string content_encoding = 7; + + // Content-Disposition of the object data, matching + // [https://tools.ietf.org/html/rfc6266][RFC 6266]. + string content_disposition = 8; + + // Cache-Control directive for the object data, matching + // [https://tools.ietf.org/html/rfc7234#section-5.2"][RFC 7234 §5.2]. + // If omitted, and the object is accessible to all anonymous users, the + // default will be `public, max-age=3600`. + string cache_control = 9; + + // Access controls on the object. + // If iamConfig.uniformBucketLevelAccess is enabled on the parent + // bucket, requests to set, read, or modify acl is an error. + repeated ObjectAccessControl acl = 10; + + // Content-Language of the object data, matching + // [https://tools.ietf.org/html/rfc7231#section-3.1.3.2][RFC 7231 §3.1.3.2]. + string content_language = 11; + + // Output only. The deletion time of the object. Will be returned if and only if this + // version of the object has been deleted. + // Attempting to set or update this field will result in a + // [FieldViolation][google.rpc.BadRequest.FieldViolation]. + google.protobuf.Timestamp delete_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Content-Type of the object data, matching + // [https://tools.ietf.org/html/rfc7231#section-3.1.1.5][RFC 7231 §3.1.1.5]. + // If an object is stored without a Content-Type, it is served as + // `application/octet-stream`. + string content_type = 13; + + // Output only. The creation time of the object. + // Attempting to set or update this field will result in a + // [FieldViolation][google.rpc.BadRequest.FieldViolation]. + google.protobuf.Timestamp create_time = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Number of underlying components that make up this object. Components are + // accumulated by compose operations. + // Attempting to set or update this field will result in a + // [FieldViolation][google.rpc.BadRequest.FieldViolation]. + int32 component_count = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Hashes for the data part of this object. + ObjectChecksums checksums = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The modification time of the object metadata. + // Attempting to set or update this field will result in a + // [FieldViolation][google.rpc.BadRequest.FieldViolation]. + google.protobuf.Timestamp update_time = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Cloud KMS Key used to encrypt this object, if the object is encrypted by + // such a key. + string kms_key = 18 [(google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + }]; + + // Output only. The time at which the object's storage class was last changed. When the + // object is initially created, it will be set to time_created. + // Attempting to set or update this field will result in a + // [FieldViolation][google.rpc.BadRequest.FieldViolation]. + google.protobuf.Timestamp update_storage_class_time = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Whether an object is under temporary hold. While this flag is set to true, + // the object is protected against deletion and overwrites. A common use case + // of this flag is regulatory investigations where objects need to be retained + // while the investigation is ongoing. Note that unlike event-based hold, + // temporary hold does not impact retention expiration time of an object. + bool temporary_hold = 20; + + // A server-determined value that specifies the earliest time that the + // object's retention period expires. This value is in + // [https://tools.ietf.org/html/rfc3339][RFC 3339] format. + // Note 1: This field is not provided for objects with an active event-based + // hold, since retention expiration is unknown until the hold is removed. + // Note 2: This value can be provided even when temporary hold is set (so that + // the user can reason about policy without having to first unset the + // temporary hold). + google.protobuf.Timestamp retention_expire_time = 21; + + // User-provided metadata, in key/value pairs. + map metadata = 22; + + // Whether an object is under event-based hold. + // An event-based hold is a way to force the retention of an object until + // after some event occurs. Once the hold is released by explicitly setting + // this field to false, the object will become subject to any bucket-level + // retention policy, except that the retention duration will be calculated + // from the time the event based hold was lifted, rather than the time the + // object was created. + // + // In a WriteObject request, not setting this field implies that the value + // should be taken from the parent bucket's "default_event_based_hold" field. + // In a response, this field will always be set to true or false. + optional bool event_based_hold = 23; + + // Output only. The owner of the object. This will always be the uploader of the object. + // Attempting to set or update this field will result in a + // [FieldViolation][google.rpc.BadRequest.FieldViolation]. + Owner owner = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Metadata of customer-supplied encryption key, if the object is encrypted by + // such a key. + CustomerEncryption customer_encryption = 25; + + // A user-specified timestamp set on an object. + google.protobuf.Timestamp custom_time = 26; +} + +// An access-control entry. +message ObjectAccessControl { + // The access permission for the entity. + string role = 1; + + // The ID of the access-control entry. + string id = 2; + + // The entity holding the permission, in one of the following forms: + // * `user-{userid}` + // * `user-{email}` + // * `group-{groupid}` + // * `group-{email}` + // * `domain-{domain}` + // * `project-{team-projectid}` + // * `allUsers` + // * `allAuthenticatedUsers` + // Examples: + // * The user `liz@example.com` would be `user-liz@example.com`. + // * The group `example@googlegroups.com` would be + // `group-example@googlegroups.com`. + // * All members of the Google Apps for Business domain `example.com` would be + // `domain-example.com`. + string entity = 3; + + // The ID for the entity, if any. + string entity_id = 4; + + // The email address associated with the entity, if any. + string email = 5; + + // The domain associated with the entity, if any. + string domain = 6; + + // The project team associated with the entity, if any. + ProjectTeam project_team = 7; +} + +// Represents the Viewers, Editors, or Owners of a given project. +message ProjectTeam { + // The project number. + string project_number = 1; + + // The team. + string team = 2; +} + +// The owner of a specific resource. +message Owner { + // The entity, in the form `user-`*userId*. + string entity = 1; + + // The ID for the entity. + string entity_id = 2; +} + +// Specifies a requested range of bytes to download. +message ContentRange { + // The starting offset of the object data. + int64 start = 1; + + // The ending offset of the object data. + int64 end = 2; + + // The complete length of the object data. + int64 complete_length = 3; +} + +// Predefined or "canned" aliases for sets of specific object ACL entries. +enum PredefinedObjectAcl { + // No predefined ACL. + PREDEFINED_OBJECT_ACL_UNSPECIFIED = 0; + + // Object owner gets `OWNER` access, and + // `allAuthenticatedUsers` get `READER` access. + OBJECT_ACL_AUTHENTICATED_READ = 1; + + // Object owner gets `OWNER` access, and project team owners get + // `OWNER` access. + OBJECT_ACL_BUCKET_OWNER_FULL_CONTROL = 2; + + // Object owner gets `OWNER` access, and project team owners get + // `READER` access. + OBJECT_ACL_BUCKET_OWNER_READ = 3; + + // Object owner gets `OWNER` access. + OBJECT_ACL_PRIVATE = 4; + + // Object owner gets `OWNER` access, and project team members get + // access according to their roles. + OBJECT_ACL_PROJECT_PRIVATE = 5; + + // Object owner gets `OWNER` access, and `allUsers` + // get `READER` access. + OBJECT_ACL_PUBLIC_READ = 6; +} diff --git a/synth.metadata b/synth.metadata index 53a1c2fa44..2a33b22f5e 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,7 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-storage.git", - "sha": "22755f009d83fd440dc46992a3913a1a6539a0ec" + "sha": "0ea286b335ef98feb3ae00437357d62eb2a917bd" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "eb7c9d1c3915851dd8b357ee950e0467490bce34" } }, { @@ -15,6 +22,17 @@ } } ], + "destinations": [ + { + "client": { + "source": "googleapis", + "apiName": "storage", + "apiVersion": "v2", + "language": "java", + "generator": "bazel" + } + } + ], "generatedFiles": [ ".github/CODEOWNERS", ".github/ISSUE_TEMPLATE/bug_report.md", @@ -81,8 +99,66 @@ "LICENSE", "SECURITY.md", "codecov.yaml", + "gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageClient.java", + "gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageSettings.java", + "gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/gapic_metadata.json", + "gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/package-info.java", + "gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/GrpcStorageCallableFactory.java", + "gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/GrpcStorageStub.java", + "gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/StorageStub.java", + "gapic-google-cloud-storage-v2/src/main/java/com/google/storage/v2/stub/StorageStubSettings.java", + "gapic-google-cloud-storage-v2/src/main/resources/com/google/storage/v2/gapic_metadata.json", + "gapic-google-cloud-storage-v2/src/test/java/com/google/storage/v2/MockStorage.java", + "gapic-google-cloud-storage-v2/src/test/java/com/google/storage/v2/MockStorageImpl.java", + "gapic-google-cloud-storage-v2/src/test/java/com/google/storage/v2/StorageClientTest.java", + "grpc-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageGrpc.java", "java.header", "license-checks.xml", + "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/Bucket.java", + "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BucketAccessControl.java", + "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BucketAccessControlOrBuilder.java", + "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/BucketOrBuilder.java", + "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ChecksummedData.java", + "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ChecksummedDataOrBuilder.java", + "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CommonObjectRequestParams.java", + "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CommonObjectRequestParamsOrBuilder.java", + "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CommonRequestParams.java", + "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/CommonRequestParamsOrBuilder.java", + "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ContentRange.java", + "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ContentRangeOrBuilder.java", + "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/Object.java", + "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectAccessControl.java", + "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectAccessControlOrBuilder.java", + "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectChecksums.java", + "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectChecksumsOrBuilder.java", + "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ObjectOrBuilder.java", + "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/Owner.java", + "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/OwnerOrBuilder.java", + "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/PredefinedObjectAcl.java", + "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ProjectTeam.java", + "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ProjectTeamOrBuilder.java", + "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/QueryWriteStatusRequest.java", + "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/QueryWriteStatusRequestOrBuilder.java", + "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/QueryWriteStatusResponse.java", + "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/QueryWriteStatusResponseOrBuilder.java", + "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadObjectRequest.java", + "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadObjectRequestOrBuilder.java", + "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadObjectResponse.java", + "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ReadObjectResponseOrBuilder.java", + "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ServiceConstants.java", + "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/ServiceConstantsOrBuilder.java", + "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteRequest.java", + "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteRequestOrBuilder.java", + "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteResponse.java", + "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StartResumableWriteResponseOrBuilder.java", + "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/StorageProto.java", + "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectRequest.java", + "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectRequestOrBuilder.java", + "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectResponse.java", + "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectResponseOrBuilder.java", + "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectSpec.java", + "proto-google-cloud-storage-v2/src/main/java/com/google/storage/v2/WriteObjectSpecOrBuilder.java", + "proto-google-cloud-storage-v2/src/main/proto/google/storage/v2/storage.proto", "renovate.json", "samples/install-without-bom/pom.xml", "samples/pom.xml",