From 578d5d01f4469409b6d8731bbdc965ab224956ad Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 9 Jan 2024 12:34:23 -0800 Subject: [PATCH] fix(deps): Update the Java code generator (gapic-generator-java) to 2.31.0 (#2349) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(deps): Update the Java code generator (gapic-generator-java) to 2.31.0 PiperOrigin-RevId: 596645164 Source-Link: /~https://github.com/googleapis/googleapis/commit/4a0e62ecde2a6459bea8722a33173cfce1e9fb50 Source-Link: /~https://github.com/googleapis/googleapis-gen/commit/a10ed6a77676c37e60799098d48d0afb16008613 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYTEwZWQ2YTc3Njc2YzM3ZTYwNzk5MDk4ZDQ4ZDBhZmIxNjAwODYxMyJ9 feat: add Storage Control API PiperOrigin-RevId: 596130676 Source-Link: /~https://github.com/googleapis/googleapis/commit/ce07d240009d903a0422f931be1b6b56a926220f Source-Link: /~https://github.com/googleapis/googleapis-gen/commit/7de5bf064581832c3fff93ab51b4c0b1d0d14aa1 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiN2RlNWJmMDY0NTgxODMyYzNmZmY5M2FiNTFiNGMwYjFkMGQxNGFhMSJ9 * 🦉 Updates from OwlBot post-processor See /~https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Add storage-control pom.xml and use alpha suffix * Add google-cloud-storage-control to modules * use for proto in google-cloud-storage-control * chore(fix): fixed Owlbot configuration file * chore: added generated code * applied the current version * chore: added the test dependency to the grpc artifact * removed unused dependencies * update storage-control group:com.google.cloud version: *-alpha * 🦉 Updates from OwlBot post-processor See /~https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * revert comment changes in StorageClient.java * remove method table from storage control * lint * 🦉 Updates from OwlBot post-processor See /~https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot Co-authored-by: Frank Natividad Co-authored-by: Tomo Suzuki --- .github/.OwlBot.yaml | 4 + .../storage/v2/stub/StorageStubSettings.java | 6 + google-cloud-storage-bom/pom.xml | 15 + google-cloud-storage-control/pom.xml | 102 + .../control/v2/StorageControlClient.java | 1097 ++++++ .../control/v2/StorageControlSettings.java | 258 ++ .../storage/control/v2/gapic_metadata.json | 36 + .../storage/control/v2/package-info.java | 45 + .../GrpcStorageControlCallableFactory.java | 113 + .../v2/stub/GrpcStorageControlStub.java | 351 ++ .../control/v2/stub/StorageControlStub.java | 87 + .../v2/stub/StorageControlStubSettings.java | 547 +++ .../reflect-config.json | 1523 +++++++++ .../storage/control/v2/gapic_metadata.json | 36 + .../control/v2/MockStorageControl.java | 59 + .../control/v2/MockStorageControlImpl.java | 185 + .../control/v2/StorageControlClientTest.java | 612 ++++ grpc-google-cloud-storage-control-v2/pom.xml | 69 + .../control/v2/StorageControlGrpc.java | 947 ++++++ pom.xml | 18 + .../clirr-ignored-differences.xml | 19 + proto-google-cloud-storage-control-v2/pom.xml | 42 + .../google/storage/control/v2/BucketName.java | 191 ++ .../CommonLongRunningOperationMetadata.java | 1657 +++++++++ ...LongRunningOperationMetadataOrBuilder.java | 191 ++ .../control/v2/CreateFolderRequest.java | 1435 ++++++++ .../v2/CreateFolderRequestOrBuilder.java | 173 + .../control/v2/DeleteFolderRequest.java | 1128 +++++++ .../v2/DeleteFolderRequestOrBuilder.java | 143 + .../com/google/storage/control/v2/Folder.java | 1629 +++++++++ .../google/storage/control/v2/FolderName.java | 218 ++ .../storage/control/v2/FolderOrBuilder.java | 195 ++ .../storage/control/v2/GetFolderRequest.java | 1120 +++++++ .../control/v2/GetFolderRequestOrBuilder.java | 141 + .../control/v2/GetStorageLayoutRequest.java | 1038 ++++++ .../v2/GetStorageLayoutRequestOrBuilder.java | 114 + .../control/v2/ListFoldersRequest.java | 1918 +++++++++++ .../v2/ListFoldersRequestOrBuilder.java | 244 ++ .../control/v2/ListFoldersResponse.java | 1123 +++++++ .../v2/ListFoldersResponseOrBuilder.java | 103 + .../storage/control/v2/PendingRenameInfo.java | 624 ++++ .../v2/PendingRenameInfoOrBuilder.java | 50 + .../control/v2/RenameFolderMetadata.java | 1090 ++++++ .../v2/RenameFolderMetadataOrBuilder.java | 111 + .../control/v2/RenameFolderRequest.java | 1310 ++++++++ .../v2/RenameFolderRequestOrBuilder.java | 168 + .../control/v2/StorageControlProto.java | 392 +++ .../storage/control/v2/StorageLayout.java | 2962 +++++++++++++++++ .../storage/control/v2/StorageLayoutName.java | 191 ++ .../control/v2/StorageLayoutOrBuilder.java | 194 ++ .../storage/control/v2/storage_control.proto | 427 +++ versions.txt | 3 + 52 files changed, 26454 insertions(+) create mode 100644 google-cloud-storage-control/pom.xml create mode 100644 google-cloud-storage-control/src/main/java/com/google/storage/control/v2/StorageControlClient.java create mode 100644 google-cloud-storage-control/src/main/java/com/google/storage/control/v2/StorageControlSettings.java create mode 100644 google-cloud-storage-control/src/main/java/com/google/storage/control/v2/gapic_metadata.json create mode 100644 google-cloud-storage-control/src/main/java/com/google/storage/control/v2/package-info.java create mode 100644 google-cloud-storage-control/src/main/java/com/google/storage/control/v2/stub/GrpcStorageControlCallableFactory.java create mode 100644 google-cloud-storage-control/src/main/java/com/google/storage/control/v2/stub/GrpcStorageControlStub.java create mode 100644 google-cloud-storage-control/src/main/java/com/google/storage/control/v2/stub/StorageControlStub.java create mode 100644 google-cloud-storage-control/src/main/java/com/google/storage/control/v2/stub/StorageControlStubSettings.java create mode 100644 google-cloud-storage-control/src/main/resources/META-INF/native-image/com.google.storage.control.v2/reflect-config.json create mode 100644 google-cloud-storage-control/src/main/resources/com/google/storage/control/v2/gapic_metadata.json create mode 100644 google-cloud-storage-control/src/test/java/com/google/storage/control/v2/MockStorageControl.java create mode 100644 google-cloud-storage-control/src/test/java/com/google/storage/control/v2/MockStorageControlImpl.java create mode 100644 google-cloud-storage-control/src/test/java/com/google/storage/control/v2/StorageControlClientTest.java create mode 100644 grpc-google-cloud-storage-control-v2/pom.xml create mode 100644 grpc-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/StorageControlGrpc.java create mode 100644 proto-google-cloud-storage-control-v2/clirr-ignored-differences.xml create mode 100644 proto-google-cloud-storage-control-v2/pom.xml create mode 100644 proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/BucketName.java create mode 100644 proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/CommonLongRunningOperationMetadata.java create mode 100644 proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/CommonLongRunningOperationMetadataOrBuilder.java create mode 100644 proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/CreateFolderRequest.java create mode 100644 proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/CreateFolderRequestOrBuilder.java create mode 100644 proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/DeleteFolderRequest.java create mode 100644 proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/DeleteFolderRequestOrBuilder.java create mode 100644 proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/Folder.java create mode 100644 proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/FolderName.java create mode 100644 proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/FolderOrBuilder.java create mode 100644 proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/GetFolderRequest.java create mode 100644 proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/GetFolderRequestOrBuilder.java create mode 100644 proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/GetStorageLayoutRequest.java create mode 100644 proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/GetStorageLayoutRequestOrBuilder.java create mode 100644 proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/ListFoldersRequest.java create mode 100644 proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/ListFoldersRequestOrBuilder.java create mode 100644 proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/ListFoldersResponse.java create mode 100644 proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/ListFoldersResponseOrBuilder.java create mode 100644 proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/PendingRenameInfo.java create mode 100644 proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/PendingRenameInfoOrBuilder.java create mode 100644 proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/RenameFolderMetadata.java create mode 100644 proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/RenameFolderMetadataOrBuilder.java create mode 100644 proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/RenameFolderRequest.java create mode 100644 proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/RenameFolderRequestOrBuilder.java create mode 100644 proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/StorageControlProto.java create mode 100644 proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/StorageLayout.java create mode 100644 proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/StorageLayoutName.java create mode 100644 proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/StorageLayoutOrBuilder.java create mode 100644 proto-google-cloud-storage-control-v2/src/main/proto/google/storage/control/v2/storage_control.proto diff --git a/.github/.OwlBot.yaml b/.github/.OwlBot.yaml index 133b9c9e04..fabe0890b8 100644 --- a/.github/.OwlBot.yaml +++ b/.github/.OwlBot.yaml @@ -32,5 +32,9 @@ deep-copy-regex: dest: "/owl-bot-staging/v2/gapic-google-cloud-storage-v2/src/main/resources/com/google/storage/v2/gapic_metadata.json" - source: "/google/storage/control/v2/.*-java/proto-google-.*/src" dest: "/owl-bot-staging/v2/proto-google-cloud-storage-control-v2/src" +- source: "/google/storage/control/v2/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/v2/grpc-google-cloud-storage-control-v2/src" - source: "/google/storage/control/v2/.*-java/gapic-google-.*/src" dest: "/owl-bot-staging/v2/google-cloud-storage-control/src" +- source: "/google/storage/control/v2/.*-java/gapic-google-cloud-storage-control-v2-java/src/main/java/com/google/storage/control/v2/gapic_metadata.json" + dest: "/owl-bot-staging/v2/google-cloud-storage-control/src/main/resources/com/google/storage/control/v2/gapic_metadata.json" 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 index 6e3ca7db38..ed16ca270f 100644 --- 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 @@ -626,6 +626,12 @@ public StorageStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "storage"; + } + /** Returns a builder for the default ExecutorProvider for this service. */ public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { return InstantiatingExecutorProvider.newBuilder(); diff --git a/google-cloud-storage-bom/pom.xml b/google-cloud-storage-bom/pom.xml index 50a24d97ff..808551b06c 100644 --- a/google-cloud-storage-bom/pom.xml +++ b/google-cloud-storage-bom/pom.xml @@ -86,6 +86,21 @@ proto-google-cloud-storage-v2 2.30.1-alpha + + com.google.cloud + google-cloud-storage-control + 2.30.1-alpha + + + com.google.api.grpc + grpc-google-cloud-storage-control-v2 + 2.30.1-alpha + + + com.google.api.grpc + proto-google-cloud-storage-control-v2 + 2.30.1-alpha + diff --git a/google-cloud-storage-control/pom.xml b/google-cloud-storage-control/pom.xml new file mode 100644 index 0000000000..d48a078b79 --- /dev/null +++ b/google-cloud-storage-control/pom.xml @@ -0,0 +1,102 @@ + + + 4.0.0 + com.google.cloud + google-cloud-storage-control + 2.30.1-alpha + google-cloud-storage-control + GRPC library for google-cloud-storage-control + + com.google.cloud + google-cloud-storage-parent + 2.30.1 + + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-cloud-storage-control-v2 + + + com.google.api.grpc + proto-google-common-protos + + + org.threeten + threetenbp + + + com.google.api + api-common + + + com.google.api + gax + + + + com.google.api + gax-grpc + + + com.google.guava + guava + + + junit + junit + + + + com.google.api + gax-grpc + testlib + test + + + com.google.api.grpc + grpc-google-cloud-storage-control-v2 + test + + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + + 8 + 8 + UTF-8 + + + diff --git a/google-cloud-storage-control/src/main/java/com/google/storage/control/v2/StorageControlClient.java b/google-cloud-storage-control/src/main/java/com/google/storage/control/v2/StorageControlClient.java new file mode 100644 index 0000000000..46d7d7627e --- /dev/null +++ b/google-cloud-storage-control/src/main/java/com/google/storage/control/v2/StorageControlClient.java @@ -0,0 +1,1097 @@ +/* + * Copyright 2023 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.control.v2; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import com.google.protobuf.Empty; +import com.google.storage.control.v2.stub.StorageControlStub; +import com.google.storage.control.v2.stub.StorageControlStubSettings; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: StorageControl service includes selected control plane operations. + * + *

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

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (StorageControlClient storageControlClient = StorageControlClient.create()) {
+ *   BucketName parent = BucketName.of("[PROJECT]", "[BUCKET]");
+ *   Folder folder = Folder.newBuilder().build();
+ *   String folderId = "folderId294109737";
+ *   Folder response = storageControlClient.createFolder(parent, folder, folderId);
+ * }
+ * }
+ * + *

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

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 StorageControlSettings to + * create(). For example: + * + *

To customize credentials: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * StorageControlSettings storageControlSettings =
+ *     StorageControlSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * StorageControlClient storageControlClient = StorageControlClient.create(storageControlSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * StorageControlSettings storageControlSettings =
+ *     StorageControlSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * StorageControlClient storageControlClient = StorageControlClient.create(storageControlSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class StorageControlClient implements BackgroundResource { + private final StorageControlSettings settings; + private final StorageControlStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of StorageControlClient with default settings. */ + public static final StorageControlClient create() throws IOException { + return create(StorageControlSettings.newBuilder().build()); + } + + /** + * Constructs an instance of StorageControlClient, 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 StorageControlClient create(StorageControlSettings settings) + throws IOException { + return new StorageControlClient(settings); + } + + /** + * Constructs an instance of StorageControlClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(StorageControlSettings). + */ + public static final StorageControlClient create(StorageControlStub stub) { + return new StorageControlClient(stub); + } + + /** + * Constructs an instance of StorageControlClient, 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 StorageControlClient(StorageControlSettings settings) throws IOException { + this.settings = settings; + this.stub = ((StorageControlStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + protected StorageControlClient(StorageControlStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final StorageControlSettings getSettings() { + return settings; + } + + public StorageControlStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new folder. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (StorageControlClient storageControlClient = StorageControlClient.create()) {
+   *   BucketName parent = BucketName.of("[PROJECT]", "[BUCKET]");
+   *   Folder folder = Folder.newBuilder().build();
+   *   String folderId = "folderId294109737";
+   *   Folder response = storageControlClient.createFolder(parent, folder, folderId);
+   * }
+   * }
+ * + * @param parent Required. Name of the bucket in which the folder will reside. + * @param folder Required. Properties of the new folder being created. The bucket and name of the + * folder are specified in the parent and folder_id fields, respectively. Populating those + * fields in `folder` will result in an error. + * @param folderId Required. The absolute path of the folder, using a single `/` as delimiter. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Folder createFolder(BucketName parent, Folder folder, String folderId) { + CreateFolderRequest request = + CreateFolderRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setFolder(folder) + .setFolderId(folderId) + .build(); + return createFolder(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new folder. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (StorageControlClient storageControlClient = StorageControlClient.create()) {
+   *   String parent = BucketName.of("[PROJECT]", "[BUCKET]").toString();
+   *   Folder folder = Folder.newBuilder().build();
+   *   String folderId = "folderId294109737";
+   *   Folder response = storageControlClient.createFolder(parent, folder, folderId);
+   * }
+   * }
+ * + * @param parent Required. Name of the bucket in which the folder will reside. + * @param folder Required. Properties of the new folder being created. The bucket and name of the + * folder are specified in the parent and folder_id fields, respectively. Populating those + * fields in `folder` will result in an error. + * @param folderId Required. The absolute path of the folder, using a single `/` as delimiter. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Folder createFolder(String parent, Folder folder, String folderId) { + CreateFolderRequest request = + CreateFolderRequest.newBuilder() + .setParent(parent) + .setFolder(folder) + .setFolderId(folderId) + .build(); + return createFolder(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new folder. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (StorageControlClient storageControlClient = StorageControlClient.create()) {
+   *   CreateFolderRequest request =
+   *       CreateFolderRequest.newBuilder()
+   *           .setParent(BucketName.of("[PROJECT]", "[BUCKET]").toString())
+   *           .setFolder(Folder.newBuilder().build())
+   *           .setFolderId("folderId294109737")
+   *           .setRecursive(true)
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   Folder response = storageControlClient.createFolder(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 Folder createFolder(CreateFolderRequest request) { + return createFolderCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new folder. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (StorageControlClient storageControlClient = StorageControlClient.create()) {
+   *   CreateFolderRequest request =
+   *       CreateFolderRequest.newBuilder()
+   *           .setParent(BucketName.of("[PROJECT]", "[BUCKET]").toString())
+   *           .setFolder(Folder.newBuilder().build())
+   *           .setFolderId("folderId294109737")
+   *           .setRecursive(true)
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future = storageControlClient.createFolderCallable().futureCall(request);
+   *   // Do something.
+   *   Folder response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createFolderCallable() { + return stub.createFolderCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Permanently deletes an empty folder. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (StorageControlClient storageControlClient = StorageControlClient.create()) {
+   *   FolderName name = FolderName.of("[PROJECT]", "[BUCKET]", "[FOLDER]");
+   *   storageControlClient.deleteFolder(name);
+   * }
+   * }
+ * + * @param name Required. Name of the folder. Format: + * `projects/{project}/buckets/{bucket}/folders/{folder}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteFolder(FolderName name) { + DeleteFolderRequest request = + DeleteFolderRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteFolder(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Permanently deletes an empty folder. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (StorageControlClient storageControlClient = StorageControlClient.create()) {
+   *   String name = FolderName.of("[PROJECT]", "[BUCKET]", "[FOLDER]").toString();
+   *   storageControlClient.deleteFolder(name);
+   * }
+   * }
+ * + * @param name Required. Name of the folder. Format: + * `projects/{project}/buckets/{bucket}/folders/{folder}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteFolder(String name) { + DeleteFolderRequest request = DeleteFolderRequest.newBuilder().setName(name).build(); + deleteFolder(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Permanently deletes an empty folder. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (StorageControlClient storageControlClient = StorageControlClient.create()) {
+   *   DeleteFolderRequest request =
+   *       DeleteFolderRequest.newBuilder()
+   *           .setName(FolderName.of("[PROJECT]", "[BUCKET]", "[FOLDER]").toString())
+   *           .setIfMetagenerationMatch(1043427781)
+   *           .setIfMetagenerationNotMatch(1025430873)
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   storageControlClient.deleteFolder(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 void deleteFolder(DeleteFolderRequest request) { + deleteFolderCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Permanently deletes an empty folder. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (StorageControlClient storageControlClient = StorageControlClient.create()) {
+   *   DeleteFolderRequest request =
+   *       DeleteFolderRequest.newBuilder()
+   *           .setName(FolderName.of("[PROJECT]", "[BUCKET]", "[FOLDER]").toString())
+   *           .setIfMetagenerationMatch(1043427781)
+   *           .setIfMetagenerationNotMatch(1025430873)
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future = storageControlClient.deleteFolderCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteFolderCallable() { + return stub.deleteFolderCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns metadata for the specified folder. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (StorageControlClient storageControlClient = StorageControlClient.create()) {
+   *   FolderName name = FolderName.of("[PROJECT]", "[BUCKET]", "[FOLDER]");
+   *   Folder response = storageControlClient.getFolder(name);
+   * }
+   * }
+ * + * @param name Required. Name of the folder. Format: + * `projects/{project}/buckets/{bucket}/folders/{folder}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Folder getFolder(FolderName name) { + GetFolderRequest request = + GetFolderRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getFolder(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns metadata for the specified folder. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (StorageControlClient storageControlClient = StorageControlClient.create()) {
+   *   String name = FolderName.of("[PROJECT]", "[BUCKET]", "[FOLDER]").toString();
+   *   Folder response = storageControlClient.getFolder(name);
+   * }
+   * }
+ * + * @param name Required. Name of the folder. Format: + * `projects/{project}/buckets/{bucket}/folders/{folder}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Folder getFolder(String name) { + GetFolderRequest request = GetFolderRequest.newBuilder().setName(name).build(); + return getFolder(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns metadata for the specified folder. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (StorageControlClient storageControlClient = StorageControlClient.create()) {
+   *   GetFolderRequest request =
+   *       GetFolderRequest.newBuilder()
+   *           .setName(FolderName.of("[PROJECT]", "[BUCKET]", "[FOLDER]").toString())
+   *           .setIfMetagenerationMatch(1043427781)
+   *           .setIfMetagenerationNotMatch(1025430873)
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   Folder response = storageControlClient.getFolder(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 Folder getFolder(GetFolderRequest request) { + return getFolderCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns metadata for the specified folder. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (StorageControlClient storageControlClient = StorageControlClient.create()) {
+   *   GetFolderRequest request =
+   *       GetFolderRequest.newBuilder()
+   *           .setName(FolderName.of("[PROJECT]", "[BUCKET]", "[FOLDER]").toString())
+   *           .setIfMetagenerationMatch(1043427781)
+   *           .setIfMetagenerationNotMatch(1025430873)
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future = storageControlClient.getFolderCallable().futureCall(request);
+   *   // Do something.
+   *   Folder response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getFolderCallable() { + return stub.getFolderCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a list of folders for a given bucket. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (StorageControlClient storageControlClient = StorageControlClient.create()) {
+   *   BucketName parent = BucketName.of("[PROJECT]", "[BUCKET]");
+   *   for (Folder element : storageControlClient.listFolders(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Name of the bucket in which to look for folders. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListFoldersPagedResponse listFolders(BucketName parent) { + ListFoldersRequest request = + ListFoldersRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listFolders(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a list of folders for a given bucket. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (StorageControlClient storageControlClient = StorageControlClient.create()) {
+   *   String parent = BucketName.of("[PROJECT]", "[BUCKET]").toString();
+   *   for (Folder element : storageControlClient.listFolders(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. Name of the bucket in which to look for folders. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListFoldersPagedResponse listFolders(String parent) { + ListFoldersRequest request = ListFoldersRequest.newBuilder().setParent(parent).build(); + return listFolders(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a list of folders for a given bucket. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (StorageControlClient storageControlClient = StorageControlClient.create()) {
+   *   ListFoldersRequest request =
+   *       ListFoldersRequest.newBuilder()
+   *           .setParent(BucketName.of("[PROJECT]", "[BUCKET]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setPrefix("prefix-980110702")
+   *           .setDelimiter("delimiter-250518009")
+   *           .setLexicographicStart("lexicographicStart-2093413008")
+   *           .setLexicographicEnd("lexicographicEnd1646968169")
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   for (Folder element : storageControlClient.listFolders(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListFoldersPagedResponse listFolders(ListFoldersRequest request) { + return listFoldersPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a list of folders for a given bucket. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (StorageControlClient storageControlClient = StorageControlClient.create()) {
+   *   ListFoldersRequest request =
+   *       ListFoldersRequest.newBuilder()
+   *           .setParent(BucketName.of("[PROJECT]", "[BUCKET]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setPrefix("prefix-980110702")
+   *           .setDelimiter("delimiter-250518009")
+   *           .setLexicographicStart("lexicographicStart-2093413008")
+   *           .setLexicographicEnd("lexicographicEnd1646968169")
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future =
+   *       storageControlClient.listFoldersPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Folder element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listFoldersPagedCallable() { + return stub.listFoldersPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves a list of folders for a given bucket. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (StorageControlClient storageControlClient = StorageControlClient.create()) {
+   *   ListFoldersRequest request =
+   *       ListFoldersRequest.newBuilder()
+   *           .setParent(BucketName.of("[PROJECT]", "[BUCKET]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setPrefix("prefix-980110702")
+   *           .setDelimiter("delimiter-250518009")
+   *           .setLexicographicStart("lexicographicStart-2093413008")
+   *           .setLexicographicEnd("lexicographicEnd1646968169")
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   while (true) {
+   *     ListFoldersResponse response = storageControlClient.listFoldersCallable().call(request);
+   *     for (Folder element : response.getFoldersList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listFoldersCallable() { + return stub.listFoldersCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Renames a source folder to a destination folder. During a rename, the source and destination + * folders are locked until the long running operation completes. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (StorageControlClient storageControlClient = StorageControlClient.create()) {
+   *   FolderName name = FolderName.of("[PROJECT]", "[BUCKET]", "[FOLDER]");
+   *   String destinationFolderId = "destinationFolderId-480084905";
+   *   Folder response = storageControlClient.renameFolderAsync(name, destinationFolderId).get();
+   * }
+   * }
+ * + * @param name Required. Name of the source folder being renamed. Format: + * `projects/{project}/buckets/{bucket}/folders/{folder}` + * @param destinationFolderId Required. The destination folder ID, e.g. `foo/bar/`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture renameFolderAsync( + FolderName name, String destinationFolderId) { + RenameFolderRequest request = + RenameFolderRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setDestinationFolderId(destinationFolderId) + .build(); + return renameFolderAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Renames a source folder to a destination folder. During a rename, the source and destination + * folders are locked until the long running operation completes. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (StorageControlClient storageControlClient = StorageControlClient.create()) {
+   *   String name = FolderName.of("[PROJECT]", "[BUCKET]", "[FOLDER]").toString();
+   *   String destinationFolderId = "destinationFolderId-480084905";
+   *   Folder response = storageControlClient.renameFolderAsync(name, destinationFolderId).get();
+   * }
+   * }
+ * + * @param name Required. Name of the source folder being renamed. Format: + * `projects/{project}/buckets/{bucket}/folders/{folder}` + * @param destinationFolderId Required. The destination folder ID, e.g. `foo/bar/`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture renameFolderAsync( + String name, String destinationFolderId) { + RenameFolderRequest request = + RenameFolderRequest.newBuilder() + .setName(name) + .setDestinationFolderId(destinationFolderId) + .build(); + return renameFolderAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Renames a source folder to a destination folder. During a rename, the source and destination + * folders are locked until the long running operation completes. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (StorageControlClient storageControlClient = StorageControlClient.create()) {
+   *   RenameFolderRequest request =
+   *       RenameFolderRequest.newBuilder()
+   *           .setName(FolderName.of("[PROJECT]", "[BUCKET]", "[FOLDER]").toString())
+   *           .setDestinationFolderId("destinationFolderId-480084905")
+   *           .setIfMetagenerationMatch(1043427781)
+   *           .setIfMetagenerationNotMatch(1025430873)
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   Folder response = storageControlClient.renameFolderAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture renameFolderAsync( + RenameFolderRequest request) { + return renameFolderOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Renames a source folder to a destination folder. During a rename, the source and destination + * folders are locked until the long running operation completes. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (StorageControlClient storageControlClient = StorageControlClient.create()) {
+   *   RenameFolderRequest request =
+   *       RenameFolderRequest.newBuilder()
+   *           .setName(FolderName.of("[PROJECT]", "[BUCKET]", "[FOLDER]").toString())
+   *           .setDestinationFolderId("destinationFolderId-480084905")
+   *           .setIfMetagenerationMatch(1043427781)
+   *           .setIfMetagenerationNotMatch(1025430873)
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   OperationFuture future =
+   *       storageControlClient.renameFolderOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Folder response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + renameFolderOperationCallable() { + return stub.renameFolderOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Renames a source folder to a destination folder. During a rename, the source and destination + * folders are locked until the long running operation completes. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (StorageControlClient storageControlClient = StorageControlClient.create()) {
+   *   RenameFolderRequest request =
+   *       RenameFolderRequest.newBuilder()
+   *           .setName(FolderName.of("[PROJECT]", "[BUCKET]", "[FOLDER]").toString())
+   *           .setDestinationFolderId("destinationFolderId-480084905")
+   *           .setIfMetagenerationMatch(1043427781)
+   *           .setIfMetagenerationNotMatch(1025430873)
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future = storageControlClient.renameFolderCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable renameFolderCallable() { + return stub.renameFolderCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns the storage layout configuration for a given bucket. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (StorageControlClient storageControlClient = StorageControlClient.create()) {
+   *   StorageLayoutName name = StorageLayoutName.of("[PROJECT]", "[BUCKET]");
+   *   StorageLayout response = storageControlClient.getStorageLayout(name);
+   * }
+   * }
+ * + * @param name Required. The name of the StorageLayout resource. Format: + * `projects/{project}/buckets/{bucket}/storageLayout` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final StorageLayout getStorageLayout(StorageLayoutName name) { + GetStorageLayoutRequest request = + GetStorageLayoutRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getStorageLayout(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns the storage layout configuration for a given bucket. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (StorageControlClient storageControlClient = StorageControlClient.create()) {
+   *   String name = StorageLayoutName.of("[PROJECT]", "[BUCKET]").toString();
+   *   StorageLayout response = storageControlClient.getStorageLayout(name);
+   * }
+   * }
+ * + * @param name Required. The name of the StorageLayout resource. Format: + * `projects/{project}/buckets/{bucket}/storageLayout` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final StorageLayout getStorageLayout(String name) { + GetStorageLayoutRequest request = GetStorageLayoutRequest.newBuilder().setName(name).build(); + return getStorageLayout(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns the storage layout configuration for a given bucket. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (StorageControlClient storageControlClient = StorageControlClient.create()) {
+   *   GetStorageLayoutRequest request =
+   *       GetStorageLayoutRequest.newBuilder()
+   *           .setName(StorageLayoutName.of("[PROJECT]", "[BUCKET]").toString())
+   *           .setPrefix("prefix-980110702")
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   StorageLayout response = storageControlClient.getStorageLayout(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 StorageLayout getStorageLayout(GetStorageLayoutRequest request) { + return getStorageLayoutCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns the storage layout configuration for a given bucket. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (StorageControlClient storageControlClient = StorageControlClient.create()) {
+   *   GetStorageLayoutRequest request =
+   *       GetStorageLayoutRequest.newBuilder()
+   *           .setName(StorageLayoutName.of("[PROJECT]", "[BUCKET]").toString())
+   *           .setPrefix("prefix-980110702")
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future =
+   *       storageControlClient.getStorageLayoutCallable().futureCall(request);
+   *   // Do something.
+   *   StorageLayout response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getStorageLayoutCallable() { + return stub.getStorageLayoutCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListFoldersPagedResponse + extends AbstractPagedListResponse< + ListFoldersRequest, + ListFoldersResponse, + Folder, + ListFoldersPage, + ListFoldersFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListFoldersPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListFoldersPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListFoldersPagedResponse(ListFoldersPage page) { + super(page, ListFoldersFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListFoldersPage + extends AbstractPage { + + private ListFoldersPage( + PageContext context, + ListFoldersResponse response) { + super(context, response); + } + + private static ListFoldersPage createEmptyPage() { + return new ListFoldersPage(null, null); + } + + @Override + protected ListFoldersPage createPage( + PageContext context, + ListFoldersResponse response) { + return new ListFoldersPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListFoldersFixedSizeCollection + extends AbstractFixedSizeCollection< + ListFoldersRequest, + ListFoldersResponse, + Folder, + ListFoldersPage, + ListFoldersFixedSizeCollection> { + + private ListFoldersFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListFoldersFixedSizeCollection createEmptyCollection() { + return new ListFoldersFixedSizeCollection(null, 0); + } + + @Override + protected ListFoldersFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListFoldersFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-storage-control/src/main/java/com/google/storage/control/v2/StorageControlSettings.java b/google-cloud-storage-control/src/main/java/com/google/storage/control/v2/StorageControlSettings.java new file mode 100644 index 0000000000..fc29f03059 --- /dev/null +++ b/google-cloud-storage-control/src/main/java/com/google/storage/control/v2/StorageControlSettings.java @@ -0,0 +1,258 @@ +/* + * Copyright 2023 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.control.v2; + +import static com.google.storage.control.v2.StorageControlClient.ListFoldersPagedResponse; + +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.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.storage.control.v2.stub.StorageControlStubSettings; +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 StorageControlClient}. + * + *

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 createFolder to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * StorageControlSettings.Builder storageControlSettingsBuilder =
+ *     StorageControlSettings.newBuilder();
+ * storageControlSettingsBuilder
+ *     .createFolderSettings()
+ *     .setRetrySettings(
+ *         storageControlSettingsBuilder
+ *             .createFolderSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * StorageControlSettings storageControlSettings = storageControlSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class StorageControlSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to createFolder. */ + public UnaryCallSettings createFolderSettings() { + return ((StorageControlStubSettings) getStubSettings()).createFolderSettings(); + } + + /** Returns the object with the settings used for calls to deleteFolder. */ + public UnaryCallSettings deleteFolderSettings() { + return ((StorageControlStubSettings) getStubSettings()).deleteFolderSettings(); + } + + /** Returns the object with the settings used for calls to getFolder. */ + public UnaryCallSettings getFolderSettings() { + return ((StorageControlStubSettings) getStubSettings()).getFolderSettings(); + } + + /** Returns the object with the settings used for calls to listFolders. */ + public PagedCallSettings + listFoldersSettings() { + return ((StorageControlStubSettings) getStubSettings()).listFoldersSettings(); + } + + /** Returns the object with the settings used for calls to renameFolder. */ + public UnaryCallSettings renameFolderSettings() { + return ((StorageControlStubSettings) getStubSettings()).renameFolderSettings(); + } + + /** Returns the object with the settings used for calls to renameFolder. */ + public OperationCallSettings + renameFolderOperationSettings() { + return ((StorageControlStubSettings) getStubSettings()).renameFolderOperationSettings(); + } + + /** Returns the object with the settings used for calls to getStorageLayout. */ + public UnaryCallSettings getStorageLayoutSettings() { + return ((StorageControlStubSettings) getStubSettings()).getStorageLayoutSettings(); + } + + public static final StorageControlSettings create(StorageControlStubSettings stub) + throws IOException { + return new StorageControlSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return StorageControlStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return StorageControlStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return StorageControlStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return StorageControlStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return StorageControlStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return StorageControlStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return StorageControlStubSettings.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 StorageControlSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for StorageControlSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(StorageControlStubSettings.newBuilder(clientContext)); + } + + protected Builder(StorageControlSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(StorageControlStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(StorageControlStubSettings.newBuilder()); + } + + public StorageControlStubSettings.Builder getStubSettingsBuilder() { + return ((StorageControlStubSettings.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 createFolder. */ + public UnaryCallSettings.Builder createFolderSettings() { + return getStubSettingsBuilder().createFolderSettings(); + } + + /** Returns the builder for the settings used for calls to deleteFolder. */ + public UnaryCallSettings.Builder deleteFolderSettings() { + return getStubSettingsBuilder().deleteFolderSettings(); + } + + /** Returns the builder for the settings used for calls to getFolder. */ + public UnaryCallSettings.Builder getFolderSettings() { + return getStubSettingsBuilder().getFolderSettings(); + } + + /** Returns the builder for the settings used for calls to listFolders. */ + public PagedCallSettings.Builder< + ListFoldersRequest, ListFoldersResponse, ListFoldersPagedResponse> + listFoldersSettings() { + return getStubSettingsBuilder().listFoldersSettings(); + } + + /** Returns the builder for the settings used for calls to renameFolder. */ + public UnaryCallSettings.Builder renameFolderSettings() { + return getStubSettingsBuilder().renameFolderSettings(); + } + + /** Returns the builder for the settings used for calls to renameFolder. */ + public OperationCallSettings.Builder + renameFolderOperationSettings() { + return getStubSettingsBuilder().renameFolderOperationSettings(); + } + + /** Returns the builder for the settings used for calls to getStorageLayout. */ + public UnaryCallSettings.Builder + getStorageLayoutSettings() { + return getStubSettingsBuilder().getStorageLayoutSettings(); + } + + @Override + public StorageControlSettings build() throws IOException { + return new StorageControlSettings(this); + } + } +} diff --git a/google-cloud-storage-control/src/main/java/com/google/storage/control/v2/gapic_metadata.json b/google-cloud-storage-control/src/main/java/com/google/storage/control/v2/gapic_metadata.json new file mode 100644 index 0000000000..cafc1e3145 --- /dev/null +++ b/google-cloud-storage-control/src/main/java/com/google/storage/control/v2/gapic_metadata.json @@ -0,0 +1,36 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.storage.control.v2", + "libraryPackage": "com.google.storage.control.v2", + "services": { + "StorageControl": { + "clients": { + "grpc": { + "libraryClient": "StorageControlClient", + "rpcs": { + "CreateFolder": { + "methods": ["createFolder", "createFolder", "createFolder", "createFolderCallable"] + }, + "DeleteFolder": { + "methods": ["deleteFolder", "deleteFolder", "deleteFolder", "deleteFolderCallable"] + }, + "GetFolder": { + "methods": ["getFolder", "getFolder", "getFolder", "getFolderCallable"] + }, + "GetStorageLayout": { + "methods": ["getStorageLayout", "getStorageLayout", "getStorageLayout", "getStorageLayoutCallable"] + }, + "ListFolders": { + "methods": ["listFolders", "listFolders", "listFolders", "listFoldersPagedCallable", "listFoldersCallable"] + }, + "RenameFolder": { + "methods": ["renameFolderAsync", "renameFolderAsync", "renameFolderAsync", "renameFolderOperationCallable", "renameFolderCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/google-cloud-storage-control/src/main/java/com/google/storage/control/v2/package-info.java b/google-cloud-storage-control/src/main/java/com/google/storage/control/v2/package-info.java new file mode 100644 index 0000000000..e40eb295a7 --- /dev/null +++ b/google-cloud-storage-control/src/main/java/com/google/storage/control/v2/package-info.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * A client to Cloud Storage API + * + *

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

======================= StorageControlClient ======================= + * + *

Service Description: StorageControl service includes selected control plane operations. + * + *

Sample for StorageControlClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (StorageControlClient storageControlClient = StorageControlClient.create()) {
+ *   BucketName parent = BucketName.of("[PROJECT]", "[BUCKET]");
+ *   Folder folder = Folder.newBuilder().build();
+ *   String folderId = "folderId294109737";
+ *   Folder response = storageControlClient.createFolder(parent, folder, folderId);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.storage.control.v2; + +import javax.annotation.Generated; diff --git a/google-cloud-storage-control/src/main/java/com/google/storage/control/v2/stub/GrpcStorageControlCallableFactory.java b/google-cloud-storage-control/src/main/java/com/google/storage/control/v2/stub/GrpcStorageControlCallableFactory.java new file mode 100644 index 0000000000..24311e7542 --- /dev/null +++ b/google-cloud-storage-control/src/main/java/com/google/storage/control/v2/stub/GrpcStorageControlCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2023 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.control.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 StorageControl service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcStorageControlCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/google-cloud-storage-control/src/main/java/com/google/storage/control/v2/stub/GrpcStorageControlStub.java b/google-cloud-storage-control/src/main/java/com/google/storage/control/v2/stub/GrpcStorageControlStub.java new file mode 100644 index 0000000000..bd0c7b3202 --- /dev/null +++ b/google-cloud-storage-control/src/main/java/com/google/storage/control/v2/stub/GrpcStorageControlStub.java @@ -0,0 +1,351 @@ +/* + * Copyright 2023 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.control.v2.stub; + +import static com.google.storage.control.v2.StorageControlClient.ListFoldersPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import com.google.storage.control.v2.CreateFolderRequest; +import com.google.storage.control.v2.DeleteFolderRequest; +import com.google.storage.control.v2.Folder; +import com.google.storage.control.v2.GetFolderRequest; +import com.google.storage.control.v2.GetStorageLayoutRequest; +import com.google.storage.control.v2.ListFoldersRequest; +import com.google.storage.control.v2.ListFoldersResponse; +import com.google.storage.control.v2.RenameFolderMetadata; +import com.google.storage.control.v2.RenameFolderRequest; +import com.google.storage.control.v2.StorageLayout; +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 StorageControl service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcStorageControlStub extends StorageControlStub { + private static final MethodDescriptor createFolderMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.storage.control.v2.StorageControl/CreateFolder") + .setRequestMarshaller(ProtoUtils.marshaller(CreateFolderRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Folder.getDefaultInstance())) + .build(); + + private static final MethodDescriptor deleteFolderMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.storage.control.v2.StorageControl/DeleteFolder") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteFolderRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor getFolderMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.storage.control.v2.StorageControl/GetFolder") + .setRequestMarshaller(ProtoUtils.marshaller(GetFolderRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Folder.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listFoldersMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.storage.control.v2.StorageControl/ListFolders") + .setRequestMarshaller(ProtoUtils.marshaller(ListFoldersRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListFoldersResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + renameFolderMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.storage.control.v2.StorageControl/RenameFolder") + .setRequestMarshaller(ProtoUtils.marshaller(RenameFolderRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getStorageLayoutMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.storage.control.v2.StorageControl/GetStorageLayout") + .setRequestMarshaller( + ProtoUtils.marshaller(GetStorageLayoutRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(StorageLayout.getDefaultInstance())) + .build(); + + private final UnaryCallable createFolderCallable; + private final UnaryCallable deleteFolderCallable; + private final UnaryCallable getFolderCallable; + private final UnaryCallable listFoldersCallable; + private final UnaryCallable + listFoldersPagedCallable; + private final UnaryCallable renameFolderCallable; + private final OperationCallable + renameFolderOperationCallable; + private final UnaryCallable getStorageLayoutCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + private static final PathTemplate CREATE_FOLDER_0_PATH_TEMPLATE = + PathTemplate.create("{bucket=**}"); + private static final PathTemplate DELETE_FOLDER_0_PATH_TEMPLATE = + PathTemplate.create("{bucket=projects/*/buckets/*}/**"); + private static final PathTemplate GET_FOLDER_0_PATH_TEMPLATE = + PathTemplate.create("{bucket=projects/*/buckets/*}/**"); + private static final PathTemplate LIST_FOLDERS_0_PATH_TEMPLATE = + PathTemplate.create("{bucket=**}"); + private static final PathTemplate RENAME_FOLDER_0_PATH_TEMPLATE = + PathTemplate.create("{bucket=projects/*/buckets/*}/**"); + private static final PathTemplate GET_STORAGE_LAYOUT_0_PATH_TEMPLATE = + PathTemplate.create("{bucket=projects/*/buckets/*}/**"); + + public static final GrpcStorageControlStub create(StorageControlStubSettings settings) + throws IOException { + return new GrpcStorageControlStub(settings, ClientContext.create(settings)); + } + + public static final GrpcStorageControlStub create(ClientContext clientContext) + throws IOException { + return new GrpcStorageControlStub( + StorageControlStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcStorageControlStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcStorageControlStub( + StorageControlStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcStorageControlStub, 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 GrpcStorageControlStub(StorageControlStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcStorageControlCallableFactory()); + } + + /** + * Constructs an instance of GrpcStorageControlStub, 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 GrpcStorageControlStub( + StorageControlStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createFolderTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createFolderMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add(request.getParent(), "bucket", CREATE_FOLDER_0_PATH_TEMPLATE); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteFolderTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteFolderMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add(request.getName(), "bucket", DELETE_FOLDER_0_PATH_TEMPLATE); + return builder.build(); + }) + .build(); + GrpcCallSettings getFolderTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getFolderMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add(request.getName(), "bucket", GET_FOLDER_0_PATH_TEMPLATE); + return builder.build(); + }) + .build(); + GrpcCallSettings listFoldersTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listFoldersMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add(request.getParent(), "bucket", LIST_FOLDERS_0_PATH_TEMPLATE); + return builder.build(); + }) + .build(); + GrpcCallSettings renameFolderTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(renameFolderMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add(request.getName(), "bucket", RENAME_FOLDER_0_PATH_TEMPLATE); + return builder.build(); + }) + .build(); + GrpcCallSettings getStorageLayoutTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getStorageLayoutMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add(request.getName(), "bucket", GET_STORAGE_LAYOUT_0_PATH_TEMPLATE); + return builder.build(); + }) + .build(); + + this.createFolderCallable = + callableFactory.createUnaryCallable( + createFolderTransportSettings, settings.createFolderSettings(), clientContext); + this.deleteFolderCallable = + callableFactory.createUnaryCallable( + deleteFolderTransportSettings, settings.deleteFolderSettings(), clientContext); + this.getFolderCallable = + callableFactory.createUnaryCallable( + getFolderTransportSettings, settings.getFolderSettings(), clientContext); + this.listFoldersCallable = + callableFactory.createUnaryCallable( + listFoldersTransportSettings, settings.listFoldersSettings(), clientContext); + this.listFoldersPagedCallable = + callableFactory.createPagedCallable( + listFoldersTransportSettings, settings.listFoldersSettings(), clientContext); + this.renameFolderCallable = + callableFactory.createUnaryCallable( + renameFolderTransportSettings, settings.renameFolderSettings(), clientContext); + this.renameFolderOperationCallable = + callableFactory.createOperationCallable( + renameFolderTransportSettings, + settings.renameFolderOperationSettings(), + clientContext, + operationsStub); + this.getStorageLayoutCallable = + callableFactory.createUnaryCallable( + getStorageLayoutTransportSettings, settings.getStorageLayoutSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createFolderCallable() { + return createFolderCallable; + } + + @Override + public UnaryCallable deleteFolderCallable() { + return deleteFolderCallable; + } + + @Override + public UnaryCallable getFolderCallable() { + return getFolderCallable; + } + + @Override + public UnaryCallable listFoldersCallable() { + return listFoldersCallable; + } + + @Override + public UnaryCallable listFoldersPagedCallable() { + return listFoldersPagedCallable; + } + + @Override + public UnaryCallable renameFolderCallable() { + return renameFolderCallable; + } + + @Override + public OperationCallable + renameFolderOperationCallable() { + return renameFolderOperationCallable; + } + + @Override + public UnaryCallable getStorageLayoutCallable() { + return getStorageLayoutCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-storage-control/src/main/java/com/google/storage/control/v2/stub/StorageControlStub.java b/google-cloud-storage-control/src/main/java/com/google/storage/control/v2/stub/StorageControlStub.java new file mode 100644 index 0000000000..19bee2f68a --- /dev/null +++ b/google-cloud-storage-control/src/main/java/com/google/storage/control/v2/stub/StorageControlStub.java @@ -0,0 +1,87 @@ +/* + * Copyright 2023 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.control.v2.stub; + +import static com.google.storage.control.v2.StorageControlClient.ListFoldersPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; +import com.google.storage.control.v2.CreateFolderRequest; +import com.google.storage.control.v2.DeleteFolderRequest; +import com.google.storage.control.v2.Folder; +import com.google.storage.control.v2.GetFolderRequest; +import com.google.storage.control.v2.GetStorageLayoutRequest; +import com.google.storage.control.v2.ListFoldersRequest; +import com.google.storage.control.v2.ListFoldersResponse; +import com.google.storage.control.v2.RenameFolderMetadata; +import com.google.storage.control.v2.RenameFolderRequest; +import com.google.storage.control.v2.StorageLayout; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the StorageControl service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class StorageControlStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + public UnaryCallable createFolderCallable() { + throw new UnsupportedOperationException("Not implemented: createFolderCallable()"); + } + + public UnaryCallable deleteFolderCallable() { + throw new UnsupportedOperationException("Not implemented: deleteFolderCallable()"); + } + + public UnaryCallable getFolderCallable() { + throw new UnsupportedOperationException("Not implemented: getFolderCallable()"); + } + + public UnaryCallable listFoldersPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listFoldersPagedCallable()"); + } + + public UnaryCallable listFoldersCallable() { + throw new UnsupportedOperationException("Not implemented: listFoldersCallable()"); + } + + public OperationCallable + renameFolderOperationCallable() { + throw new UnsupportedOperationException("Not implemented: renameFolderOperationCallable()"); + } + + public UnaryCallable renameFolderCallable() { + throw new UnsupportedOperationException("Not implemented: renameFolderCallable()"); + } + + public UnaryCallable getStorageLayoutCallable() { + throw new UnsupportedOperationException("Not implemented: getStorageLayoutCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-storage-control/src/main/java/com/google/storage/control/v2/stub/StorageControlStubSettings.java b/google-cloud-storage-control/src/main/java/com/google/storage/control/v2/stub/StorageControlStubSettings.java new file mode 100644 index 0000000000..8e0bd15fc8 --- /dev/null +++ b/google-cloud-storage-control/src/main/java/com/google/storage/control/v2/stub/StorageControlStubSettings.java @@ -0,0 +1,547 @@ +/* + * Copyright 2023 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.control.v2.stub; + +import static com.google.storage.control.v2.StorageControlClient.ListFoldersPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.storage.control.v2.CreateFolderRequest; +import com.google.storage.control.v2.DeleteFolderRequest; +import com.google.storage.control.v2.Folder; +import com.google.storage.control.v2.GetFolderRequest; +import com.google.storage.control.v2.GetStorageLayoutRequest; +import com.google.storage.control.v2.ListFoldersRequest; +import com.google.storage.control.v2.ListFoldersResponse; +import com.google.storage.control.v2.RenameFolderMetadata; +import com.google.storage.control.v2.RenameFolderRequest; +import com.google.storage.control.v2.StorageLayout; +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 StorageControlStub}. + * + *

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 createFolder to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * StorageControlStubSettings.Builder storageControlSettingsBuilder =
+ *     StorageControlStubSettings.newBuilder();
+ * storageControlSettingsBuilder
+ *     .createFolderSettings()
+ *     .setRetrySettings(
+ *         storageControlSettingsBuilder
+ *             .createFolderSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * StorageControlStubSettings storageControlSettings = storageControlSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class StorageControlStubSettings 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 UnaryCallSettings createFolderSettings; + private final UnaryCallSettings deleteFolderSettings; + private final UnaryCallSettings getFolderSettings; + private final PagedCallSettings + listFoldersSettings; + private final UnaryCallSettings renameFolderSettings; + private final OperationCallSettings + renameFolderOperationSettings; + private final UnaryCallSettings getStorageLayoutSettings; + + private static final PagedListDescriptor + LIST_FOLDERS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListFoldersRequest injectToken(ListFoldersRequest payload, String token) { + return ListFoldersRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListFoldersRequest injectPageSize(ListFoldersRequest payload, int pageSize) { + return ListFoldersRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListFoldersRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListFoldersResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListFoldersResponse payload) { + return payload.getFoldersList() == null + ? ImmutableList.of() + : payload.getFoldersList(); + } + }; + + private static final PagedListResponseFactory< + ListFoldersRequest, ListFoldersResponse, ListFoldersPagedResponse> + LIST_FOLDERS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListFoldersRequest, ListFoldersResponse, ListFoldersPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListFoldersRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_FOLDERS_PAGE_STR_DESC, request, context); + return ListFoldersPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createFolder. */ + public UnaryCallSettings createFolderSettings() { + return createFolderSettings; + } + + /** Returns the object with the settings used for calls to deleteFolder. */ + public UnaryCallSettings deleteFolderSettings() { + return deleteFolderSettings; + } + + /** Returns the object with the settings used for calls to getFolder. */ + public UnaryCallSettings getFolderSettings() { + return getFolderSettings; + } + + /** Returns the object with the settings used for calls to listFolders. */ + public PagedCallSettings + listFoldersSettings() { + return listFoldersSettings; + } + + /** Returns the object with the settings used for calls to renameFolder. */ + public UnaryCallSettings renameFolderSettings() { + return renameFolderSettings; + } + + /** Returns the object with the settings used for calls to renameFolder. */ + public OperationCallSettings + renameFolderOperationSettings() { + return renameFolderOperationSettings; + } + + /** Returns the object with the settings used for calls to getStorageLayout. */ + public UnaryCallSettings getStorageLayoutSettings() { + return getStorageLayoutSettings; + } + + public StorageControlStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcStorageControlStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "storage"; + } + + /** 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) + .setUseJwtAccessWithScope(true); + } + + /** 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(StorageControlStubSettings.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 StorageControlStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createFolderSettings = settingsBuilder.createFolderSettings().build(); + deleteFolderSettings = settingsBuilder.deleteFolderSettings().build(); + getFolderSettings = settingsBuilder.getFolderSettings().build(); + listFoldersSettings = settingsBuilder.listFoldersSettings().build(); + renameFolderSettings = settingsBuilder.renameFolderSettings().build(); + renameFolderOperationSettings = settingsBuilder.renameFolderOperationSettings().build(); + getStorageLayoutSettings = settingsBuilder.getStorageLayoutSettings().build(); + } + + /** Builder for StorageControlStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder createFolderSettings; + private final UnaryCallSettings.Builder deleteFolderSettings; + private final UnaryCallSettings.Builder getFolderSettings; + private final PagedCallSettings.Builder< + ListFoldersRequest, ListFoldersResponse, ListFoldersPagedResponse> + listFoldersSettings; + private final UnaryCallSettings.Builder renameFolderSettings; + private final OperationCallSettings.Builder + renameFolderOperationSettings; + private final UnaryCallSettings.Builder + getStorageLayoutSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.RESOURCE_EXHAUSTED, + StatusCode.Code.UNAVAILABLE, + StatusCode.Code.DEADLINE_EXCEEDED, + StatusCode.Code.INTERNAL, + StatusCode.Code.UNKNOWN))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_1_params", settings); + 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); + + createFolderSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteFolderSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getFolderSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listFoldersSettings = PagedCallSettings.newBuilder(LIST_FOLDERS_PAGE_STR_FACT); + renameFolderSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + renameFolderOperationSettings = OperationCallSettings.newBuilder(); + getStorageLayoutSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createFolderSettings, + deleteFolderSettings, + getFolderSettings, + listFoldersSettings, + renameFolderSettings, + getStorageLayoutSettings); + initDefaults(this); + } + + protected Builder(StorageControlStubSettings settings) { + super(settings); + + createFolderSettings = settings.createFolderSettings.toBuilder(); + deleteFolderSettings = settings.deleteFolderSettings.toBuilder(); + getFolderSettings = settings.getFolderSettings.toBuilder(); + listFoldersSettings = settings.listFoldersSettings.toBuilder(); + renameFolderSettings = settings.renameFolderSettings.toBuilder(); + renameFolderOperationSettings = settings.renameFolderOperationSettings.toBuilder(); + getStorageLayoutSettings = settings.getStorageLayoutSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createFolderSettings, + deleteFolderSettings, + getFolderSettings, + listFoldersSettings, + renameFolderSettings, + getStorageLayoutSettings); + } + + 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 + .createFolderSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteFolderSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .getFolderSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listFoldersSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .renameFolderSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .getStorageLayoutSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .renameFolderOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Folder.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(RenameFolderMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to createFolder. */ + public UnaryCallSettings.Builder createFolderSettings() { + return createFolderSettings; + } + + /** Returns the builder for the settings used for calls to deleteFolder. */ + public UnaryCallSettings.Builder deleteFolderSettings() { + return deleteFolderSettings; + } + + /** Returns the builder for the settings used for calls to getFolder. */ + public UnaryCallSettings.Builder getFolderSettings() { + return getFolderSettings; + } + + /** Returns the builder for the settings used for calls to listFolders. */ + public PagedCallSettings.Builder< + ListFoldersRequest, ListFoldersResponse, ListFoldersPagedResponse> + listFoldersSettings() { + return listFoldersSettings; + } + + /** Returns the builder for the settings used for calls to renameFolder. */ + public UnaryCallSettings.Builder renameFolderSettings() { + return renameFolderSettings; + } + + /** Returns the builder for the settings used for calls to renameFolder. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + renameFolderOperationSettings() { + return renameFolderOperationSettings; + } + + /** Returns the builder for the settings used for calls to getStorageLayout. */ + public UnaryCallSettings.Builder + getStorageLayoutSettings() { + return getStorageLayoutSettings; + } + + @Override + public StorageControlStubSettings build() throws IOException { + return new StorageControlStubSettings(this); + } + } +} diff --git a/google-cloud-storage-control/src/main/resources/META-INF/native-image/com.google.storage.control.v2/reflect-config.json b/google-cloud-storage-control/src/main/resources/META-INF/native-image/com.google.storage.control.v2/reflect-config.json new file mode 100644 index 0000000000..63f27af31d --- /dev/null +++ b/google-cloud-storage-control/src/main/resources/META-INF/native-image/com.google.storage.control.v2/reflect-config.json @@ -0,0 +1,1523 @@ +[ + { + "name": "com.google.api.ClientLibraryDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibraryOrganization", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldBehavior", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldInfo$Format", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.LaunchStage", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$History", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Style", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RoutingParameter", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RoutingParameter$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RoutingRule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RoutingRule$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.CancelOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.CancelOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.DeleteOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.DeleteOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.GetOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.GetOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.Operation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.Operation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.OperationInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.OperationInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.WaitOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.WaitOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Any", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Any$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$VerificationState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Label", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$CType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$JSType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionRetention", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionTargetType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$OptimizeMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Semantic", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$IdempotencyLevel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Empty", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Empty$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Timestamp", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Timestamp$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Status", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Status$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.control.v2.CommonLongRunningOperationMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.control.v2.CommonLongRunningOperationMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.control.v2.CreateFolderRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.control.v2.CreateFolderRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.control.v2.DeleteFolderRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.control.v2.DeleteFolderRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.control.v2.Folder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.control.v2.Folder$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.control.v2.GetFolderRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.control.v2.GetFolderRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.control.v2.GetStorageLayoutRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.control.v2.GetStorageLayoutRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.control.v2.ListFoldersRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.control.v2.ListFoldersRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.control.v2.ListFoldersResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.control.v2.ListFoldersResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.control.v2.PendingRenameInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.control.v2.PendingRenameInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.control.v2.RenameFolderMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.control.v2.RenameFolderMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.control.v2.RenameFolderRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.control.v2.RenameFolderRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.control.v2.StorageLayout", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.control.v2.StorageLayout$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.control.v2.StorageLayout$CustomPlacementConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.control.v2.StorageLayout$CustomPlacementConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.control.v2.StorageLayout$HierarchicalNamespace", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.storage.control.v2.StorageLayout$HierarchicalNamespace$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + } +] \ No newline at end of file diff --git a/google-cloud-storage-control/src/main/resources/com/google/storage/control/v2/gapic_metadata.json b/google-cloud-storage-control/src/main/resources/com/google/storage/control/v2/gapic_metadata.json new file mode 100644 index 0000000000..cafc1e3145 --- /dev/null +++ b/google-cloud-storage-control/src/main/resources/com/google/storage/control/v2/gapic_metadata.json @@ -0,0 +1,36 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.storage.control.v2", + "libraryPackage": "com.google.storage.control.v2", + "services": { + "StorageControl": { + "clients": { + "grpc": { + "libraryClient": "StorageControlClient", + "rpcs": { + "CreateFolder": { + "methods": ["createFolder", "createFolder", "createFolder", "createFolderCallable"] + }, + "DeleteFolder": { + "methods": ["deleteFolder", "deleteFolder", "deleteFolder", "deleteFolderCallable"] + }, + "GetFolder": { + "methods": ["getFolder", "getFolder", "getFolder", "getFolderCallable"] + }, + "GetStorageLayout": { + "methods": ["getStorageLayout", "getStorageLayout", "getStorageLayout", "getStorageLayoutCallable"] + }, + "ListFolders": { + "methods": ["listFolders", "listFolders", "listFolders", "listFoldersPagedCallable", "listFoldersCallable"] + }, + "RenameFolder": { + "methods": ["renameFolderAsync", "renameFolderAsync", "renameFolderAsync", "renameFolderOperationCallable", "renameFolderCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/google-cloud-storage-control/src/test/java/com/google/storage/control/v2/MockStorageControl.java b/google-cloud-storage-control/src/test/java/com/google/storage/control/v2/MockStorageControl.java new file mode 100644 index 0000000000..0f8d5ed354 --- /dev/null +++ b/google-cloud-storage-control/src/test/java/com/google/storage/control/v2/MockStorageControl.java @@ -0,0 +1,59 @@ +/* + * Copyright 2023 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.control.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 MockStorageControl implements MockGrpcService { + private final MockStorageControlImpl serviceImpl; + + public MockStorageControl() { + serviceImpl = new MockStorageControlImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-storage-control/src/test/java/com/google/storage/control/v2/MockStorageControlImpl.java b/google-cloud-storage-control/src/test/java/com/google/storage/control/v2/MockStorageControlImpl.java new file mode 100644 index 0000000000..b2f2c078be --- /dev/null +++ b/google-cloud-storage-control/src/test/java/com/google/storage/control/v2/MockStorageControlImpl.java @@ -0,0 +1,185 @@ +/* + * Copyright 2023 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.control.v2; + +import com.google.api.core.BetaApi; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.storage.control.v2.StorageControlGrpc.StorageControlImplBase; +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 MockStorageControlImpl extends StorageControlImplBase { + private List requests; + private Queue responses; + + public MockStorageControlImpl() { + 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 createFolder(CreateFolderRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Folder) { + requests.add(request); + responseObserver.onNext(((Folder) 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 CreateFolder, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Folder.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteFolder(DeleteFolderRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) 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 DeleteFolder, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getFolder(GetFolderRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Folder) { + requests.add(request); + responseObserver.onNext(((Folder) 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 GetFolder, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Folder.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listFolders( + ListFoldersRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListFoldersResponse) { + requests.add(request); + responseObserver.onNext(((ListFoldersResponse) 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 ListFolders, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListFoldersResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void renameFolder( + RenameFolderRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method RenameFolder, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getStorageLayout( + GetStorageLayoutRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof StorageLayout) { + requests.add(request); + responseObserver.onNext(((StorageLayout) 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 GetStorageLayout, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + StorageLayout.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/google-cloud-storage-control/src/test/java/com/google/storage/control/v2/StorageControlClientTest.java b/google-cloud-storage-control/src/test/java/com/google/storage/control/v2/StorageControlClientTest.java new file mode 100644 index 0000000000..b29a26d89e --- /dev/null +++ b/google-cloud-storage-control/src/test/java/com/google/storage/control/v2/StorageControlClientTest.java @@ -0,0 +1,612 @@ +/* + * Copyright 2023 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.control.v2; + +import static com.google.storage.control.v2.StorageControlClient.ListFoldersPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.Timestamp; +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 StorageControlClientTest { + private static MockServiceHelper mockServiceHelper; + private static MockStorageControl mockStorageControl; + private LocalChannelProvider channelProvider; + private StorageControlClient client; + + @BeforeClass + public static void startStaticServer() { + mockStorageControl = new MockStorageControl(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockStorageControl)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + StorageControlSettings settings = + StorageControlSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = StorageControlClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createFolderTest() throws Exception { + Folder expectedResponse = + Folder.newBuilder() + .setName(FolderName.of("[PROJECT]", "[BUCKET]", "[FOLDER]").toString()) + .setMetageneration(1048558813) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setPendingRenameInfo(PendingRenameInfo.newBuilder().build()) + .build(); + mockStorageControl.addResponse(expectedResponse); + + BucketName parent = BucketName.of("[PROJECT]", "[BUCKET]"); + Folder folder = Folder.newBuilder().build(); + String folderId = "folderId294109737"; + + Folder actualResponse = client.createFolder(parent, folder, folderId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockStorageControl.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateFolderRequest actualRequest = ((CreateFolderRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(folder, actualRequest.getFolder()); + Assert.assertEquals(folderId, actualRequest.getFolderId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createFolderExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockStorageControl.addException(exception); + + try { + BucketName parent = BucketName.of("[PROJECT]", "[BUCKET]"); + Folder folder = Folder.newBuilder().build(); + String folderId = "folderId294109737"; + client.createFolder(parent, folder, folderId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createFolderTest2() throws Exception { + Folder expectedResponse = + Folder.newBuilder() + .setName(FolderName.of("[PROJECT]", "[BUCKET]", "[FOLDER]").toString()) + .setMetageneration(1048558813) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setPendingRenameInfo(PendingRenameInfo.newBuilder().build()) + .build(); + mockStorageControl.addResponse(expectedResponse); + + String parent = "parent-995424086"; + Folder folder = Folder.newBuilder().build(); + String folderId = "folderId294109737"; + + Folder actualResponse = client.createFolder(parent, folder, folderId); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockStorageControl.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateFolderRequest actualRequest = ((CreateFolderRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(folder, actualRequest.getFolder()); + Assert.assertEquals(folderId, actualRequest.getFolderId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createFolderExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockStorageControl.addException(exception); + + try { + String parent = "parent-995424086"; + Folder folder = Folder.newBuilder().build(); + String folderId = "folderId294109737"; + client.createFolder(parent, folder, folderId); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteFolderTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockStorageControl.addResponse(expectedResponse); + + FolderName name = FolderName.of("[PROJECT]", "[BUCKET]", "[FOLDER]"); + + client.deleteFolder(name); + + List actualRequests = mockStorageControl.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteFolderRequest actualRequest = ((DeleteFolderRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteFolderExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockStorageControl.addException(exception); + + try { + FolderName name = FolderName.of("[PROJECT]", "[BUCKET]", "[FOLDER]"); + client.deleteFolder(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteFolderTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockStorageControl.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteFolder(name); + + List actualRequests = mockStorageControl.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteFolderRequest actualRequest = ((DeleteFolderRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteFolderExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockStorageControl.addException(exception); + + try { + String name = "name3373707"; + client.deleteFolder(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getFolderTest() throws Exception { + Folder expectedResponse = + Folder.newBuilder() + .setName(FolderName.of("[PROJECT]", "[BUCKET]", "[FOLDER]").toString()) + .setMetageneration(1048558813) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setPendingRenameInfo(PendingRenameInfo.newBuilder().build()) + .build(); + mockStorageControl.addResponse(expectedResponse); + + FolderName name = FolderName.of("[PROJECT]", "[BUCKET]", "[FOLDER]"); + + Folder actualResponse = client.getFolder(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockStorageControl.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetFolderRequest actualRequest = ((GetFolderRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getFolderExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockStorageControl.addException(exception); + + try { + FolderName name = FolderName.of("[PROJECT]", "[BUCKET]", "[FOLDER]"); + client.getFolder(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getFolderTest2() throws Exception { + Folder expectedResponse = + Folder.newBuilder() + .setName(FolderName.of("[PROJECT]", "[BUCKET]", "[FOLDER]").toString()) + .setMetageneration(1048558813) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setPendingRenameInfo(PendingRenameInfo.newBuilder().build()) + .build(); + mockStorageControl.addResponse(expectedResponse); + + String name = "name3373707"; + + Folder actualResponse = client.getFolder(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockStorageControl.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetFolderRequest actualRequest = ((GetFolderRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getFolderExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockStorageControl.addException(exception); + + try { + String name = "name3373707"; + client.getFolder(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listFoldersTest() throws Exception { + Folder responsesElement = Folder.newBuilder().build(); + ListFoldersResponse expectedResponse = + ListFoldersResponse.newBuilder() + .setNextPageToken("") + .addAllFolders(Arrays.asList(responsesElement)) + .build(); + mockStorageControl.addResponse(expectedResponse); + + BucketName parent = BucketName.of("[PROJECT]", "[BUCKET]"); + + ListFoldersPagedResponse pagedListResponse = client.listFolders(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getFoldersList().get(0), resources.get(0)); + + List actualRequests = mockStorageControl.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListFoldersRequest actualRequest = ((ListFoldersRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listFoldersExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockStorageControl.addException(exception); + + try { + BucketName parent = BucketName.of("[PROJECT]", "[BUCKET]"); + client.listFolders(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listFoldersTest2() throws Exception { + Folder responsesElement = Folder.newBuilder().build(); + ListFoldersResponse expectedResponse = + ListFoldersResponse.newBuilder() + .setNextPageToken("") + .addAllFolders(Arrays.asList(responsesElement)) + .build(); + mockStorageControl.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListFoldersPagedResponse pagedListResponse = client.listFolders(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getFoldersList().get(0), resources.get(0)); + + List actualRequests = mockStorageControl.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListFoldersRequest actualRequest = ((ListFoldersRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listFoldersExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockStorageControl.addException(exception); + + try { + String parent = "parent-995424086"; + client.listFolders(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void renameFolderTest() throws Exception { + Folder expectedResponse = + Folder.newBuilder() + .setName(FolderName.of("[PROJECT]", "[BUCKET]", "[FOLDER]").toString()) + .setMetageneration(1048558813) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setPendingRenameInfo(PendingRenameInfo.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("renameFolderTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockStorageControl.addResponse(resultOperation); + + FolderName name = FolderName.of("[PROJECT]", "[BUCKET]", "[FOLDER]"); + String destinationFolderId = "destinationFolderId-480084905"; + + Folder actualResponse = client.renameFolderAsync(name, destinationFolderId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockStorageControl.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RenameFolderRequest actualRequest = ((RenameFolderRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertEquals(destinationFolderId, actualRequest.getDestinationFolderId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void renameFolderExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockStorageControl.addException(exception); + + try { + FolderName name = FolderName.of("[PROJECT]", "[BUCKET]", "[FOLDER]"); + String destinationFolderId = "destinationFolderId-480084905"; + client.renameFolderAsync(name, destinationFolderId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void renameFolderTest2() throws Exception { + Folder expectedResponse = + Folder.newBuilder() + .setName(FolderName.of("[PROJECT]", "[BUCKET]", "[FOLDER]").toString()) + .setMetageneration(1048558813) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setPendingRenameInfo(PendingRenameInfo.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("renameFolderTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockStorageControl.addResponse(resultOperation); + + String name = "name3373707"; + String destinationFolderId = "destinationFolderId-480084905"; + + Folder actualResponse = client.renameFolderAsync(name, destinationFolderId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockStorageControl.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + RenameFolderRequest actualRequest = ((RenameFolderRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(destinationFolderId, actualRequest.getDestinationFolderId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void renameFolderExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockStorageControl.addException(exception); + + try { + String name = "name3373707"; + String destinationFolderId = "destinationFolderId-480084905"; + client.renameFolderAsync(name, destinationFolderId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void getStorageLayoutTest() throws Exception { + StorageLayout expectedResponse = + StorageLayout.newBuilder() + .setName(StorageLayoutName.of("[PROJECT]", "[BUCKET]").toString()) + .setLocation("location1901043637") + .setLocationType("locationType-58277745") + .setCustomPlacementConfig(StorageLayout.CustomPlacementConfig.newBuilder().build()) + .setHierarchicalNamespace(StorageLayout.HierarchicalNamespace.newBuilder().build()) + .build(); + mockStorageControl.addResponse(expectedResponse); + + StorageLayoutName name = StorageLayoutName.of("[PROJECT]", "[BUCKET]"); + + StorageLayout actualResponse = client.getStorageLayout(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockStorageControl.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetStorageLayoutRequest actualRequest = ((GetStorageLayoutRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getStorageLayoutExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockStorageControl.addException(exception); + + try { + StorageLayoutName name = StorageLayoutName.of("[PROJECT]", "[BUCKET]"); + client.getStorageLayout(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getStorageLayoutTest2() throws Exception { + StorageLayout expectedResponse = + StorageLayout.newBuilder() + .setName(StorageLayoutName.of("[PROJECT]", "[BUCKET]").toString()) + .setLocation("location1901043637") + .setLocationType("locationType-58277745") + .setCustomPlacementConfig(StorageLayout.CustomPlacementConfig.newBuilder().build()) + .setHierarchicalNamespace(StorageLayout.HierarchicalNamespace.newBuilder().build()) + .build(); + mockStorageControl.addResponse(expectedResponse); + + String name = "name3373707"; + + StorageLayout actualResponse = client.getStorageLayout(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockStorageControl.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetStorageLayoutRequest actualRequest = ((GetStorageLayoutRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getStorageLayoutExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockStorageControl.addException(exception); + + try { + String name = "name3373707"; + client.getStorageLayout(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/grpc-google-cloud-storage-control-v2/pom.xml b/grpc-google-cloud-storage-control-v2/pom.xml new file mode 100644 index 0000000000..5ba440cbf3 --- /dev/null +++ b/grpc-google-cloud-storage-control-v2/pom.xml @@ -0,0 +1,69 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-storage-control-v2 + 2.30.1-alpha + grpc-google-cloud-storage-control-v2 + GRPC library for google-cloud-storage + + com.google.cloud + google-cloud-storage-parent + 2.30.1 + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-cloud-storage-control-v2 + + + com.google.guava + guava + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/grpc-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/StorageControlGrpc.java b/grpc-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/StorageControlGrpc.java new file mode 100644 index 0000000000..a7d9ab9e01 --- /dev/null +++ b/grpc-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/StorageControlGrpc.java @@ -0,0 +1,947 @@ +/* + * Copyright 2023 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.control.v2; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * StorageControl service includes selected control plane operations.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/storage/control/v2/storage_control.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class StorageControlGrpc { + + private StorageControlGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.storage.control.v2.StorageControl"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.storage.control.v2.CreateFolderRequest, com.google.storage.control.v2.Folder> + getCreateFolderMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateFolder", + requestType = com.google.storage.control.v2.CreateFolderRequest.class, + responseType = com.google.storage.control.v2.Folder.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.storage.control.v2.CreateFolderRequest, com.google.storage.control.v2.Folder> + getCreateFolderMethod() { + io.grpc.MethodDescriptor< + com.google.storage.control.v2.CreateFolderRequest, com.google.storage.control.v2.Folder> + getCreateFolderMethod; + if ((getCreateFolderMethod = StorageControlGrpc.getCreateFolderMethod) == null) { + synchronized (StorageControlGrpc.class) { + if ((getCreateFolderMethod = StorageControlGrpc.getCreateFolderMethod) == null) { + StorageControlGrpc.getCreateFolderMethod = + getCreateFolderMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateFolder")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.storage.control.v2.CreateFolderRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.storage.control.v2.Folder.getDefaultInstance())) + .setSchemaDescriptor( + new StorageControlMethodDescriptorSupplier("CreateFolder")) + .build(); + } + } + } + return getCreateFolderMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.storage.control.v2.DeleteFolderRequest, com.google.protobuf.Empty> + getDeleteFolderMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteFolder", + requestType = com.google.storage.control.v2.DeleteFolderRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.storage.control.v2.DeleteFolderRequest, com.google.protobuf.Empty> + getDeleteFolderMethod() { + io.grpc.MethodDescriptor< + com.google.storage.control.v2.DeleteFolderRequest, com.google.protobuf.Empty> + getDeleteFolderMethod; + if ((getDeleteFolderMethod = StorageControlGrpc.getDeleteFolderMethod) == null) { + synchronized (StorageControlGrpc.class) { + if ((getDeleteFolderMethod = StorageControlGrpc.getDeleteFolderMethod) == null) { + StorageControlGrpc.getDeleteFolderMethod = + getDeleteFolderMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteFolder")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.storage.control.v2.DeleteFolderRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new StorageControlMethodDescriptorSupplier("DeleteFolder")) + .build(); + } + } + } + return getDeleteFolderMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.storage.control.v2.GetFolderRequest, com.google.storage.control.v2.Folder> + getGetFolderMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetFolder", + requestType = com.google.storage.control.v2.GetFolderRequest.class, + responseType = com.google.storage.control.v2.Folder.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.storage.control.v2.GetFolderRequest, com.google.storage.control.v2.Folder> + getGetFolderMethod() { + io.grpc.MethodDescriptor< + com.google.storage.control.v2.GetFolderRequest, com.google.storage.control.v2.Folder> + getGetFolderMethod; + if ((getGetFolderMethod = StorageControlGrpc.getGetFolderMethod) == null) { + synchronized (StorageControlGrpc.class) { + if ((getGetFolderMethod = StorageControlGrpc.getGetFolderMethod) == null) { + StorageControlGrpc.getGetFolderMethod = + getGetFolderMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetFolder")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.storage.control.v2.GetFolderRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.storage.control.v2.Folder.getDefaultInstance())) + .setSchemaDescriptor(new StorageControlMethodDescriptorSupplier("GetFolder")) + .build(); + } + } + } + return getGetFolderMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.storage.control.v2.ListFoldersRequest, + com.google.storage.control.v2.ListFoldersResponse> + getListFoldersMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListFolders", + requestType = com.google.storage.control.v2.ListFoldersRequest.class, + responseType = com.google.storage.control.v2.ListFoldersResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.storage.control.v2.ListFoldersRequest, + com.google.storage.control.v2.ListFoldersResponse> + getListFoldersMethod() { + io.grpc.MethodDescriptor< + com.google.storage.control.v2.ListFoldersRequest, + com.google.storage.control.v2.ListFoldersResponse> + getListFoldersMethod; + if ((getListFoldersMethod = StorageControlGrpc.getListFoldersMethod) == null) { + synchronized (StorageControlGrpc.class) { + if ((getListFoldersMethod = StorageControlGrpc.getListFoldersMethod) == null) { + StorageControlGrpc.getListFoldersMethod = + getListFoldersMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListFolders")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.storage.control.v2.ListFoldersRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.storage.control.v2.ListFoldersResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new StorageControlMethodDescriptorSupplier("ListFolders")) + .build(); + } + } + } + return getListFoldersMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.storage.control.v2.RenameFolderRequest, com.google.longrunning.Operation> + getRenameFolderMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RenameFolder", + requestType = com.google.storage.control.v2.RenameFolderRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.storage.control.v2.RenameFolderRequest, com.google.longrunning.Operation> + getRenameFolderMethod() { + io.grpc.MethodDescriptor< + com.google.storage.control.v2.RenameFolderRequest, com.google.longrunning.Operation> + getRenameFolderMethod; + if ((getRenameFolderMethod = StorageControlGrpc.getRenameFolderMethod) == null) { + synchronized (StorageControlGrpc.class) { + if ((getRenameFolderMethod = StorageControlGrpc.getRenameFolderMethod) == null) { + StorageControlGrpc.getRenameFolderMethod = + getRenameFolderMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RenameFolder")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.storage.control.v2.RenameFolderRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new StorageControlMethodDescriptorSupplier("RenameFolder")) + .build(); + } + } + } + return getRenameFolderMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.storage.control.v2.GetStorageLayoutRequest, + com.google.storage.control.v2.StorageLayout> + getGetStorageLayoutMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetStorageLayout", + requestType = com.google.storage.control.v2.GetStorageLayoutRequest.class, + responseType = com.google.storage.control.v2.StorageLayout.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.storage.control.v2.GetStorageLayoutRequest, + com.google.storage.control.v2.StorageLayout> + getGetStorageLayoutMethod() { + io.grpc.MethodDescriptor< + com.google.storage.control.v2.GetStorageLayoutRequest, + com.google.storage.control.v2.StorageLayout> + getGetStorageLayoutMethod; + if ((getGetStorageLayoutMethod = StorageControlGrpc.getGetStorageLayoutMethod) == null) { + synchronized (StorageControlGrpc.class) { + if ((getGetStorageLayoutMethod = StorageControlGrpc.getGetStorageLayoutMethod) == null) { + StorageControlGrpc.getGetStorageLayoutMethod = + getGetStorageLayoutMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetStorageLayout")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.storage.control.v2.GetStorageLayoutRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.storage.control.v2.StorageLayout.getDefaultInstance())) + .setSchemaDescriptor( + new StorageControlMethodDescriptorSupplier("GetStorageLayout")) + .build(); + } + } + } + return getGetStorageLayoutMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static StorageControlStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public StorageControlStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new StorageControlStub(channel, callOptions); + } + }; + return StorageControlStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static StorageControlBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public StorageControlBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new StorageControlBlockingStub(channel, callOptions); + } + }; + return StorageControlBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static StorageControlFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public StorageControlFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new StorageControlFutureStub(channel, callOptions); + } + }; + return StorageControlFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * StorageControl service includes selected control plane operations.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Creates a new folder.
+     * 
+ */ + default void createFolder( + com.google.storage.control.v2.CreateFolderRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateFolderMethod(), responseObserver); + } + + /** + * + * + *
+     * Permanently deletes an empty folder.
+     * 
+ */ + default void deleteFolder( + com.google.storage.control.v2.DeleteFolderRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteFolderMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns metadata for the specified folder.
+     * 
+ */ + default void getFolder( + com.google.storage.control.v2.GetFolderRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetFolderMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves a list of folders for a given bucket.
+     * 
+ */ + default void listFolders( + com.google.storage.control.v2.ListFoldersRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListFoldersMethod(), responseObserver); + } + + /** + * + * + *
+     * Renames a source folder to a destination folder. During a rename, the
+     * source and destination folders are locked until the long running operation
+     * completes.
+     * 
+ */ + default void renameFolder( + com.google.storage.control.v2.RenameFolderRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRenameFolderMethod(), responseObserver); + } + + /** + * + * + *
+     * Returns the storage layout configuration for a given bucket.
+     * 
+ */ + default void getStorageLayout( + com.google.storage.control.v2.GetStorageLayoutRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetStorageLayoutMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service StorageControl. + * + *
+   * StorageControl service includes selected control plane operations.
+   * 
+ */ + public abstract static class StorageControlImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return StorageControlGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service StorageControl. + * + *
+   * StorageControl service includes selected control plane operations.
+   * 
+ */ + public static final class StorageControlStub + extends io.grpc.stub.AbstractAsyncStub { + private StorageControlStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected StorageControlStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new StorageControlStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a new folder.
+     * 
+ */ + public void createFolder( + com.google.storage.control.v2.CreateFolderRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateFolderMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Permanently deletes an empty folder.
+     * 
+ */ + public void deleteFolder( + com.google.storage.control.v2.DeleteFolderRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteFolderMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns metadata for the specified folder.
+     * 
+ */ + public void getFolder( + com.google.storage.control.v2.GetFolderRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetFolderMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Retrieves a list of folders for a given bucket.
+     * 
+ */ + public void listFolders( + com.google.storage.control.v2.ListFoldersRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListFoldersMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Renames a source folder to a destination folder. During a rename, the
+     * source and destination folders are locked until the long running operation
+     * completes.
+     * 
+ */ + public void renameFolder( + com.google.storage.control.v2.RenameFolderRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRenameFolderMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns the storage layout configuration for a given bucket.
+     * 
+ */ + public void getStorageLayout( + com.google.storage.control.v2.GetStorageLayoutRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetStorageLayoutMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service StorageControl. + * + *
+   * StorageControl service includes selected control plane operations.
+   * 
+ */ + public static final class StorageControlBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private StorageControlBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected StorageControlBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new StorageControlBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a new folder.
+     * 
+ */ + public com.google.storage.control.v2.Folder createFolder( + com.google.storage.control.v2.CreateFolderRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateFolderMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Permanently deletes an empty folder.
+     * 
+ */ + public com.google.protobuf.Empty deleteFolder( + com.google.storage.control.v2.DeleteFolderRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteFolderMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns metadata for the specified folder.
+     * 
+ */ + public com.google.storage.control.v2.Folder getFolder( + com.google.storage.control.v2.GetFolderRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetFolderMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves a list of folders for a given bucket.
+     * 
+ */ + public com.google.storage.control.v2.ListFoldersResponse listFolders( + com.google.storage.control.v2.ListFoldersRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListFoldersMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Renames a source folder to a destination folder. During a rename, the
+     * source and destination folders are locked until the long running operation
+     * completes.
+     * 
+ */ + public com.google.longrunning.Operation renameFolder( + com.google.storage.control.v2.RenameFolderRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRenameFolderMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns the storage layout configuration for a given bucket.
+     * 
+ */ + public com.google.storage.control.v2.StorageLayout getStorageLayout( + com.google.storage.control.v2.GetStorageLayoutRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetStorageLayoutMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service StorageControl. + * + *
+   * StorageControl service includes selected control plane operations.
+   * 
+ */ + public static final class StorageControlFutureStub + extends io.grpc.stub.AbstractFutureStub { + private StorageControlFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected StorageControlFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new StorageControlFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a new folder.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createFolder(com.google.storage.control.v2.CreateFolderRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateFolderMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Permanently deletes an empty folder.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteFolder(com.google.storage.control.v2.DeleteFolderRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteFolderMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns metadata for the specified folder.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getFolder(com.google.storage.control.v2.GetFolderRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetFolderMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves a list of folders for a given bucket.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.storage.control.v2.ListFoldersResponse> + listFolders(com.google.storage.control.v2.ListFoldersRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListFoldersMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Renames a source folder to a destination folder. During a rename, the
+     * source and destination folders are locked until the long running operation
+     * completes.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + renameFolder(com.google.storage.control.v2.RenameFolderRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRenameFolderMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns the storage layout configuration for a given bucket.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.storage.control.v2.StorageLayout> + getStorageLayout(com.google.storage.control.v2.GetStorageLayoutRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetStorageLayoutMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_FOLDER = 0; + private static final int METHODID_DELETE_FOLDER = 1; + private static final int METHODID_GET_FOLDER = 2; + private static final int METHODID_LIST_FOLDERS = 3; + private static final int METHODID_RENAME_FOLDER = 4; + private static final int METHODID_GET_STORAGE_LAYOUT = 5; + + 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 AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService 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_CREATE_FOLDER: + serviceImpl.createFolder( + (com.google.storage.control.v2.CreateFolderRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_FOLDER: + serviceImpl.deleteFolder( + (com.google.storage.control.v2.DeleteFolderRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_FOLDER: + serviceImpl.getFolder( + (com.google.storage.control.v2.GetFolderRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_FOLDERS: + serviceImpl.listFolders( + (com.google.storage.control.v2.ListFoldersRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_RENAME_FOLDER: + serviceImpl.renameFolder( + (com.google.storage.control.v2.RenameFolderRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_STORAGE_LAYOUT: + serviceImpl.getStorageLayout( + (com.google.storage.control.v2.GetStorageLayoutRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateFolderMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.storage.control.v2.CreateFolderRequest, + com.google.storage.control.v2.Folder>(service, METHODID_CREATE_FOLDER))) + .addMethod( + getDeleteFolderMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.storage.control.v2.DeleteFolderRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_FOLDER))) + .addMethod( + getGetFolderMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.storage.control.v2.GetFolderRequest, + com.google.storage.control.v2.Folder>(service, METHODID_GET_FOLDER))) + .addMethod( + getListFoldersMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.storage.control.v2.ListFoldersRequest, + com.google.storage.control.v2.ListFoldersResponse>( + service, METHODID_LIST_FOLDERS))) + .addMethod( + getRenameFolderMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.storage.control.v2.RenameFolderRequest, + com.google.longrunning.Operation>(service, METHODID_RENAME_FOLDER))) + .addMethod( + getGetStorageLayoutMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.storage.control.v2.GetStorageLayoutRequest, + com.google.storage.control.v2.StorageLayout>( + service, METHODID_GET_STORAGE_LAYOUT))) + .build(); + } + + private abstract static class StorageControlBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + StorageControlBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.storage.control.v2.StorageControlProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("StorageControl"); + } + } + + private static final class StorageControlFileDescriptorSupplier + extends StorageControlBaseDescriptorSupplier { + StorageControlFileDescriptorSupplier() {} + } + + private static final class StorageControlMethodDescriptorSupplier + extends StorageControlBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + StorageControlMethodDescriptorSupplier(java.lang.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 (StorageControlGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new StorageControlFileDescriptorSupplier()) + .addMethod(getCreateFolderMethod()) + .addMethod(getDeleteFolderMethod()) + .addMethod(getGetFolderMethod()) + .addMethod(getListFoldersMethod()) + .addMethod(getRenameFolderMethod()) + .addMethod(getGetStorageLayoutMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/pom.xml b/pom.xml index 4151fb765e..41fe433316 100644 --- a/pom.xml +++ b/pom.xml @@ -129,6 +129,21 @@ gapic-google-cloud-storage-v2 2.30.1-alpha + + com.google.api.grpc + grpc-google-cloud-storage-control-v2 + 2.30.1-alpha + + + com.google.api.grpc + proto-google-cloud-storage-control-v2 + 2.30.1-alpha + + + com.google.cloud + google-cloud-storage-control + 2.30.1-alpha + com.google.cloud google-cloud-conformance-tests @@ -196,7 +211,10 @@ google-cloud-storage grpc-google-cloud-storage-v2 + grpc-google-cloud-storage-control-v2 proto-google-cloud-storage-v2 + proto-google-cloud-storage-control-v2 + google-cloud-storage-control gapic-google-cloud-storage-v2 google-cloud-storage-bom diff --git a/proto-google-cloud-storage-control-v2/clirr-ignored-differences.xml b/proto-google-cloud-storage-control-v2/clirr-ignored-differences.xml new file mode 100644 index 0000000000..9f3c1b8220 --- /dev/null +++ b/proto-google-cloud-storage-control-v2/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/storage/control/v2/*OrBuilder + * get*(*) + + + 7012 + com/google/storage/control/v2/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/storage/control/v2/*OrBuilder + boolean has*(*) + + diff --git a/proto-google-cloud-storage-control-v2/pom.xml b/proto-google-cloud-storage-control-v2/pom.xml new file mode 100644 index 0000000000..cb6af0a8ca --- /dev/null +++ b/proto-google-cloud-storage-control-v2/pom.xml @@ -0,0 +1,42 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-storage-control-v2 + 2.30.1-alpha + proto-google-cloud-storage-control-v2 + Proto library for proto-google-cloud-storage-control-v2 + + com.google.cloud + google-cloud-storage-parent + 2.30.1 + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api + api-common + + + com.google.guava + guava + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + diff --git a/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/BucketName.java b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/BucketName.java new file mode 100644 index 0000000000..410eec92a3 --- /dev/null +++ b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/BucketName.java @@ -0,0 +1,191 @@ +/* + * Copyright 2023 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.control.v2; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class BucketName implements ResourceName { + private static final PathTemplate PROJECT_BUCKET = + PathTemplate.createWithoutUrlEncoding("projects/{project}/buckets/{bucket}"); + private volatile Map fieldValuesMap; + private final String project; + private final String bucket; + + @Deprecated + protected BucketName() { + project = null; + bucket = null; + } + + private BucketName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + bucket = Preconditions.checkNotNull(builder.getBucket()); + } + + public String getProject() { + return project; + } + + public String getBucket() { + return bucket; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static BucketName of(String project, String bucket) { + return newBuilder().setProject(project).setBucket(bucket).build(); + } + + public static String format(String project, String bucket) { + return newBuilder().setProject(project).setBucket(bucket).build().toString(); + } + + public static BucketName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_BUCKET.validatedMatch( + formattedString, "BucketName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("bucket")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (BucketName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_BUCKET.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (bucket != null) { + fieldMapBuilder.put("bucket", bucket); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_BUCKET.instantiate("project", project, "bucket", bucket); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + BucketName that = ((BucketName) o); + return Objects.equals(this.project, that.project) && Objects.equals(this.bucket, that.bucket); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(bucket); + return h; + } + + /** Builder for projects/{project}/buckets/{bucket}. */ + public static class Builder { + private String project; + private String bucket; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getBucket() { + return bucket; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setBucket(String bucket) { + this.bucket = bucket; + return this; + } + + private Builder(BucketName bucketName) { + this.project = bucketName.project; + this.bucket = bucketName.bucket; + } + + public BucketName build() { + return new BucketName(this); + } + } +} diff --git a/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/CommonLongRunningOperationMetadata.java b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/CommonLongRunningOperationMetadata.java new file mode 100644 index 0000000000..400816a45f --- /dev/null +++ b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/CommonLongRunningOperationMetadata.java @@ -0,0 +1,1657 @@ +/* + * Copyright 2023 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/control/v2/storage_control.proto + +package com.google.storage.control.v2; + +/** + * + * + *
+ * The message contains metadata that is common to all Storage Control
+ * long-running operations, present in its `google.longrunning.Operation`
+ * messages, and accessible via `metadata.common_metadata`.
+ * 
+ * + * Protobuf type {@code google.storage.control.v2.CommonLongRunningOperationMetadata} + */ +public final class CommonLongRunningOperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.control.v2.CommonLongRunningOperationMetadata) + CommonLongRunningOperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use CommonLongRunningOperationMetadata.newBuilder() to construct. + private CommonLongRunningOperationMetadata( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CommonLongRunningOperationMetadata() { + type_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CommonLongRunningOperationMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_CommonLongRunningOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_CommonLongRunningOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.control.v2.CommonLongRunningOperationMetadata.class, + com.google.storage.control.v2.CommonLongRunningOperationMetadata.Builder.class); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.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 time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.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 time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int END_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp endTime_; + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endTime_ != null; + } + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The time the operation was last modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.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 time the operation was last modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.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 time the operation was last modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int TYPE_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object type_ = ""; + /** + * + * + *
+   * Output only. The type of operation invoked.
+   * 
+ * + * string type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+   * Output only. The type of operation invoked.
+   * 
+ * + * string type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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 REQUESTED_CANCELLATION_FIELD_NUMBER = 5; + private boolean requestedCancellation_ = false; + /** + * + * + *
+   * Output only. Identifies whether the user has requested cancellation.
+   * 
+ * + * bool requested_cancellation = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + @java.lang.Override + public boolean getRequestedCancellation() { + return requestedCancellation_; + } + + public static final int PROGRESS_PERCENT_FIELD_NUMBER = 6; + private int progressPercent_ = 0; + /** + * + * + *
+   * Output only. The estimated progress of the operation in percentage [0,
+   * 100]. The value -1 means the progress is unknown.
+   * 
+ * + * int32 progress_percent = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The progressPercent. + */ + @java.lang.Override + public int getProgressPercent() { + return progressPercent_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (createTime_ != null) { + output.writeMessage(1, getCreateTime()); + } + if (endTime_ != null) { + output.writeMessage(2, getEndTime()); + } + if (updateTime_ != null) { + output.writeMessage(3, getUpdateTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, type_); + } + if (requestedCancellation_ != false) { + output.writeBool(5, requestedCancellation_); + } + if (progressPercent_ != 0) { + output.writeInt32(6, progressPercent_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCreateTime()); + } + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEndTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getUpdateTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, type_); + } + if (requestedCancellation_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, requestedCancellation_); + } + if (progressPercent_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(6, progressPercent_); + } + size += getUnknownFields().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.control.v2.CommonLongRunningOperationMetadata)) { + return super.equals(obj); + } + com.google.storage.control.v2.CommonLongRunningOperationMetadata other = + (com.google.storage.control.v2.CommonLongRunningOperationMetadata) obj; + + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (!getType().equals(other.getType())) return false; + if (getRequestedCancellation() != other.getRequestedCancellation()) return false; + if (getProgressPercent() != other.getProgressPercent()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + hash = (37 * hash) + REQUESTED_CANCELLATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRequestedCancellation()); + hash = (37 * hash) + PROGRESS_PERCENT_FIELD_NUMBER; + hash = (53 * hash) + getProgressPercent(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.control.v2.CommonLongRunningOperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.control.v2.CommonLongRunningOperationMetadata 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.control.v2.CommonLongRunningOperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.control.v2.CommonLongRunningOperationMetadata 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.control.v2.CommonLongRunningOperationMetadata parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.control.v2.CommonLongRunningOperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.control.v2.CommonLongRunningOperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.control.v2.CommonLongRunningOperationMetadata 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.control.v2.CommonLongRunningOperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.control.v2.CommonLongRunningOperationMetadata 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.control.v2.CommonLongRunningOperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.control.v2.CommonLongRunningOperationMetadata 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.control.v2.CommonLongRunningOperationMetadata 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 message contains metadata that is common to all Storage Control
+   * long-running operations, present in its `google.longrunning.Operation`
+   * messages, and accessible via `metadata.common_metadata`.
+   * 
+ * + * Protobuf type {@code google.storage.control.v2.CommonLongRunningOperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.control.v2.CommonLongRunningOperationMetadata) + com.google.storage.control.v2.CommonLongRunningOperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_CommonLongRunningOperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_CommonLongRunningOperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.control.v2.CommonLongRunningOperationMetadata.class, + com.google.storage.control.v2.CommonLongRunningOperationMetadata.Builder.class); + } + + // Construct using com.google.storage.control.v2.CommonLongRunningOperationMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + type_ = ""; + requestedCancellation_ = false; + progressPercent_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_CommonLongRunningOperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.storage.control.v2.CommonLongRunningOperationMetadata + getDefaultInstanceForType() { + return com.google.storage.control.v2.CommonLongRunningOperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.control.v2.CommonLongRunningOperationMetadata build() { + com.google.storage.control.v2.CommonLongRunningOperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.control.v2.CommonLongRunningOperationMetadata buildPartial() { + com.google.storage.control.v2.CommonLongRunningOperationMetadata result = + new com.google.storage.control.v2.CommonLongRunningOperationMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.storage.control.v2.CommonLongRunningOperationMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.requestedCancellation_ = requestedCancellation_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.progressPercent_ = progressPercent_; + } + } + + @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.control.v2.CommonLongRunningOperationMetadata) { + return mergeFrom((com.google.storage.control.v2.CommonLongRunningOperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.storage.control.v2.CommonLongRunningOperationMetadata other) { + if (other + == com.google.storage.control.v2.CommonLongRunningOperationMetadata.getDefaultInstance()) + return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (!other.getType().isEmpty()) { + type_ = other.type_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.getRequestedCancellation() != false) { + setRequestedCancellation(other.getRequestedCancellation()); + } + if (other.getProgressPercent() != 0) { + setProgressPercent(other.getProgressPercent()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + type_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: + { + requestedCancellation_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 48: + { + progressPercent_ = input.readInt32(); + bitField0_ |= 0x00000020; + break; + } // case 48 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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 time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000001); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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 time the operation was created.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 1 [(.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 com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + } else { + endTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); + } else { + endTime_ = value; + } + } else { + endTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00000002); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + * + * + *
+     * Output only. The time the operation finished running.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private 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 time the operation was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Output only. The time the operation was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.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 time the operation was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.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; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000004); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The time the operation was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time the operation was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.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 time the operation was last modified.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.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 type_ = ""; + /** + * + * + *
+     * Output only. The type of operation invoked.
+     * 
+ * + * string type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The type of operation invoked.
+     * 
+ * + * string type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The type of operation invoked.
+     * 
+ * + * string type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The type of operation invoked.
+     * 
+ * + * string type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearType() { + type_ = getDefaultInstance().getType(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The type of operation invoked.
+     * 
+ * + * string type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private boolean requestedCancellation_; + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation.
+     * 
+ * + * bool requested_cancellation = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + @java.lang.Override + public boolean getRequestedCancellation() { + return requestedCancellation_; + } + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation.
+     * 
+ * + * bool requested_cancellation = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The requestedCancellation to set. + * @return This builder for chaining. + */ + public Builder setRequestedCancellation(boolean value) { + + requestedCancellation_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Identifies whether the user has requested cancellation.
+     * 
+ * + * bool requested_cancellation = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearRequestedCancellation() { + bitField0_ = (bitField0_ & ~0x00000010); + requestedCancellation_ = false; + onChanged(); + return this; + } + + private int progressPercent_; + /** + * + * + *
+     * Output only. The estimated progress of the operation in percentage [0,
+     * 100]. The value -1 means the progress is unknown.
+     * 
+ * + * int32 progress_percent = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The progressPercent. + */ + @java.lang.Override + public int getProgressPercent() { + return progressPercent_; + } + /** + * + * + *
+     * Output only. The estimated progress of the operation in percentage [0,
+     * 100]. The value -1 means the progress is unknown.
+     * 
+ * + * int32 progress_percent = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The progressPercent to set. + * @return This builder for chaining. + */ + public Builder setProgressPercent(int value) { + + progressPercent_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The estimated progress of the operation in percentage [0,
+     * 100]. The value -1 means the progress is unknown.
+     * 
+ * + * int32 progress_percent = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearProgressPercent() { + bitField0_ = (bitField0_ & ~0x00000020); + progressPercent_ = 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.control.v2.CommonLongRunningOperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.storage.control.v2.CommonLongRunningOperationMetadata) + private static final com.google.storage.control.v2.CommonLongRunningOperationMetadata + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.control.v2.CommonLongRunningOperationMetadata(); + } + + public static com.google.storage.control.v2.CommonLongRunningOperationMetadata + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CommonLongRunningOperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.control.v2.CommonLongRunningOperationMetadata + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/CommonLongRunningOperationMetadataOrBuilder.java b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/CommonLongRunningOperationMetadataOrBuilder.java new file mode 100644 index 0000000000..1393da9a47 --- /dev/null +++ b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/CommonLongRunningOperationMetadataOrBuilder.java @@ -0,0 +1,191 @@ +/* + * Copyright 2023 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/control/v2/storage_control.proto + +package com.google.storage.control.v2; + +public interface CommonLongRunningOperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.control.v2.CommonLongRunningOperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The time the operation was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+   * Output only. The time the operation finished running.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time the operation was last modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The time the operation was last modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The time the operation was last modified.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The type of operation invoked.
+   * 
+ * + * string type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The type. + */ + java.lang.String getType(); + /** + * + * + *
+   * Output only. The type of operation invoked.
+   * 
+ * + * string type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for type. + */ + com.google.protobuf.ByteString getTypeBytes(); + + /** + * + * + *
+   * Output only. Identifies whether the user has requested cancellation.
+   * 
+ * + * bool requested_cancellation = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The requestedCancellation. + */ + boolean getRequestedCancellation(); + + /** + * + * + *
+   * Output only. The estimated progress of the operation in percentage [0,
+   * 100]. The value -1 means the progress is unknown.
+   * 
+ * + * int32 progress_percent = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The progressPercent. + */ + int getProgressPercent(); +} diff --git a/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/CreateFolderRequest.java b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/CreateFolderRequest.java new file mode 100644 index 0000000000..74aa3770e8 --- /dev/null +++ b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/CreateFolderRequest.java @@ -0,0 +1,1435 @@ +/* + * Copyright 2023 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/control/v2/storage_control.proto + +package com.google.storage.control.v2; + +/** + * + * + *
+ * Request message for CreateFolder.
+ * 
+ * + * Protobuf type {@code google.storage.control.v2.CreateFolderRequest} + */ +public final class CreateFolderRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.control.v2.CreateFolderRequest) + CreateFolderRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateFolderRequest.newBuilder() to construct. + private CreateFolderRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateFolderRequest() { + parent_ = ""; + folderId_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateFolderRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_CreateFolderRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_CreateFolderRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.control.v2.CreateFolderRequest.class, + com.google.storage.control.v2.CreateFolderRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Name of the bucket in which the folder will reside.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the bucket in which the folder will reside.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FOLDER_FIELD_NUMBER = 2; + private com.google.storage.control.v2.Folder folder_; + /** + * + * + *
+   * Required. Properties of the new folder being created.
+   * The bucket and name of the folder are specified in the parent and folder_id
+   * fields, respectively. Populating those fields in `folder` will result in an
+   * error.
+   * 
+ * + * .google.storage.control.v2.Folder folder = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the folder field is set. + */ + @java.lang.Override + public boolean hasFolder() { + return folder_ != null; + } + /** + * + * + *
+   * Required. Properties of the new folder being created.
+   * The bucket and name of the folder are specified in the parent and folder_id
+   * fields, respectively. Populating those fields in `folder` will result in an
+   * error.
+   * 
+ * + * .google.storage.control.v2.Folder folder = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The folder. + */ + @java.lang.Override + public com.google.storage.control.v2.Folder getFolder() { + return folder_ == null ? com.google.storage.control.v2.Folder.getDefaultInstance() : folder_; + } + /** + * + * + *
+   * Required. Properties of the new folder being created.
+   * The bucket and name of the folder are specified in the parent and folder_id
+   * fields, respectively. Populating those fields in `folder` will result in an
+   * error.
+   * 
+ * + * .google.storage.control.v2.Folder folder = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.storage.control.v2.FolderOrBuilder getFolderOrBuilder() { + return folder_ == null ? com.google.storage.control.v2.Folder.getDefaultInstance() : folder_; + } + + public static final int FOLDER_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object folderId_ = ""; + /** + * + * + *
+   * Required. The absolute path of the folder, using a single `/` as delimiter.
+   * 
+ * + * string folder_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The folderId. + */ + @java.lang.Override + public java.lang.String getFolderId() { + java.lang.Object ref = folderId_; + 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(); + folderId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The absolute path of the folder, using a single `/` as delimiter.
+   * 
+ * + * string folder_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for folderId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFolderIdBytes() { + java.lang.Object ref = folderId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + folderId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RECURSIVE_FIELD_NUMBER = 4; + private boolean recursive_ = false; + /** + * + * + *
+   * Optional. If true, parent folder doesn't have to be present and all missing
+   * ancestor folders will be created atomically.
+   * 
+ * + * bool recursive = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The recursive. + */ + @java.lang.Override + public boolean getRecursive() { + return recursive_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. A unique identifier for this request. UUID is the recommended
+   * format, but other formats are still accepted. This request is only
+   * idempotent if a `request_id` is provided.
+   * 
+ * + * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + 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(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. A unique identifier for this request. UUID is the recommended
+   * format, but other formats are still accepted. This request is only
+   * idempotent if a `request_id` is provided.
+   * 
+ * + * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (folder_ != null) { + output.writeMessage(2, getFolder()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(folderId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, folderId_); + } + if (recursive_ != false) { + output.writeBool(4, recursive_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, requestId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (folder_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getFolder()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(folderId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, folderId_); + } + if (recursive_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, recursive_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, requestId_); + } + size += getUnknownFields().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.control.v2.CreateFolderRequest)) { + return super.equals(obj); + } + com.google.storage.control.v2.CreateFolderRequest other = + (com.google.storage.control.v2.CreateFolderRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasFolder() != other.hasFolder()) return false; + if (hasFolder()) { + if (!getFolder().equals(other.getFolder())) return false; + } + if (!getFolderId().equals(other.getFolderId())) return false; + if (getRecursive() != other.getRecursive()) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasFolder()) { + hash = (37 * hash) + FOLDER_FIELD_NUMBER; + hash = (53 * hash) + getFolder().hashCode(); + } + hash = (37 * hash) + FOLDER_ID_FIELD_NUMBER; + hash = (53 * hash) + getFolderId().hashCode(); + hash = (37 * hash) + RECURSIVE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRecursive()); + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.control.v2.CreateFolderRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.control.v2.CreateFolderRequest 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.control.v2.CreateFolderRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.control.v2.CreateFolderRequest 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.control.v2.CreateFolderRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.control.v2.CreateFolderRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.control.v2.CreateFolderRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.control.v2.CreateFolderRequest 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.control.v2.CreateFolderRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.control.v2.CreateFolderRequest 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.control.v2.CreateFolderRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.control.v2.CreateFolderRequest 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.control.v2.CreateFolderRequest 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 CreateFolder.
+   * 
+ * + * Protobuf type {@code google.storage.control.v2.CreateFolderRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.control.v2.CreateFolderRequest) + com.google.storage.control.v2.CreateFolderRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_CreateFolderRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_CreateFolderRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.control.v2.CreateFolderRequest.class, + com.google.storage.control.v2.CreateFolderRequest.Builder.class); + } + + // Construct using com.google.storage.control.v2.CreateFolderRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + folder_ = null; + if (folderBuilder_ != null) { + folderBuilder_.dispose(); + folderBuilder_ = null; + } + folderId_ = ""; + recursive_ = false; + requestId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_CreateFolderRequest_descriptor; + } + + @java.lang.Override + public com.google.storage.control.v2.CreateFolderRequest getDefaultInstanceForType() { + return com.google.storage.control.v2.CreateFolderRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.control.v2.CreateFolderRequest build() { + com.google.storage.control.v2.CreateFolderRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.control.v2.CreateFolderRequest buildPartial() { + com.google.storage.control.v2.CreateFolderRequest result = + new com.google.storage.control.v2.CreateFolderRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.storage.control.v2.CreateFolderRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.folder_ = folderBuilder_ == null ? folder_ : folderBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.folderId_ = folderId_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.recursive_ = recursive_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.requestId_ = requestId_; + } + } + + @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.control.v2.CreateFolderRequest) { + return mergeFrom((com.google.storage.control.v2.CreateFolderRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.control.v2.CreateFolderRequest other) { + if (other == com.google.storage.control.v2.CreateFolderRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasFolder()) { + mergeFolder(other.getFolder()); + } + if (!other.getFolderId().isEmpty()) { + folderId_ = other.folderId_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getRecursive() != false) { + setRecursive(other.getRecursive()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000010; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getFolderFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + folderId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + recursive_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Name of the bucket in which the folder will reside.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the bucket in which the folder will reside.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the bucket in which the folder will reside.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the bucket in which the folder will reside.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the bucket in which the folder will reside.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.storage.control.v2.Folder folder_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.control.v2.Folder, + com.google.storage.control.v2.Folder.Builder, + com.google.storage.control.v2.FolderOrBuilder> + folderBuilder_; + /** + * + * + *
+     * Required. Properties of the new folder being created.
+     * The bucket and name of the folder are specified in the parent and folder_id
+     * fields, respectively. Populating those fields in `folder` will result in an
+     * error.
+     * 
+ * + * .google.storage.control.v2.Folder folder = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the folder field is set. + */ + public boolean hasFolder() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. Properties of the new folder being created.
+     * The bucket and name of the folder are specified in the parent and folder_id
+     * fields, respectively. Populating those fields in `folder` will result in an
+     * error.
+     * 
+ * + * .google.storage.control.v2.Folder folder = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The folder. + */ + public com.google.storage.control.v2.Folder getFolder() { + if (folderBuilder_ == null) { + return folder_ == null + ? com.google.storage.control.v2.Folder.getDefaultInstance() + : folder_; + } else { + return folderBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Properties of the new folder being created.
+     * The bucket and name of the folder are specified in the parent and folder_id
+     * fields, respectively. Populating those fields in `folder` will result in an
+     * error.
+     * 
+ * + * .google.storage.control.v2.Folder folder = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setFolder(com.google.storage.control.v2.Folder value) { + if (folderBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + folder_ = value; + } else { + folderBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Properties of the new folder being created.
+     * The bucket and name of the folder are specified in the parent and folder_id
+     * fields, respectively. Populating those fields in `folder` will result in an
+     * error.
+     * 
+ * + * .google.storage.control.v2.Folder folder = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setFolder(com.google.storage.control.v2.Folder.Builder builderForValue) { + if (folderBuilder_ == null) { + folder_ = builderForValue.build(); + } else { + folderBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Properties of the new folder being created.
+     * The bucket and name of the folder are specified in the parent and folder_id
+     * fields, respectively. Populating those fields in `folder` will result in an
+     * error.
+     * 
+ * + * .google.storage.control.v2.Folder folder = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeFolder(com.google.storage.control.v2.Folder value) { + if (folderBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && folder_ != null + && folder_ != com.google.storage.control.v2.Folder.getDefaultInstance()) { + getFolderBuilder().mergeFrom(value); + } else { + folder_ = value; + } + } else { + folderBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Properties of the new folder being created.
+     * The bucket and name of the folder are specified in the parent and folder_id
+     * fields, respectively. Populating those fields in `folder` will result in an
+     * error.
+     * 
+ * + * .google.storage.control.v2.Folder folder = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearFolder() { + bitField0_ = (bitField0_ & ~0x00000002); + folder_ = null; + if (folderBuilder_ != null) { + folderBuilder_.dispose(); + folderBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Properties of the new folder being created.
+     * The bucket and name of the folder are specified in the parent and folder_id
+     * fields, respectively. Populating those fields in `folder` will result in an
+     * error.
+     * 
+ * + * .google.storage.control.v2.Folder folder = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.storage.control.v2.Folder.Builder getFolderBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getFolderFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Properties of the new folder being created.
+     * The bucket and name of the folder are specified in the parent and folder_id
+     * fields, respectively. Populating those fields in `folder` will result in an
+     * error.
+     * 
+ * + * .google.storage.control.v2.Folder folder = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.storage.control.v2.FolderOrBuilder getFolderOrBuilder() { + if (folderBuilder_ != null) { + return folderBuilder_.getMessageOrBuilder(); + } else { + return folder_ == null + ? com.google.storage.control.v2.Folder.getDefaultInstance() + : folder_; + } + } + /** + * + * + *
+     * Required. Properties of the new folder being created.
+     * The bucket and name of the folder are specified in the parent and folder_id
+     * fields, respectively. Populating those fields in `folder` will result in an
+     * error.
+     * 
+ * + * .google.storage.control.v2.Folder folder = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.control.v2.Folder, + com.google.storage.control.v2.Folder.Builder, + com.google.storage.control.v2.FolderOrBuilder> + getFolderFieldBuilder() { + if (folderBuilder_ == null) { + folderBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.control.v2.Folder, + com.google.storage.control.v2.Folder.Builder, + com.google.storage.control.v2.FolderOrBuilder>( + getFolder(), getParentForChildren(), isClean()); + folder_ = null; + } + return folderBuilder_; + } + + private java.lang.Object folderId_ = ""; + /** + * + * + *
+     * Required. The absolute path of the folder, using a single `/` as delimiter.
+     * 
+ * + * string folder_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The folderId. + */ + public java.lang.String getFolderId() { + java.lang.Object ref = folderId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + folderId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The absolute path of the folder, using a single `/` as delimiter.
+     * 
+ * + * string folder_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for folderId. + */ + public com.google.protobuf.ByteString getFolderIdBytes() { + java.lang.Object ref = folderId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + folderId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The absolute path of the folder, using a single `/` as delimiter.
+     * 
+ * + * string folder_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The folderId to set. + * @return This builder for chaining. + */ + public Builder setFolderId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + folderId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The absolute path of the folder, using a single `/` as delimiter.
+     * 
+ * + * string folder_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearFolderId() { + folderId_ = getDefaultInstance().getFolderId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The absolute path of the folder, using a single `/` as delimiter.
+     * 
+ * + * string folder_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for folderId to set. + * @return This builder for chaining. + */ + public Builder setFolderIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + folderId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private boolean recursive_; + /** + * + * + *
+     * Optional. If true, parent folder doesn't have to be present and all missing
+     * ancestor folders will be created atomically.
+     * 
+ * + * bool recursive = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The recursive. + */ + @java.lang.Override + public boolean getRecursive() { + return recursive_; + } + /** + * + * + *
+     * Optional. If true, parent folder doesn't have to be present and all missing
+     * ancestor folders will be created atomically.
+     * 
+ * + * bool recursive = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The recursive to set. + * @return This builder for chaining. + */ + public Builder setRecursive(boolean value) { + + recursive_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If true, parent folder doesn't have to be present and all missing
+     * ancestor folders will be created atomically.
+     * 
+ * + * bool recursive = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearRecursive() { + bitField0_ = (bitField0_ & ~0x00000008); + recursive_ = false; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. A unique identifier for this request. UUID is the recommended
+     * format, but other formats are still accepted. This request is only
+     * idempotent if a `request_id` is provided.
+     * 
+ * + * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. A unique identifier for this request. UUID is the recommended
+     * format, but other formats are still accepted. This request is only
+     * idempotent if a `request_id` is provided.
+     * 
+ * + * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. A unique identifier for this request. UUID is the recommended
+     * format, but other formats are still accepted. This request is only
+     * idempotent if a `request_id` is provided.
+     * 
+ * + * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + requestId_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A unique identifier for this request. UUID is the recommended
+     * format, but other formats are still accepted. This request is only
+     * idempotent if a `request_id` is provided.
+     * 
+ * + * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A unique identifier for this request. UUID is the recommended
+     * format, but other formats are still accepted. This request is only
+     * idempotent if a `request_id` is provided.
+     * 
+ * + * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + requestId_ = value; + bitField0_ |= 0x00000010; + 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.control.v2.CreateFolderRequest) + } + + // @@protoc_insertion_point(class_scope:google.storage.control.v2.CreateFolderRequest) + private static final com.google.storage.control.v2.CreateFolderRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.control.v2.CreateFolderRequest(); + } + + public static com.google.storage.control.v2.CreateFolderRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateFolderRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.control.v2.CreateFolderRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/CreateFolderRequestOrBuilder.java b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/CreateFolderRequestOrBuilder.java new file mode 100644 index 0000000000..abe59fa8d2 --- /dev/null +++ b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/CreateFolderRequestOrBuilder.java @@ -0,0 +1,173 @@ +/* + * Copyright 2023 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/control/v2/storage_control.proto + +package com.google.storage.control.v2; + +public interface CreateFolderRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.control.v2.CreateFolderRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the bucket in which the folder will reside.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Name of the bucket in which the folder will reside.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. Properties of the new folder being created.
+   * The bucket and name of the folder are specified in the parent and folder_id
+   * fields, respectively. Populating those fields in `folder` will result in an
+   * error.
+   * 
+ * + * .google.storage.control.v2.Folder folder = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the folder field is set. + */ + boolean hasFolder(); + /** + * + * + *
+   * Required. Properties of the new folder being created.
+   * The bucket and name of the folder are specified in the parent and folder_id
+   * fields, respectively. Populating those fields in `folder` will result in an
+   * error.
+   * 
+ * + * .google.storage.control.v2.Folder folder = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The folder. + */ + com.google.storage.control.v2.Folder getFolder(); + /** + * + * + *
+   * Required. Properties of the new folder being created.
+   * The bucket and name of the folder are specified in the parent and folder_id
+   * fields, respectively. Populating those fields in `folder` will result in an
+   * error.
+   * 
+ * + * .google.storage.control.v2.Folder folder = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.storage.control.v2.FolderOrBuilder getFolderOrBuilder(); + + /** + * + * + *
+   * Required. The absolute path of the folder, using a single `/` as delimiter.
+   * 
+ * + * string folder_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The folderId. + */ + java.lang.String getFolderId(); + /** + * + * + *
+   * Required. The absolute path of the folder, using a single `/` as delimiter.
+   * 
+ * + * string folder_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for folderId. + */ + com.google.protobuf.ByteString getFolderIdBytes(); + + /** + * + * + *
+   * Optional. If true, parent folder doesn't have to be present and all missing
+   * ancestor folders will be created atomically.
+   * 
+ * + * bool recursive = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The recursive. + */ + boolean getRecursive(); + + /** + * + * + *
+   * Optional. A unique identifier for this request. UUID is the recommended
+   * format, but other formats are still accepted. This request is only
+   * idempotent if a `request_id` is provided.
+   * 
+ * + * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. A unique identifier for this request. UUID is the recommended
+   * format, but other formats are still accepted. This request is only
+   * idempotent if a `request_id` is provided.
+   * 
+ * + * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/DeleteFolderRequest.java b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/DeleteFolderRequest.java new file mode 100644 index 0000000000..06f681fefe --- /dev/null +++ b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/DeleteFolderRequest.java @@ -0,0 +1,1128 @@ +/* + * Copyright 2023 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/control/v2/storage_control.proto + +package com.google.storage.control.v2; + +/** + * + * + *
+ * Request message for DeleteFolder.
+ * 
+ * + * Protobuf type {@code google.storage.control.v2.DeleteFolderRequest} + */ +public final class DeleteFolderRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.control.v2.DeleteFolderRequest) + DeleteFolderRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteFolderRequest.newBuilder() to construct. + private DeleteFolderRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteFolderRequest() { + name_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteFolderRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_DeleteFolderRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_DeleteFolderRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.control.v2.DeleteFolderRequest.class, + com.google.storage.control.v2.DeleteFolderRequest.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Name of the folder.
+   * Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
+   * 
+ * + * + * string name = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the folder.
+   * Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
+   * 
+ * + * + * string name = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IF_METAGENERATION_MATCH_FIELD_NUMBER = 3; + private long ifMetagenerationMatch_ = 0L; + /** + * + * + *
+   * Makes the operation only succeed conditional on whether the folder's
+   * current metageneration matches the given value.
+   * 
+ * + * optional int64 if_metageneration_match = 3; + * + * @return Whether the ifMetagenerationMatch field is set. + */ + @java.lang.Override + public boolean hasIfMetagenerationMatch() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Makes the operation only succeed conditional on whether the folder's
+   * current metageneration matches the given value.
+   * 
+ * + * optional int64 if_metageneration_match = 3; + * + * @return The ifMetagenerationMatch. + */ + @java.lang.Override + public long getIfMetagenerationMatch() { + return ifMetagenerationMatch_; + } + + public static final int IF_METAGENERATION_NOT_MATCH_FIELD_NUMBER = 4; + private long ifMetagenerationNotMatch_ = 0L; + /** + * + * + *
+   * Makes the operation only succeed conditional on whether the folder's
+   * current metageneration does not match the given value.
+   * 
+ * + * optional int64 if_metageneration_not_match = 4; + * + * @return Whether the ifMetagenerationNotMatch field is set. + */ + @java.lang.Override + public boolean hasIfMetagenerationNotMatch() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Makes the operation only succeed conditional on whether the folder's
+   * current metageneration does not match the given value.
+   * 
+ * + * optional int64 if_metageneration_not_match = 4; + * + * @return The ifMetagenerationNotMatch. + */ + @java.lang.Override + public long getIfMetagenerationNotMatch() { + return ifMetagenerationNotMatch_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. A unique identifier for this request. UUID is the recommended
+   * format, but other formats are still accepted. This request is only
+   * idempotent if a `request_id` is provided.
+   * 
+ * + * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + 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(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. A unique identifier for this request. UUID is the recommended
+   * format, but other formats are still accepted. This request is only
+   * idempotent if a `request_id` is provided.
+   * 
+ * + * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeInt64(3, ifMetagenerationMatch_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeInt64(4, ifMetagenerationNotMatch_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, requestId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, name_); + } + getUnknownFields().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.computeInt64Size(3, ifMetagenerationMatch_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, ifMetagenerationNotMatch_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, requestId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, name_); + } + size += getUnknownFields().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.control.v2.DeleteFolderRequest)) { + return super.equals(obj); + } + com.google.storage.control.v2.DeleteFolderRequest other = + (com.google.storage.control.v2.DeleteFolderRequest) obj; + + if (!getName().equals(other.getName())) 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 (!getRequestId().equals(other.getRequestId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + 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 = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.control.v2.DeleteFolderRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.control.v2.DeleteFolderRequest 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.control.v2.DeleteFolderRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.control.v2.DeleteFolderRequest 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.control.v2.DeleteFolderRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.control.v2.DeleteFolderRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.control.v2.DeleteFolderRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.control.v2.DeleteFolderRequest 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.control.v2.DeleteFolderRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.control.v2.DeleteFolderRequest 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.control.v2.DeleteFolderRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.control.v2.DeleteFolderRequest 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.control.v2.DeleteFolderRequest 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 DeleteFolder.
+   * 
+ * + * Protobuf type {@code google.storage.control.v2.DeleteFolderRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.control.v2.DeleteFolderRequest) + com.google.storage.control.v2.DeleteFolderRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_DeleteFolderRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_DeleteFolderRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.control.v2.DeleteFolderRequest.class, + com.google.storage.control.v2.DeleteFolderRequest.Builder.class); + } + + // Construct using com.google.storage.control.v2.DeleteFolderRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + ifMetagenerationMatch_ = 0L; + ifMetagenerationNotMatch_ = 0L; + requestId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_DeleteFolderRequest_descriptor; + } + + @java.lang.Override + public com.google.storage.control.v2.DeleteFolderRequest getDefaultInstanceForType() { + return com.google.storage.control.v2.DeleteFolderRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.control.v2.DeleteFolderRequest build() { + com.google.storage.control.v2.DeleteFolderRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.control.v2.DeleteFolderRequest buildPartial() { + com.google.storage.control.v2.DeleteFolderRequest result = + new com.google.storage.control.v2.DeleteFolderRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.storage.control.v2.DeleteFolderRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.ifMetagenerationMatch_ = ifMetagenerationMatch_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.ifMetagenerationNotMatch_ = ifMetagenerationNotMatch_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.requestId_ = requestId_; + } + result.bitField0_ |= to_bitField0_; + } + + @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.control.v2.DeleteFolderRequest) { + return mergeFrom((com.google.storage.control.v2.DeleteFolderRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.control.v2.DeleteFolderRequest other) { + if (other == com.google.storage.control.v2.DeleteFolderRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasIfMetagenerationMatch()) { + setIfMetagenerationMatch(other.getIfMetagenerationMatch()); + } + if (other.hasIfMetagenerationNotMatch()) { + setIfMetagenerationNotMatch(other.getIfMetagenerationNotMatch()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000008; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 24: + { + ifMetagenerationMatch_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 24 + case 32: + { + ifMetagenerationNotMatch_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 32 + case 42: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 42 + case 50: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the folder.
+     * Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
+     * 
+ * + * + * string name = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the folder.
+     * Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
+     * 
+ * + * + * string name = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the folder.
+     * Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
+     * 
+ * + * + * string name = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the folder.
+     * Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
+     * 
+ * + * + * string name = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the folder.
+     * Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
+     * 
+ * + * + * string name = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private long ifMetagenerationMatch_; + /** + * + * + *
+     * Makes the operation only succeed conditional on whether the folder's
+     * current metageneration matches the given value.
+     * 
+ * + * optional int64 if_metageneration_match = 3; + * + * @return Whether the ifMetagenerationMatch field is set. + */ + @java.lang.Override + public boolean hasIfMetagenerationMatch() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Makes the operation only succeed conditional on whether the folder's
+     * current metageneration matches the given value.
+     * 
+ * + * optional int64 if_metageneration_match = 3; + * + * @return The ifMetagenerationMatch. + */ + @java.lang.Override + public long getIfMetagenerationMatch() { + return ifMetagenerationMatch_; + } + /** + * + * + *
+     * Makes the operation only succeed conditional on whether the folder's
+     * current metageneration matches the given value.
+     * 
+ * + * optional int64 if_metageneration_match = 3; + * + * @param value The ifMetagenerationMatch to set. + * @return This builder for chaining. + */ + public Builder setIfMetagenerationMatch(long value) { + + ifMetagenerationMatch_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Makes the operation only succeed conditional on whether the folder's
+     * current metageneration matches the given value.
+     * 
+ * + * optional int64 if_metageneration_match = 3; + * + * @return This builder for chaining. + */ + public Builder clearIfMetagenerationMatch() { + bitField0_ = (bitField0_ & ~0x00000002); + ifMetagenerationMatch_ = 0L; + onChanged(); + return this; + } + + private long ifMetagenerationNotMatch_; + /** + * + * + *
+     * Makes the operation only succeed conditional on whether the folder's
+     * current metageneration does not match the given value.
+     * 
+ * + * optional int64 if_metageneration_not_match = 4; + * + * @return Whether the ifMetagenerationNotMatch field is set. + */ + @java.lang.Override + public boolean hasIfMetagenerationNotMatch() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Makes the operation only succeed conditional on whether the folder's
+     * current metageneration does not match the given value.
+     * 
+ * + * optional int64 if_metageneration_not_match = 4; + * + * @return The ifMetagenerationNotMatch. + */ + @java.lang.Override + public long getIfMetagenerationNotMatch() { + return ifMetagenerationNotMatch_; + } + /** + * + * + *
+     * Makes the operation only succeed conditional on whether the folder's
+     * current metageneration does not match the given value.
+     * 
+ * + * optional int64 if_metageneration_not_match = 4; + * + * @param value The ifMetagenerationNotMatch to set. + * @return This builder for chaining. + */ + public Builder setIfMetagenerationNotMatch(long value) { + + ifMetagenerationNotMatch_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Makes the operation only succeed conditional on whether the folder's
+     * current metageneration does not match the given value.
+     * 
+ * + * optional int64 if_metageneration_not_match = 4; + * + * @return This builder for chaining. + */ + public Builder clearIfMetagenerationNotMatch() { + bitField0_ = (bitField0_ & ~0x00000004); + ifMetagenerationNotMatch_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. A unique identifier for this request. UUID is the recommended
+     * format, but other formats are still accepted. This request is only
+     * idempotent if a `request_id` is provided.
+     * 
+ * + * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. A unique identifier for this request. UUID is the recommended
+     * format, but other formats are still accepted. This request is only
+     * idempotent if a `request_id` is provided.
+     * 
+ * + * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. A unique identifier for this request. UUID is the recommended
+     * format, but other formats are still accepted. This request is only
+     * idempotent if a `request_id` is provided.
+     * 
+ * + * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + requestId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A unique identifier for this request. UUID is the recommended
+     * format, but other formats are still accepted. This request is only
+     * idempotent if a `request_id` is provided.
+     * 
+ * + * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A unique identifier for this request. UUID is the recommended
+     * format, but other formats are still accepted. This request is only
+     * idempotent if a `request_id` is provided.
+     * 
+ * + * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + requestId_ = value; + bitField0_ |= 0x00000008; + 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.control.v2.DeleteFolderRequest) + } + + // @@protoc_insertion_point(class_scope:google.storage.control.v2.DeleteFolderRequest) + private static final com.google.storage.control.v2.DeleteFolderRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.control.v2.DeleteFolderRequest(); + } + + public static com.google.storage.control.v2.DeleteFolderRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteFolderRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.control.v2.DeleteFolderRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/DeleteFolderRequestOrBuilder.java b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/DeleteFolderRequestOrBuilder.java new file mode 100644 index 0000000000..b00b191b83 --- /dev/null +++ b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/DeleteFolderRequestOrBuilder.java @@ -0,0 +1,143 @@ +/* + * Copyright 2023 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/control/v2/storage_control.proto + +package com.google.storage.control.v2; + +public interface DeleteFolderRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.control.v2.DeleteFolderRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the folder.
+   * Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
+   * 
+ * + * + * string name = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the folder.
+   * Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
+   * 
+ * + * + * string name = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Makes the operation only succeed conditional on whether the folder's
+   * current metageneration matches the given value.
+   * 
+ * + * optional int64 if_metageneration_match = 3; + * + * @return Whether the ifMetagenerationMatch field is set. + */ + boolean hasIfMetagenerationMatch(); + /** + * + * + *
+   * Makes the operation only succeed conditional on whether the folder's
+   * current metageneration matches the given value.
+   * 
+ * + * optional int64 if_metageneration_match = 3; + * + * @return The ifMetagenerationMatch. + */ + long getIfMetagenerationMatch(); + + /** + * + * + *
+   * Makes the operation only succeed conditional on whether the folder's
+   * current metageneration does not match the given value.
+   * 
+ * + * optional int64 if_metageneration_not_match = 4; + * + * @return Whether the ifMetagenerationNotMatch field is set. + */ + boolean hasIfMetagenerationNotMatch(); + /** + * + * + *
+   * Makes the operation only succeed conditional on whether the folder's
+   * current metageneration does not match the given value.
+   * 
+ * + * optional int64 if_metageneration_not_match = 4; + * + * @return The ifMetagenerationNotMatch. + */ + long getIfMetagenerationNotMatch(); + + /** + * + * + *
+   * Optional. A unique identifier for this request. UUID is the recommended
+   * format, but other formats are still accepted. This request is only
+   * idempotent if a `request_id` is provided.
+   * 
+ * + * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. A unique identifier for this request. UUID is the recommended
+   * format, but other formats are still accepted. This request is only
+   * idempotent if a `request_id` is provided.
+   * 
+ * + * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/Folder.java b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/Folder.java new file mode 100644 index 0000000000..2ceb9fe039 --- /dev/null +++ b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/Folder.java @@ -0,0 +1,1629 @@ +/* + * Copyright 2023 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/control/v2/storage_control.proto + +package com.google.storage.control.v2; + +/** + * + * + *
+ * A folder.
+ * 
+ * + * Protobuf type {@code google.storage.control.v2.Folder} + */ +public final class Folder extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.control.v2.Folder) + FolderOrBuilder { + private static final long serialVersionUID = 0L; + // Use Folder.newBuilder() to construct. + private Folder(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Folder() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Folder(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_Folder_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_Folder_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.control.v2.Folder.class, + com.google.storage.control.v2.Folder.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Identifier. The name of this folder.
+   * Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+   * Identifier. The name of this folder.
+   * Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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 METAGENERATION_FIELD_NUMBER = 3; + private long metageneration_ = 0L; + /** + * + * + *
+   * Output only. The version of the metadata for this folder. Used for
+   * preconditions and for detecting changes in metadata.
+   * 
+ * + * int64 metageneration = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The metageneration. + */ + @java.lang.Override + public long getMetageneration() { + return metageneration_; + } + + public static final int CREATE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The creation time of the folder.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.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 folder.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.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 folder.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The modification time of the folder.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.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 folder.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.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 folder.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int PENDING_RENAME_INFO_FIELD_NUMBER = 7; + private com.google.storage.control.v2.PendingRenameInfo pendingRenameInfo_; + /** + * + * + *
+   * Output only. Only present if the folder is part of an ongoing RenameFolder
+   * operation. Contains information which can be used to query the operation
+   * status. The presence of this field also indicates all write operations are
+   * blocked for this folder, including folder, managed folder, and object
+   * operations.
+   * 
+ * + * + * .google.storage.control.v2.PendingRenameInfo pending_rename_info = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the pendingRenameInfo field is set. + */ + @java.lang.Override + public boolean hasPendingRenameInfo() { + return pendingRenameInfo_ != null; + } + /** + * + * + *
+   * Output only. Only present if the folder is part of an ongoing RenameFolder
+   * operation. Contains information which can be used to query the operation
+   * status. The presence of this field also indicates all write operations are
+   * blocked for this folder, including folder, managed folder, and object
+   * operations.
+   * 
+ * + * + * .google.storage.control.v2.PendingRenameInfo pending_rename_info = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The pendingRenameInfo. + */ + @java.lang.Override + public com.google.storage.control.v2.PendingRenameInfo getPendingRenameInfo() { + return pendingRenameInfo_ == null + ? com.google.storage.control.v2.PendingRenameInfo.getDefaultInstance() + : pendingRenameInfo_; + } + /** + * + * + *
+   * Output only. Only present if the folder is part of an ongoing RenameFolder
+   * operation. Contains information which can be used to query the operation
+   * status. The presence of this field also indicates all write operations are
+   * blocked for this folder, including folder, managed folder, and object
+   * operations.
+   * 
+ * + * + * .google.storage.control.v2.PendingRenameInfo pending_rename_info = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.storage.control.v2.PendingRenameInfoOrBuilder getPendingRenameInfoOrBuilder() { + return pendingRenameInfo_ == null + ? com.google.storage.control.v2.PendingRenameInfo.getDefaultInstance() + : pendingRenameInfo_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (metageneration_ != 0L) { + output.writeInt64(3, metageneration_); + } + if (createTime_ != null) { + output.writeMessage(4, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(5, getUpdateTime()); + } + if (pendingRenameInfo_ != null) { + output.writeMessage(7, getPendingRenameInfo()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (metageneration_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, metageneration_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getUpdateTime()); + } + if (pendingRenameInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getPendingRenameInfo()); + } + size += getUnknownFields().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.control.v2.Folder)) { + return super.equals(obj); + } + com.google.storage.control.v2.Folder other = (com.google.storage.control.v2.Folder) obj; + + if (!getName().equals(other.getName())) return false; + if (getMetageneration() != other.getMetageneration()) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (hasPendingRenameInfo() != other.hasPendingRenameInfo()) return false; + if (hasPendingRenameInfo()) { + if (!getPendingRenameInfo().equals(other.getPendingRenameInfo())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + METAGENERATION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getMetageneration()); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (hasPendingRenameInfo()) { + hash = (37 * hash) + PENDING_RENAME_INFO_FIELD_NUMBER; + hash = (53 * hash) + getPendingRenameInfo().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.control.v2.Folder parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.control.v2.Folder 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.control.v2.Folder parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.control.v2.Folder 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.control.v2.Folder parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.control.v2.Folder parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.control.v2.Folder parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.control.v2.Folder 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.control.v2.Folder parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.control.v2.Folder 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.control.v2.Folder parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.control.v2.Folder 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.control.v2.Folder 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 folder.
+   * 
+ * + * Protobuf type {@code google.storage.control.v2.Folder} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.control.v2.Folder) + com.google.storage.control.v2.FolderOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_Folder_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_Folder_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.control.v2.Folder.class, + com.google.storage.control.v2.Folder.Builder.class); + } + + // Construct using com.google.storage.control.v2.Folder.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + metageneration_ = 0L; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + pendingRenameInfo_ = null; + if (pendingRenameInfoBuilder_ != null) { + pendingRenameInfoBuilder_.dispose(); + pendingRenameInfoBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_Folder_descriptor; + } + + @java.lang.Override + public com.google.storage.control.v2.Folder getDefaultInstanceForType() { + return com.google.storage.control.v2.Folder.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.control.v2.Folder build() { + com.google.storage.control.v2.Folder result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.control.v2.Folder buildPartial() { + com.google.storage.control.v2.Folder result = new com.google.storage.control.v2.Folder(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.storage.control.v2.Folder result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.metageneration_ = metageneration_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.pendingRenameInfo_ = + pendingRenameInfoBuilder_ == null + ? pendingRenameInfo_ + : pendingRenameInfoBuilder_.build(); + } + } + + @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.control.v2.Folder) { + return mergeFrom((com.google.storage.control.v2.Folder) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.control.v2.Folder other) { + if (other == com.google.storage.control.v2.Folder.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getMetageneration() != 0L) { + setMetageneration(other.getMetageneration()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.hasPendingRenameInfo()) { + mergePendingRenameInfo(other.getPendingRenameInfo()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 24: + { + metageneration_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 24 + case 34: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 34 + case 42: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 42 + case 58: + { + input.readMessage( + getPendingRenameInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 58 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Identifier. The name of this folder.
+     * Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+     * Identifier. The name of this folder.
+     * Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+     * Identifier. The name of this folder.
+     * Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. The name of this folder.
+     * Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. The name of this folder.
+     * Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private long metageneration_; + /** + * + * + *
+     * Output only. The version of the metadata for this folder. Used for
+     * preconditions and for detecting changes in metadata.
+     * 
+ * + * int64 metageneration = 3 [(.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 folder. Used for
+     * preconditions and for detecting changes in metadata.
+     * 
+ * + * int64 metageneration = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The metageneration to set. + * @return This builder for chaining. + */ + public Builder setMetageneration(long value) { + + metageneration_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The version of the metadata for this folder. Used for
+     * preconditions and for detecting changes in metadata.
+     * 
+ * + * int64 metageneration = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearMetageneration() { + bitField0_ = (bitField0_ & ~0x00000002); + metageneration_ = 0L; + 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 folder.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Output only. The creation time of the folder.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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 folder.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The creation time of the folder.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The creation time of the folder.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The creation time of the folder.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000004); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The creation time of the folder.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The creation time of the folder.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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 folder.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.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 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 folder.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Output only. The modification time of the folder.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.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 folder.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.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; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The modification time of the folder.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The modification time of the folder.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The modification time of the folder.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000008); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The modification time of the folder.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The modification time of the folder.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.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 folder.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private com.google.storage.control.v2.PendingRenameInfo pendingRenameInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.control.v2.PendingRenameInfo, + com.google.storage.control.v2.PendingRenameInfo.Builder, + com.google.storage.control.v2.PendingRenameInfoOrBuilder> + pendingRenameInfoBuilder_; + /** + * + * + *
+     * Output only. Only present if the folder is part of an ongoing RenameFolder
+     * operation. Contains information which can be used to query the operation
+     * status. The presence of this field also indicates all write operations are
+     * blocked for this folder, including folder, managed folder, and object
+     * operations.
+     * 
+ * + * + * .google.storage.control.v2.PendingRenameInfo pending_rename_info = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the pendingRenameInfo field is set. + */ + public boolean hasPendingRenameInfo() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Output only. Only present if the folder is part of an ongoing RenameFolder
+     * operation. Contains information which can be used to query the operation
+     * status. The presence of this field also indicates all write operations are
+     * blocked for this folder, including folder, managed folder, and object
+     * operations.
+     * 
+ * + * + * .google.storage.control.v2.PendingRenameInfo pending_rename_info = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The pendingRenameInfo. + */ + public com.google.storage.control.v2.PendingRenameInfo getPendingRenameInfo() { + if (pendingRenameInfoBuilder_ == null) { + return pendingRenameInfo_ == null + ? com.google.storage.control.v2.PendingRenameInfo.getDefaultInstance() + : pendingRenameInfo_; + } else { + return pendingRenameInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Only present if the folder is part of an ongoing RenameFolder
+     * operation. Contains information which can be used to query the operation
+     * status. The presence of this field also indicates all write operations are
+     * blocked for this folder, including folder, managed folder, and object
+     * operations.
+     * 
+ * + * + * .google.storage.control.v2.PendingRenameInfo pending_rename_info = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setPendingRenameInfo(com.google.storage.control.v2.PendingRenameInfo value) { + if (pendingRenameInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + pendingRenameInfo_ = value; + } else { + pendingRenameInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Only present if the folder is part of an ongoing RenameFolder
+     * operation. Contains information which can be used to query the operation
+     * status. The presence of this field also indicates all write operations are
+     * blocked for this folder, including folder, managed folder, and object
+     * operations.
+     * 
+ * + * + * .google.storage.control.v2.PendingRenameInfo pending_rename_info = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setPendingRenameInfo( + com.google.storage.control.v2.PendingRenameInfo.Builder builderForValue) { + if (pendingRenameInfoBuilder_ == null) { + pendingRenameInfo_ = builderForValue.build(); + } else { + pendingRenameInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Only present if the folder is part of an ongoing RenameFolder
+     * operation. Contains information which can be used to query the operation
+     * status. The presence of this field also indicates all write operations are
+     * blocked for this folder, including folder, managed folder, and object
+     * operations.
+     * 
+ * + * + * .google.storage.control.v2.PendingRenameInfo pending_rename_info = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergePendingRenameInfo(com.google.storage.control.v2.PendingRenameInfo value) { + if (pendingRenameInfoBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && pendingRenameInfo_ != null + && pendingRenameInfo_ + != com.google.storage.control.v2.PendingRenameInfo.getDefaultInstance()) { + getPendingRenameInfoBuilder().mergeFrom(value); + } else { + pendingRenameInfo_ = value; + } + } else { + pendingRenameInfoBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Only present if the folder is part of an ongoing RenameFolder
+     * operation. Contains information which can be used to query the operation
+     * status. The presence of this field also indicates all write operations are
+     * blocked for this folder, including folder, managed folder, and object
+     * operations.
+     * 
+ * + * + * .google.storage.control.v2.PendingRenameInfo pending_rename_info = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearPendingRenameInfo() { + bitField0_ = (bitField0_ & ~0x00000010); + pendingRenameInfo_ = null; + if (pendingRenameInfoBuilder_ != null) { + pendingRenameInfoBuilder_.dispose(); + pendingRenameInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Only present if the folder is part of an ongoing RenameFolder
+     * operation. Contains information which can be used to query the operation
+     * status. The presence of this field also indicates all write operations are
+     * blocked for this folder, including folder, managed folder, and object
+     * operations.
+     * 
+ * + * + * .google.storage.control.v2.PendingRenameInfo pending_rename_info = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.storage.control.v2.PendingRenameInfo.Builder getPendingRenameInfoBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getPendingRenameInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Only present if the folder is part of an ongoing RenameFolder
+     * operation. Contains information which can be used to query the operation
+     * status. The presence of this field also indicates all write operations are
+     * blocked for this folder, including folder, managed folder, and object
+     * operations.
+     * 
+ * + * + * .google.storage.control.v2.PendingRenameInfo pending_rename_info = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.storage.control.v2.PendingRenameInfoOrBuilder + getPendingRenameInfoOrBuilder() { + if (pendingRenameInfoBuilder_ != null) { + return pendingRenameInfoBuilder_.getMessageOrBuilder(); + } else { + return pendingRenameInfo_ == null + ? com.google.storage.control.v2.PendingRenameInfo.getDefaultInstance() + : pendingRenameInfo_; + } + } + /** + * + * + *
+     * Output only. Only present if the folder is part of an ongoing RenameFolder
+     * operation. Contains information which can be used to query the operation
+     * status. The presence of this field also indicates all write operations are
+     * blocked for this folder, including folder, managed folder, and object
+     * operations.
+     * 
+ * + * + * .google.storage.control.v2.PendingRenameInfo pending_rename_info = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.control.v2.PendingRenameInfo, + com.google.storage.control.v2.PendingRenameInfo.Builder, + com.google.storage.control.v2.PendingRenameInfoOrBuilder> + getPendingRenameInfoFieldBuilder() { + if (pendingRenameInfoBuilder_ == null) { + pendingRenameInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.control.v2.PendingRenameInfo, + com.google.storage.control.v2.PendingRenameInfo.Builder, + com.google.storage.control.v2.PendingRenameInfoOrBuilder>( + getPendingRenameInfo(), getParentForChildren(), isClean()); + pendingRenameInfo_ = null; + } + return pendingRenameInfoBuilder_; + } + + @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.control.v2.Folder) + } + + // @@protoc_insertion_point(class_scope:google.storage.control.v2.Folder) + private static final com.google.storage.control.v2.Folder DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.control.v2.Folder(); + } + + public static com.google.storage.control.v2.Folder getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Folder parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.control.v2.Folder getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/FolderName.java b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/FolderName.java new file mode 100644 index 0000000000..a52b0a6396 --- /dev/null +++ b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/FolderName.java @@ -0,0 +1,218 @@ +/* + * Copyright 2023 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.control.v2; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class FolderName implements ResourceName { + private static final PathTemplate PROJECT_BUCKET_FOLDER = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/buckets/{bucket}/folders/{folder=**}"); + private volatile Map fieldValuesMap; + private final String project; + private final String bucket; + private final String folder; + + @Deprecated + protected FolderName() { + project = null; + bucket = null; + folder = null; + } + + private FolderName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + bucket = Preconditions.checkNotNull(builder.getBucket()); + folder = Preconditions.checkNotNull(builder.getFolder()); + } + + public String getProject() { + return project; + } + + public String getBucket() { + return bucket; + } + + public String getFolder() { + return folder; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static FolderName of(String project, String bucket, String folder) { + return newBuilder().setProject(project).setBucket(bucket).setFolder(folder).build(); + } + + public static String format(String project, String bucket, String folder) { + return newBuilder().setProject(project).setBucket(bucket).setFolder(folder).build().toString(); + } + + public static FolderName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_BUCKET_FOLDER.validatedMatch( + formattedString, "FolderName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("bucket"), matchMap.get("folder")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (FolderName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_BUCKET_FOLDER.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (bucket != null) { + fieldMapBuilder.put("bucket", bucket); + } + if (folder != null) { + fieldMapBuilder.put("folder", folder); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_BUCKET_FOLDER.instantiate( + "project", project, "bucket", bucket, "folder", folder); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + FolderName that = ((FolderName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.bucket, that.bucket) + && Objects.equals(this.folder, that.folder); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(bucket); + h *= 1000003; + h ^= Objects.hashCode(folder); + return h; + } + + /** Builder for projects/{project}/buckets/{bucket}/folders/{folder=**}. */ + public static class Builder { + private String project; + private String bucket; + private String folder; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getBucket() { + return bucket; + } + + public String getFolder() { + return folder; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setBucket(String bucket) { + this.bucket = bucket; + return this; + } + + public Builder setFolder(String folder) { + this.folder = folder; + return this; + } + + private Builder(FolderName folderName) { + this.project = folderName.project; + this.bucket = folderName.bucket; + this.folder = folderName.folder; + } + + public FolderName build() { + return new FolderName(this); + } + } +} diff --git a/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/FolderOrBuilder.java b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/FolderOrBuilder.java new file mode 100644 index 0000000000..cb0fe63ef1 --- /dev/null +++ b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/FolderOrBuilder.java @@ -0,0 +1,195 @@ +/* + * Copyright 2023 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/control/v2/storage_control.proto + +package com.google.storage.control.v2; + +public interface FolderOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.control.v2.Folder) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifier. The name of this folder.
+   * Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Identifier. The name of this folder.
+   * Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. The version of the metadata for this folder. Used for
+   * preconditions and for detecting changes in metadata.
+   * 
+ * + * int64 metageneration = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The metageneration. + */ + long getMetageneration(); + + /** + * + * + *
+   * Output only. The creation time of the folder.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The creation time of the folder.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The creation time of the folder.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The modification time of the folder.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The modification time of the folder.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The modification time of the folder.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Only present if the folder is part of an ongoing RenameFolder
+   * operation. Contains information which can be used to query the operation
+   * status. The presence of this field also indicates all write operations are
+   * blocked for this folder, including folder, managed folder, and object
+   * operations.
+   * 
+ * + * + * .google.storage.control.v2.PendingRenameInfo pending_rename_info = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the pendingRenameInfo field is set. + */ + boolean hasPendingRenameInfo(); + /** + * + * + *
+   * Output only. Only present if the folder is part of an ongoing RenameFolder
+   * operation. Contains information which can be used to query the operation
+   * status. The presence of this field also indicates all write operations are
+   * blocked for this folder, including folder, managed folder, and object
+   * operations.
+   * 
+ * + * + * .google.storage.control.v2.PendingRenameInfo pending_rename_info = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The pendingRenameInfo. + */ + com.google.storage.control.v2.PendingRenameInfo getPendingRenameInfo(); + /** + * + * + *
+   * Output only. Only present if the folder is part of an ongoing RenameFolder
+   * operation. Contains information which can be used to query the operation
+   * status. The presence of this field also indicates all write operations are
+   * blocked for this folder, including folder, managed folder, and object
+   * operations.
+   * 
+ * + * + * .google.storage.control.v2.PendingRenameInfo pending_rename_info = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.storage.control.v2.PendingRenameInfoOrBuilder getPendingRenameInfoOrBuilder(); +} diff --git a/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/GetFolderRequest.java b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/GetFolderRequest.java new file mode 100644 index 0000000000..1e91ccfa41 --- /dev/null +++ b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/GetFolderRequest.java @@ -0,0 +1,1120 @@ +/* + * Copyright 2023 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/control/v2/storage_control.proto + +package com.google.storage.control.v2; + +/** + * + * + *
+ * Request message for GetFolder.
+ * 
+ * + * Protobuf type {@code google.storage.control.v2.GetFolderRequest} + */ +public final class GetFolderRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.control.v2.GetFolderRequest) + GetFolderRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetFolderRequest.newBuilder() to construct. + private GetFolderRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetFolderRequest() { + name_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetFolderRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_GetFolderRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_GetFolderRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.control.v2.GetFolderRequest.class, + com.google.storage.control.v2.GetFolderRequest.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Name of the folder.
+   * Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
+   * 
+ * + * + * string name = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the folder.
+   * Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
+   * 
+ * + * + * string name = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IF_METAGENERATION_MATCH_FIELD_NUMBER = 3; + private long ifMetagenerationMatch_ = 0L; + /** + * + * + *
+   * Makes the operation only succeed conditional on whether the folder's
+   * current metageneration matches the given value.
+   * 
+ * + * optional int64 if_metageneration_match = 3; + * + * @return Whether the ifMetagenerationMatch field is set. + */ + @java.lang.Override + public boolean hasIfMetagenerationMatch() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Makes the operation only succeed conditional on whether the folder's
+   * current metageneration matches the given value.
+   * 
+ * + * optional int64 if_metageneration_match = 3; + * + * @return The ifMetagenerationMatch. + */ + @java.lang.Override + public long getIfMetagenerationMatch() { + return ifMetagenerationMatch_; + } + + public static final int IF_METAGENERATION_NOT_MATCH_FIELD_NUMBER = 4; + private long ifMetagenerationNotMatch_ = 0L; + /** + * + * + *
+   * Makes the operation only succeed conditional on whether the folder's
+   * current metageneration does not match the given value.
+   * 
+ * + * optional int64 if_metageneration_not_match = 4; + * + * @return Whether the ifMetagenerationNotMatch field is set. + */ + @java.lang.Override + public boolean hasIfMetagenerationNotMatch() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Makes the operation only succeed conditional on whether the folder's
+   * current metageneration does not match the given value.
+   * 
+ * + * optional int64 if_metageneration_not_match = 4; + * + * @return The ifMetagenerationNotMatch. + */ + @java.lang.Override + public long getIfMetagenerationNotMatch() { + return ifMetagenerationNotMatch_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. A unique identifier for this request. UUID is the recommended
+   * format, but other formats are still accepted.
+   * 
+ * + * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + 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(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. A unique identifier for this request. UUID is the recommended
+   * format, but other formats are still accepted.
+   * 
+ * + * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeInt64(3, ifMetagenerationMatch_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeInt64(4, ifMetagenerationNotMatch_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, requestId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, name_); + } + getUnknownFields().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.computeInt64Size(3, ifMetagenerationMatch_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, ifMetagenerationNotMatch_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, requestId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, name_); + } + size += getUnknownFields().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.control.v2.GetFolderRequest)) { + return super.equals(obj); + } + com.google.storage.control.v2.GetFolderRequest other = + (com.google.storage.control.v2.GetFolderRequest) obj; + + if (!getName().equals(other.getName())) 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 (!getRequestId().equals(other.getRequestId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + 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 = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.control.v2.GetFolderRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.control.v2.GetFolderRequest 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.control.v2.GetFolderRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.control.v2.GetFolderRequest 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.control.v2.GetFolderRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.control.v2.GetFolderRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.control.v2.GetFolderRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.control.v2.GetFolderRequest 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.control.v2.GetFolderRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.control.v2.GetFolderRequest 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.control.v2.GetFolderRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.control.v2.GetFolderRequest 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.control.v2.GetFolderRequest 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 GetFolder.
+   * 
+ * + * Protobuf type {@code google.storage.control.v2.GetFolderRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.control.v2.GetFolderRequest) + com.google.storage.control.v2.GetFolderRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_GetFolderRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_GetFolderRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.control.v2.GetFolderRequest.class, + com.google.storage.control.v2.GetFolderRequest.Builder.class); + } + + // Construct using com.google.storage.control.v2.GetFolderRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + ifMetagenerationMatch_ = 0L; + ifMetagenerationNotMatch_ = 0L; + requestId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_GetFolderRequest_descriptor; + } + + @java.lang.Override + public com.google.storage.control.v2.GetFolderRequest getDefaultInstanceForType() { + return com.google.storage.control.v2.GetFolderRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.control.v2.GetFolderRequest build() { + com.google.storage.control.v2.GetFolderRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.control.v2.GetFolderRequest buildPartial() { + com.google.storage.control.v2.GetFolderRequest result = + new com.google.storage.control.v2.GetFolderRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.storage.control.v2.GetFolderRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.ifMetagenerationMatch_ = ifMetagenerationMatch_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.ifMetagenerationNotMatch_ = ifMetagenerationNotMatch_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.requestId_ = requestId_; + } + result.bitField0_ |= to_bitField0_; + } + + @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.control.v2.GetFolderRequest) { + return mergeFrom((com.google.storage.control.v2.GetFolderRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.control.v2.GetFolderRequest other) { + if (other == com.google.storage.control.v2.GetFolderRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasIfMetagenerationMatch()) { + setIfMetagenerationMatch(other.getIfMetagenerationMatch()); + } + if (other.hasIfMetagenerationNotMatch()) { + setIfMetagenerationNotMatch(other.getIfMetagenerationNotMatch()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000008; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 24: + { + ifMetagenerationMatch_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 24 + case 32: + { + ifMetagenerationNotMatch_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 32 + case 42: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 42 + case 50: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the folder.
+     * Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
+     * 
+ * + * + * string name = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the folder.
+     * Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
+     * 
+ * + * + * string name = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the folder.
+     * Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
+     * 
+ * + * + * string name = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the folder.
+     * Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
+     * 
+ * + * + * string name = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the folder.
+     * Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
+     * 
+ * + * + * string name = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private long ifMetagenerationMatch_; + /** + * + * + *
+     * Makes the operation only succeed conditional on whether the folder's
+     * current metageneration matches the given value.
+     * 
+ * + * optional int64 if_metageneration_match = 3; + * + * @return Whether the ifMetagenerationMatch field is set. + */ + @java.lang.Override + public boolean hasIfMetagenerationMatch() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Makes the operation only succeed conditional on whether the folder's
+     * current metageneration matches the given value.
+     * 
+ * + * optional int64 if_metageneration_match = 3; + * + * @return The ifMetagenerationMatch. + */ + @java.lang.Override + public long getIfMetagenerationMatch() { + return ifMetagenerationMatch_; + } + /** + * + * + *
+     * Makes the operation only succeed conditional on whether the folder's
+     * current metageneration matches the given value.
+     * 
+ * + * optional int64 if_metageneration_match = 3; + * + * @param value The ifMetagenerationMatch to set. + * @return This builder for chaining. + */ + public Builder setIfMetagenerationMatch(long value) { + + ifMetagenerationMatch_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Makes the operation only succeed conditional on whether the folder's
+     * current metageneration matches the given value.
+     * 
+ * + * optional int64 if_metageneration_match = 3; + * + * @return This builder for chaining. + */ + public Builder clearIfMetagenerationMatch() { + bitField0_ = (bitField0_ & ~0x00000002); + ifMetagenerationMatch_ = 0L; + onChanged(); + return this; + } + + private long ifMetagenerationNotMatch_; + /** + * + * + *
+     * Makes the operation only succeed conditional on whether the folder's
+     * current metageneration does not match the given value.
+     * 
+ * + * optional int64 if_metageneration_not_match = 4; + * + * @return Whether the ifMetagenerationNotMatch field is set. + */ + @java.lang.Override + public boolean hasIfMetagenerationNotMatch() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Makes the operation only succeed conditional on whether the folder's
+     * current metageneration does not match the given value.
+     * 
+ * + * optional int64 if_metageneration_not_match = 4; + * + * @return The ifMetagenerationNotMatch. + */ + @java.lang.Override + public long getIfMetagenerationNotMatch() { + return ifMetagenerationNotMatch_; + } + /** + * + * + *
+     * Makes the operation only succeed conditional on whether the folder's
+     * current metageneration does not match the given value.
+     * 
+ * + * optional int64 if_metageneration_not_match = 4; + * + * @param value The ifMetagenerationNotMatch to set. + * @return This builder for chaining. + */ + public Builder setIfMetagenerationNotMatch(long value) { + + ifMetagenerationNotMatch_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Makes the operation only succeed conditional on whether the folder's
+     * current metageneration does not match the given value.
+     * 
+ * + * optional int64 if_metageneration_not_match = 4; + * + * @return This builder for chaining. + */ + public Builder clearIfMetagenerationNotMatch() { + bitField0_ = (bitField0_ & ~0x00000004); + ifMetagenerationNotMatch_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. A unique identifier for this request. UUID is the recommended
+     * format, but other formats are still accepted.
+     * 
+ * + * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. A unique identifier for this request. UUID is the recommended
+     * format, but other formats are still accepted.
+     * 
+ * + * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. A unique identifier for this request. UUID is the recommended
+     * format, but other formats are still accepted.
+     * 
+ * + * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + requestId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A unique identifier for this request. UUID is the recommended
+     * format, but other formats are still accepted.
+     * 
+ * + * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A unique identifier for this request. UUID is the recommended
+     * format, but other formats are still accepted.
+     * 
+ * + * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + requestId_ = value; + bitField0_ |= 0x00000008; + 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.control.v2.GetFolderRequest) + } + + // @@protoc_insertion_point(class_scope:google.storage.control.v2.GetFolderRequest) + private static final com.google.storage.control.v2.GetFolderRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.control.v2.GetFolderRequest(); + } + + public static com.google.storage.control.v2.GetFolderRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetFolderRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.control.v2.GetFolderRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/GetFolderRequestOrBuilder.java b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/GetFolderRequestOrBuilder.java new file mode 100644 index 0000000000..9d0e1d93b6 --- /dev/null +++ b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/GetFolderRequestOrBuilder.java @@ -0,0 +1,141 @@ +/* + * Copyright 2023 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/control/v2/storage_control.proto + +package com.google.storage.control.v2; + +public interface GetFolderRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.control.v2.GetFolderRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the folder.
+   * Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
+   * 
+ * + * + * string name = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the folder.
+   * Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
+   * 
+ * + * + * string name = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Makes the operation only succeed conditional on whether the folder's
+   * current metageneration matches the given value.
+   * 
+ * + * optional int64 if_metageneration_match = 3; + * + * @return Whether the ifMetagenerationMatch field is set. + */ + boolean hasIfMetagenerationMatch(); + /** + * + * + *
+   * Makes the operation only succeed conditional on whether the folder's
+   * current metageneration matches the given value.
+   * 
+ * + * optional int64 if_metageneration_match = 3; + * + * @return The ifMetagenerationMatch. + */ + long getIfMetagenerationMatch(); + + /** + * + * + *
+   * Makes the operation only succeed conditional on whether the folder's
+   * current metageneration does not match the given value.
+   * 
+ * + * optional int64 if_metageneration_not_match = 4; + * + * @return Whether the ifMetagenerationNotMatch field is set. + */ + boolean hasIfMetagenerationNotMatch(); + /** + * + * + *
+   * Makes the operation only succeed conditional on whether the folder's
+   * current metageneration does not match the given value.
+   * 
+ * + * optional int64 if_metageneration_not_match = 4; + * + * @return The ifMetagenerationNotMatch. + */ + long getIfMetagenerationNotMatch(); + + /** + * + * + *
+   * Optional. A unique identifier for this request. UUID is the recommended
+   * format, but other formats are still accepted.
+   * 
+ * + * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. A unique identifier for this request. UUID is the recommended
+   * format, but other formats are still accepted.
+   * 
+ * + * + * string request_id = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/GetStorageLayoutRequest.java b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/GetStorageLayoutRequest.java new file mode 100644 index 0000000000..6251a52423 --- /dev/null +++ b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/GetStorageLayoutRequest.java @@ -0,0 +1,1038 @@ +/* + * Copyright 2023 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/control/v2/storage_control.proto + +package com.google.storage.control.v2; + +/** + * + * + *
+ * Request message for GetStorageLayout.
+ * 
+ * + * Protobuf type {@code google.storage.control.v2.GetStorageLayoutRequest} + */ +public final class GetStorageLayoutRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.control.v2.GetStorageLayoutRequest) + GetStorageLayoutRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetStorageLayoutRequest.newBuilder() to construct. + private GetStorageLayoutRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetStorageLayoutRequest() { + name_ = ""; + prefix_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetStorageLayoutRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_GetStorageLayoutRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_GetStorageLayoutRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.control.v2.GetStorageLayoutRequest.class, + com.google.storage.control.v2.GetStorageLayoutRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the StorageLayout resource.
+   * Format: `projects/{project}/buckets/{bucket}/storageLayout`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the StorageLayout resource.
+   * Format: `projects/{project}/buckets/{bucket}/storageLayout`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PREFIX_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object prefix_ = ""; + /** + * + * + *
+   * An optional prefix used for permission check. It is useful when the caller
+   * only has limited permissions under a specific prefix.
+   * 
+ * + * string prefix = 2; + * + * @return The prefix. + */ + @java.lang.Override + public java.lang.String getPrefix() { + java.lang.Object ref = prefix_; + 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(); + prefix_ = s; + return s; + } + } + /** + * + * + *
+   * An optional prefix used for permission check. It is useful when the caller
+   * only has limited permissions under a specific prefix.
+   * 
+ * + * string prefix = 2; + * + * @return The bytes for prefix. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPrefixBytes() { + java.lang.Object ref = prefix_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + prefix_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUEST_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. A unique identifier for this request. UUID is the recommended
+   * format, but other formats are still accepted.
+   * 
+ * + * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + 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(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. A unique identifier for this request. UUID is the recommended
+   * format, but other formats are still accepted.
+   * 
+ * + * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(prefix_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, prefix_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, requestId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(prefix_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, prefix_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, requestId_); + } + size += getUnknownFields().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.control.v2.GetStorageLayoutRequest)) { + return super.equals(obj); + } + com.google.storage.control.v2.GetStorageLayoutRequest other = + (com.google.storage.control.v2.GetStorageLayoutRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getPrefix().equals(other.getPrefix())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + PREFIX_FIELD_NUMBER; + hash = (53 * hash) + getPrefix().hashCode(); + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.control.v2.GetStorageLayoutRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.control.v2.GetStorageLayoutRequest 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.control.v2.GetStorageLayoutRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.control.v2.GetStorageLayoutRequest 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.control.v2.GetStorageLayoutRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.control.v2.GetStorageLayoutRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.control.v2.GetStorageLayoutRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.control.v2.GetStorageLayoutRequest 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.control.v2.GetStorageLayoutRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.control.v2.GetStorageLayoutRequest 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.control.v2.GetStorageLayoutRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.control.v2.GetStorageLayoutRequest 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.control.v2.GetStorageLayoutRequest 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 GetStorageLayout.
+   * 
+ * + * Protobuf type {@code google.storage.control.v2.GetStorageLayoutRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.control.v2.GetStorageLayoutRequest) + com.google.storage.control.v2.GetStorageLayoutRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_GetStorageLayoutRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_GetStorageLayoutRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.control.v2.GetStorageLayoutRequest.class, + com.google.storage.control.v2.GetStorageLayoutRequest.Builder.class); + } + + // Construct using com.google.storage.control.v2.GetStorageLayoutRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + prefix_ = ""; + requestId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_GetStorageLayoutRequest_descriptor; + } + + @java.lang.Override + public com.google.storage.control.v2.GetStorageLayoutRequest getDefaultInstanceForType() { + return com.google.storage.control.v2.GetStorageLayoutRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.control.v2.GetStorageLayoutRequest build() { + com.google.storage.control.v2.GetStorageLayoutRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.control.v2.GetStorageLayoutRequest buildPartial() { + com.google.storage.control.v2.GetStorageLayoutRequest result = + new com.google.storage.control.v2.GetStorageLayoutRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.storage.control.v2.GetStorageLayoutRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.prefix_ = prefix_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.requestId_ = requestId_; + } + } + + @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.control.v2.GetStorageLayoutRequest) { + return mergeFrom((com.google.storage.control.v2.GetStorageLayoutRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.control.v2.GetStorageLayoutRequest other) { + if (other == com.google.storage.control.v2.GetStorageLayoutRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getPrefix().isEmpty()) { + prefix_ = other.prefix_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + prefix_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the StorageLayout resource.
+     * Format: `projects/{project}/buckets/{bucket}/storageLayout`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the StorageLayout resource.
+     * Format: `projects/{project}/buckets/{bucket}/storageLayout`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the StorageLayout resource.
+     * Format: `projects/{project}/buckets/{bucket}/storageLayout`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the StorageLayout resource.
+     * Format: `projects/{project}/buckets/{bucket}/storageLayout`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the StorageLayout resource.
+     * Format: `projects/{project}/buckets/{bucket}/storageLayout`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object prefix_ = ""; + /** + * + * + *
+     * An optional prefix used for permission check. It is useful when the caller
+     * only has limited permissions under a specific prefix.
+     * 
+ * + * string prefix = 2; + * + * @return The prefix. + */ + public java.lang.String getPrefix() { + java.lang.Object ref = prefix_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + prefix_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * An optional prefix used for permission check. It is useful when the caller
+     * only has limited permissions under a specific prefix.
+     * 
+ * + * string prefix = 2; + * + * @return The bytes for prefix. + */ + public com.google.protobuf.ByteString getPrefixBytes() { + java.lang.Object ref = prefix_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + prefix_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * An optional prefix used for permission check. It is useful when the caller
+     * only has limited permissions under a specific prefix.
+     * 
+ * + * string prefix = 2; + * + * @param value The prefix to set. + * @return This builder for chaining. + */ + public Builder setPrefix(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + prefix_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * An optional prefix used for permission check. It is useful when the caller
+     * only has limited permissions under a specific prefix.
+     * 
+ * + * string prefix = 2; + * + * @return This builder for chaining. + */ + public Builder clearPrefix() { + prefix_ = getDefaultInstance().getPrefix(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * An optional prefix used for permission check. It is useful when the caller
+     * only has limited permissions under a specific prefix.
+     * 
+ * + * string prefix = 2; + * + * @param value The bytes for prefix to set. + * @return This builder for chaining. + */ + public Builder setPrefixBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + prefix_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. A unique identifier for this request. UUID is the recommended
+     * format, but other formats are still accepted.
+     * 
+ * + * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. A unique identifier for this request. UUID is the recommended
+     * format, but other formats are still accepted.
+     * 
+ * + * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. A unique identifier for this request. UUID is the recommended
+     * format, but other formats are still accepted.
+     * 
+ * + * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + requestId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A unique identifier for this request. UUID is the recommended
+     * format, but other formats are still accepted.
+     * 
+ * + * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A unique identifier for this request. UUID is the recommended
+     * format, but other formats are still accepted.
+     * 
+ * + * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + requestId_ = value; + bitField0_ |= 0x00000004; + 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.control.v2.GetStorageLayoutRequest) + } + + // @@protoc_insertion_point(class_scope:google.storage.control.v2.GetStorageLayoutRequest) + private static final com.google.storage.control.v2.GetStorageLayoutRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.control.v2.GetStorageLayoutRequest(); + } + + public static com.google.storage.control.v2.GetStorageLayoutRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetStorageLayoutRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.control.v2.GetStorageLayoutRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/GetStorageLayoutRequestOrBuilder.java b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/GetStorageLayoutRequestOrBuilder.java new file mode 100644 index 0000000000..155b9addbb --- /dev/null +++ b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/GetStorageLayoutRequestOrBuilder.java @@ -0,0 +1,114 @@ +/* + * Copyright 2023 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/control/v2/storage_control.proto + +package com.google.storage.control.v2; + +public interface GetStorageLayoutRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.control.v2.GetStorageLayoutRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the StorageLayout resource.
+   * Format: `projects/{project}/buckets/{bucket}/storageLayout`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the StorageLayout resource.
+   * Format: `projects/{project}/buckets/{bucket}/storageLayout`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * An optional prefix used for permission check. It is useful when the caller
+   * only has limited permissions under a specific prefix.
+   * 
+ * + * string prefix = 2; + * + * @return The prefix. + */ + java.lang.String getPrefix(); + /** + * + * + *
+   * An optional prefix used for permission check. It is useful when the caller
+   * only has limited permissions under a specific prefix.
+   * 
+ * + * string prefix = 2; + * + * @return The bytes for prefix. + */ + com.google.protobuf.ByteString getPrefixBytes(); + + /** + * + * + *
+   * Optional. A unique identifier for this request. UUID is the recommended
+   * format, but other formats are still accepted.
+   * 
+ * + * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. A unique identifier for this request. UUID is the recommended
+   * format, but other formats are still accepted.
+   * 
+ * + * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/ListFoldersRequest.java b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/ListFoldersRequest.java new file mode 100644 index 0000000000..b64aadac66 --- /dev/null +++ b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/ListFoldersRequest.java @@ -0,0 +1,1918 @@ +/* + * Copyright 2023 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/control/v2/storage_control.proto + +package com.google.storage.control.v2; + +/** + * + * + *
+ * Request message for ListFolders.
+ * 
+ * + * Protobuf type {@code google.storage.control.v2.ListFoldersRequest} + */ +public final class ListFoldersRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.control.v2.ListFoldersRequest) + ListFoldersRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListFoldersRequest.newBuilder() to construct. + private ListFoldersRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListFoldersRequest() { + parent_ = ""; + pageToken_ = ""; + prefix_ = ""; + delimiter_ = ""; + lexicographicStart_ = ""; + lexicographicEnd_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListFoldersRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_ListFoldersRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_ListFoldersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.control.v2.ListFoldersRequest.class, + com.google.storage.control.v2.ListFoldersRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. Name of the bucket in which to look for folders.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the bucket in which to look for folders.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + /** + * + * + *
+   * Optional. Maximum number of folders to return in a single response. The
+   * service will use this parameter or 1,000 items, whichever is smaller.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * Optional. A previously-returned page token representing part of the larger
+   * set of results to view.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. A previously-returned page token representing part of the larger
+   * set of results to view.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PREFIX_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object prefix_ = ""; + /** + * + * + *
+   * Optional. Filter results to folders whose names begin with this prefix.
+   * If set, the value must either be an empty string or end with a '/'.
+   * 
+ * + * string prefix = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The prefix. + */ + @java.lang.Override + public java.lang.String getPrefix() { + java.lang.Object ref = prefix_; + 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(); + prefix_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Filter results to folders whose names begin with this prefix.
+   * If set, the value must either be an empty string or end with a '/'.
+   * 
+ * + * string prefix = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for prefix. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPrefixBytes() { + java.lang.Object ref = prefix_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + prefix_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DELIMITER_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object delimiter_ = ""; + /** + * + * + *
+   * Optional. If set, returns results in a directory-like mode. The results
+   * will only include folders that either exactly match the above prefix, or
+   * are one level below the prefix. The only supported value is '/'.
+   * 
+ * + * string delimiter = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The delimiter. + */ + @java.lang.Override + public java.lang.String getDelimiter() { + java.lang.Object ref = delimiter_; + 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(); + delimiter_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. If set, returns results in a directory-like mode. The results
+   * will only include folders that either exactly match the above prefix, or
+   * are one level below the prefix. The only supported value is '/'.
+   * 
+ * + * string delimiter = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for delimiter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDelimiterBytes() { + java.lang.Object ref = delimiter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + delimiter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LEXICOGRAPHIC_START_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object lexicographicStart_ = ""; + /** + * + * + *
+   * Optional. Filter results to folders whose names are lexicographically equal
+   * to or after lexicographic_start. If lexicographic_end is also set, the
+   * folders listed have names between lexicographic_start (inclusive) and
+   * lexicographic_end (exclusive).
+   * 
+ * + * string lexicographic_start = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The lexicographicStart. + */ + @java.lang.Override + public java.lang.String getLexicographicStart() { + java.lang.Object ref = lexicographicStart_; + 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(); + lexicographicStart_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Filter results to folders whose names are lexicographically equal
+   * to or after lexicographic_start. If lexicographic_end is also set, the
+   * folders listed have names between lexicographic_start (inclusive) and
+   * lexicographic_end (exclusive).
+   * 
+ * + * string lexicographic_start = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for lexicographicStart. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLexicographicStartBytes() { + java.lang.Object ref = lexicographicStart_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + lexicographicStart_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LEXICOGRAPHIC_END_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object lexicographicEnd_ = ""; + /** + * + * + *
+   * Optional. Filter results to folders whose names are lexicographically
+   * before lexicographic_end. If lexicographic_start is also set, the folders
+   * listed have names between lexicographic_start (inclusive) and
+   * lexicographic_end (exclusive).
+   * 
+ * + * string lexicographic_end = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The lexicographicEnd. + */ + @java.lang.Override + public java.lang.String getLexicographicEnd() { + java.lang.Object ref = lexicographicEnd_; + 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(); + lexicographicEnd_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Filter results to folders whose names are lexicographically
+   * before lexicographic_end. If lexicographic_start is also set, the folders
+   * listed have names between lexicographic_start (inclusive) and
+   * lexicographic_end (exclusive).
+   * 
+ * + * string lexicographic_end = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for lexicographicEnd. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLexicographicEndBytes() { + java.lang.Object ref = lexicographicEnd_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + lexicographicEnd_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUEST_ID_FIELD_NUMBER = 9; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. A unique identifier for this request. UUID is the recommended
+   * format, but other formats are still accepted.
+   * 
+ * + * + * string request_id = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + 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(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. A unique identifier for this request. UUID is the recommended
+   * format, but other formats are still accepted.
+   * 
+ * + * + * string request_id = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(prefix_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, prefix_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(lexicographicStart_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, lexicographicStart_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(lexicographicEnd_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, lexicographicEnd_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(delimiter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, delimiter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, requestId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(prefix_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, prefix_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(lexicographicStart_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, lexicographicStart_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(lexicographicEnd_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, lexicographicEnd_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(delimiter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, delimiter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, requestId_); + } + size += getUnknownFields().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.control.v2.ListFoldersRequest)) { + return super.equals(obj); + } + com.google.storage.control.v2.ListFoldersRequest other = + (com.google.storage.control.v2.ListFoldersRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getPrefix().equals(other.getPrefix())) return false; + if (!getDelimiter().equals(other.getDelimiter())) return false; + if (!getLexicographicStart().equals(other.getLexicographicStart())) return false; + if (!getLexicographicEnd().equals(other.getLexicographicEnd())) return false; + if (!getRequestId().equals(other.getRequestId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + PREFIX_FIELD_NUMBER; + hash = (53 * hash) + getPrefix().hashCode(); + hash = (37 * hash) + DELIMITER_FIELD_NUMBER; + hash = (53 * hash) + getDelimiter().hashCode(); + hash = (37 * hash) + LEXICOGRAPHIC_START_FIELD_NUMBER; + hash = (53 * hash) + getLexicographicStart().hashCode(); + hash = (37 * hash) + LEXICOGRAPHIC_END_FIELD_NUMBER; + hash = (53 * hash) + getLexicographicEnd().hashCode(); + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.control.v2.ListFoldersRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.control.v2.ListFoldersRequest 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.control.v2.ListFoldersRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.control.v2.ListFoldersRequest 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.control.v2.ListFoldersRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.control.v2.ListFoldersRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.control.v2.ListFoldersRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.control.v2.ListFoldersRequest 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.control.v2.ListFoldersRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.control.v2.ListFoldersRequest 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.control.v2.ListFoldersRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.control.v2.ListFoldersRequest 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.control.v2.ListFoldersRequest 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 ListFolders.
+   * 
+ * + * Protobuf type {@code google.storage.control.v2.ListFoldersRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.control.v2.ListFoldersRequest) + com.google.storage.control.v2.ListFoldersRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_ListFoldersRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_ListFoldersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.control.v2.ListFoldersRequest.class, + com.google.storage.control.v2.ListFoldersRequest.Builder.class); + } + + // Construct using com.google.storage.control.v2.ListFoldersRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + prefix_ = ""; + delimiter_ = ""; + lexicographicStart_ = ""; + lexicographicEnd_ = ""; + requestId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_ListFoldersRequest_descriptor; + } + + @java.lang.Override + public com.google.storage.control.v2.ListFoldersRequest getDefaultInstanceForType() { + return com.google.storage.control.v2.ListFoldersRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.control.v2.ListFoldersRequest build() { + com.google.storage.control.v2.ListFoldersRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.control.v2.ListFoldersRequest buildPartial() { + com.google.storage.control.v2.ListFoldersRequest result = + new com.google.storage.control.v2.ListFoldersRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.storage.control.v2.ListFoldersRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.prefix_ = prefix_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.delimiter_ = delimiter_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.lexicographicStart_ = lexicographicStart_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.lexicographicEnd_ = lexicographicEnd_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.requestId_ = requestId_; + } + } + + @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.control.v2.ListFoldersRequest) { + return mergeFrom((com.google.storage.control.v2.ListFoldersRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.control.v2.ListFoldersRequest other) { + if (other == com.google.storage.control.v2.ListFoldersRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getPrefix().isEmpty()) { + prefix_ = other.prefix_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getDelimiter().isEmpty()) { + delimiter_ = other.delimiter_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.getLexicographicStart().isEmpty()) { + lexicographicStart_ = other.lexicographicStart_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (!other.getLexicographicEnd().isEmpty()) { + lexicographicEnd_ = other.lexicographicEnd_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000080; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + prefix_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 50: + { + lexicographicStart_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + lexicographicEnd_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + delimiter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 66 + case 74: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 74 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Name of the bucket in which to look for folders.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the bucket in which to look for folders.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the bucket in which to look for folders.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the bucket in which to look for folders.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the bucket in which to look for folders.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. Maximum number of folders to return in a single response. The
+     * service will use this parameter or 1,000 items, whichever is smaller.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. Maximum number of folders to return in a single response. The
+     * service will use this parameter or 1,000 items, whichever is smaller.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Maximum number of folders to return in a single response. The
+     * service will use this parameter or 1,000 items, whichever is smaller.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. A previously-returned page token representing part of the larger
+     * set of results to view.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. A previously-returned page token representing part of the larger
+     * set of results to view.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. A previously-returned page token representing part of the larger
+     * set of results to view.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A previously-returned page token representing part of the larger
+     * set of results to view.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A previously-returned page token representing part of the larger
+     * set of results to view.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object prefix_ = ""; + /** + * + * + *
+     * Optional. Filter results to folders whose names begin with this prefix.
+     * If set, the value must either be an empty string or end with a '/'.
+     * 
+ * + * string prefix = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The prefix. + */ + public java.lang.String getPrefix() { + java.lang.Object ref = prefix_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + prefix_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Filter results to folders whose names begin with this prefix.
+     * If set, the value must either be an empty string or end with a '/'.
+     * 
+ * + * string prefix = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for prefix. + */ + public com.google.protobuf.ByteString getPrefixBytes() { + java.lang.Object ref = prefix_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + prefix_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Filter results to folders whose names begin with this prefix.
+     * If set, the value must either be an empty string or end with a '/'.
+     * 
+ * + * string prefix = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The prefix to set. + * @return This builder for chaining. + */ + public Builder setPrefix(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + prefix_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Filter results to folders whose names begin with this prefix.
+     * If set, the value must either be an empty string or end with a '/'.
+     * 
+ * + * string prefix = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPrefix() { + prefix_ = getDefaultInstance().getPrefix(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Filter results to folders whose names begin with this prefix.
+     * If set, the value must either be an empty string or end with a '/'.
+     * 
+ * + * string prefix = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for prefix to set. + * @return This builder for chaining. + */ + public Builder setPrefixBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + prefix_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object delimiter_ = ""; + /** + * + * + *
+     * Optional. If set, returns results in a directory-like mode. The results
+     * will only include folders that either exactly match the above prefix, or
+     * are one level below the prefix. The only supported value is '/'.
+     * 
+ * + * string delimiter = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The delimiter. + */ + public java.lang.String getDelimiter() { + java.lang.Object ref = delimiter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + delimiter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. If set, returns results in a directory-like mode. The results
+     * will only include folders that either exactly match the above prefix, or
+     * are one level below the prefix. The only supported value is '/'.
+     * 
+ * + * string delimiter = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for delimiter. + */ + public com.google.protobuf.ByteString getDelimiterBytes() { + java.lang.Object ref = delimiter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + delimiter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. If set, returns results in a directory-like mode. The results
+     * will only include folders that either exactly match the above prefix, or
+     * are one level below the prefix. The only supported value is '/'.
+     * 
+ * + * string delimiter = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The delimiter to set. + * @return This builder for chaining. + */ + public Builder setDelimiter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + delimiter_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, returns results in a directory-like mode. The results
+     * will only include folders that either exactly match the above prefix, or
+     * are one level below the prefix. The only supported value is '/'.
+     * 
+ * + * string delimiter = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDelimiter() { + delimiter_ = getDefaultInstance().getDelimiter(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set, returns results in a directory-like mode. The results
+     * will only include folders that either exactly match the above prefix, or
+     * are one level below the prefix. The only supported value is '/'.
+     * 
+ * + * string delimiter = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for delimiter to set. + * @return This builder for chaining. + */ + public Builder setDelimiterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + delimiter_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object lexicographicStart_ = ""; + /** + * + * + *
+     * Optional. Filter results to folders whose names are lexicographically equal
+     * to or after lexicographic_start. If lexicographic_end is also set, the
+     * folders listed have names between lexicographic_start (inclusive) and
+     * lexicographic_end (exclusive).
+     * 
+ * + * string lexicographic_start = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The lexicographicStart. + */ + public java.lang.String getLexicographicStart() { + java.lang.Object ref = lexicographicStart_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + lexicographicStart_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Filter results to folders whose names are lexicographically equal
+     * to or after lexicographic_start. If lexicographic_end is also set, the
+     * folders listed have names between lexicographic_start (inclusive) and
+     * lexicographic_end (exclusive).
+     * 
+ * + * string lexicographic_start = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for lexicographicStart. + */ + public com.google.protobuf.ByteString getLexicographicStartBytes() { + java.lang.Object ref = lexicographicStart_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + lexicographicStart_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Filter results to folders whose names are lexicographically equal
+     * to or after lexicographic_start. If lexicographic_end is also set, the
+     * folders listed have names between lexicographic_start (inclusive) and
+     * lexicographic_end (exclusive).
+     * 
+ * + * string lexicographic_start = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The lexicographicStart to set. + * @return This builder for chaining. + */ + public Builder setLexicographicStart(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + lexicographicStart_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Filter results to folders whose names are lexicographically equal
+     * to or after lexicographic_start. If lexicographic_end is also set, the
+     * folders listed have names between lexicographic_start (inclusive) and
+     * lexicographic_end (exclusive).
+     * 
+ * + * string lexicographic_start = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearLexicographicStart() { + lexicographicStart_ = getDefaultInstance().getLexicographicStart(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Filter results to folders whose names are lexicographically equal
+     * to or after lexicographic_start. If lexicographic_end is also set, the
+     * folders listed have names between lexicographic_start (inclusive) and
+     * lexicographic_end (exclusive).
+     * 
+ * + * string lexicographic_start = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for lexicographicStart to set. + * @return This builder for chaining. + */ + public Builder setLexicographicStartBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + lexicographicStart_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private java.lang.Object lexicographicEnd_ = ""; + /** + * + * + *
+     * Optional. Filter results to folders whose names are lexicographically
+     * before lexicographic_end. If lexicographic_start is also set, the folders
+     * listed have names between lexicographic_start (inclusive) and
+     * lexicographic_end (exclusive).
+     * 
+ * + * string lexicographic_end = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The lexicographicEnd. + */ + public java.lang.String getLexicographicEnd() { + java.lang.Object ref = lexicographicEnd_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + lexicographicEnd_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Filter results to folders whose names are lexicographically
+     * before lexicographic_end. If lexicographic_start is also set, the folders
+     * listed have names between lexicographic_start (inclusive) and
+     * lexicographic_end (exclusive).
+     * 
+ * + * string lexicographic_end = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for lexicographicEnd. + */ + public com.google.protobuf.ByteString getLexicographicEndBytes() { + java.lang.Object ref = lexicographicEnd_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + lexicographicEnd_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Filter results to folders whose names are lexicographically
+     * before lexicographic_end. If lexicographic_start is also set, the folders
+     * listed have names between lexicographic_start (inclusive) and
+     * lexicographic_end (exclusive).
+     * 
+ * + * string lexicographic_end = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The lexicographicEnd to set. + * @return This builder for chaining. + */ + public Builder setLexicographicEnd(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + lexicographicEnd_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Filter results to folders whose names are lexicographically
+     * before lexicographic_end. If lexicographic_start is also set, the folders
+     * listed have names between lexicographic_start (inclusive) and
+     * lexicographic_end (exclusive).
+     * 
+ * + * string lexicographic_end = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearLexicographicEnd() { + lexicographicEnd_ = getDefaultInstance().getLexicographicEnd(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Filter results to folders whose names are lexicographically
+     * before lexicographic_end. If lexicographic_start is also set, the folders
+     * listed have names between lexicographic_start (inclusive) and
+     * lexicographic_end (exclusive).
+     * 
+ * + * string lexicographic_end = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for lexicographicEnd to set. + * @return This builder for chaining. + */ + public Builder setLexicographicEndBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + lexicographicEnd_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. A unique identifier for this request. UUID is the recommended
+     * format, but other formats are still accepted.
+     * 
+ * + * + * string request_id = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. A unique identifier for this request. UUID is the recommended
+     * format, but other formats are still accepted.
+     * 
+ * + * + * string request_id = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. A unique identifier for this request. UUID is the recommended
+     * format, but other formats are still accepted.
+     * 
+ * + * + * string request_id = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + requestId_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A unique identifier for this request. UUID is the recommended
+     * format, but other formats are still accepted.
+     * 
+ * + * + * string request_id = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A unique identifier for this request. UUID is the recommended
+     * format, but other formats are still accepted.
+     * 
+ * + * + * string request_id = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + requestId_ = value; + bitField0_ |= 0x00000080; + 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.control.v2.ListFoldersRequest) + } + + // @@protoc_insertion_point(class_scope:google.storage.control.v2.ListFoldersRequest) + private static final com.google.storage.control.v2.ListFoldersRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.control.v2.ListFoldersRequest(); + } + + public static com.google.storage.control.v2.ListFoldersRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListFoldersRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.control.v2.ListFoldersRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/ListFoldersRequestOrBuilder.java b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/ListFoldersRequestOrBuilder.java new file mode 100644 index 0000000000..1a935c9813 --- /dev/null +++ b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/ListFoldersRequestOrBuilder.java @@ -0,0 +1,244 @@ +/* + * Copyright 2023 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/control/v2/storage_control.proto + +package com.google.storage.control.v2; + +public interface ListFoldersRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.control.v2.ListFoldersRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the bucket in which to look for folders.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Name of the bucket in which to look for folders.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. Maximum number of folders to return in a single response. The
+   * service will use this parameter or 1,000 items, whichever is smaller.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A previously-returned page token representing part of the larger
+   * set of results to view.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. A previously-returned page token representing part of the larger
+   * set of results to view.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. Filter results to folders whose names begin with this prefix.
+   * If set, the value must either be an empty string or end with a '/'.
+   * 
+ * + * string prefix = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The prefix. + */ + java.lang.String getPrefix(); + /** + * + * + *
+   * Optional. Filter results to folders whose names begin with this prefix.
+   * If set, the value must either be an empty string or end with a '/'.
+   * 
+ * + * string prefix = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for prefix. + */ + com.google.protobuf.ByteString getPrefixBytes(); + + /** + * + * + *
+   * Optional. If set, returns results in a directory-like mode. The results
+   * will only include folders that either exactly match the above prefix, or
+   * are one level below the prefix. The only supported value is '/'.
+   * 
+ * + * string delimiter = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The delimiter. + */ + java.lang.String getDelimiter(); + /** + * + * + *
+   * Optional. If set, returns results in a directory-like mode. The results
+   * will only include folders that either exactly match the above prefix, or
+   * are one level below the prefix. The only supported value is '/'.
+   * 
+ * + * string delimiter = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for delimiter. + */ + com.google.protobuf.ByteString getDelimiterBytes(); + + /** + * + * + *
+   * Optional. Filter results to folders whose names are lexicographically equal
+   * to or after lexicographic_start. If lexicographic_end is also set, the
+   * folders listed have names between lexicographic_start (inclusive) and
+   * lexicographic_end (exclusive).
+   * 
+ * + * string lexicographic_start = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The lexicographicStart. + */ + java.lang.String getLexicographicStart(); + /** + * + * + *
+   * Optional. Filter results to folders whose names are lexicographically equal
+   * to or after lexicographic_start. If lexicographic_end is also set, the
+   * folders listed have names between lexicographic_start (inclusive) and
+   * lexicographic_end (exclusive).
+   * 
+ * + * string lexicographic_start = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for lexicographicStart. + */ + com.google.protobuf.ByteString getLexicographicStartBytes(); + + /** + * + * + *
+   * Optional. Filter results to folders whose names are lexicographically
+   * before lexicographic_end. If lexicographic_start is also set, the folders
+   * listed have names between lexicographic_start (inclusive) and
+   * lexicographic_end (exclusive).
+   * 
+ * + * string lexicographic_end = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The lexicographicEnd. + */ + java.lang.String getLexicographicEnd(); + /** + * + * + *
+   * Optional. Filter results to folders whose names are lexicographically
+   * before lexicographic_end. If lexicographic_start is also set, the folders
+   * listed have names between lexicographic_start (inclusive) and
+   * lexicographic_end (exclusive).
+   * 
+ * + * string lexicographic_end = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for lexicographicEnd. + */ + com.google.protobuf.ByteString getLexicographicEndBytes(); + + /** + * + * + *
+   * Optional. A unique identifier for this request. UUID is the recommended
+   * format, but other formats are still accepted.
+   * 
+ * + * + * string request_id = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. A unique identifier for this request. UUID is the recommended
+   * format, but other formats are still accepted.
+   * 
+ * + * + * string request_id = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/ListFoldersResponse.java b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/ListFoldersResponse.java new file mode 100644 index 0000000000..be525cbd04 --- /dev/null +++ b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/ListFoldersResponse.java @@ -0,0 +1,1123 @@ +/* + * Copyright 2023 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/control/v2/storage_control.proto + +package com.google.storage.control.v2; + +/** + * + * + *
+ * Response message for ListFolders.
+ * 
+ * + * Protobuf type {@code google.storage.control.v2.ListFoldersResponse} + */ +public final class ListFoldersResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.control.v2.ListFoldersResponse) + ListFoldersResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListFoldersResponse.newBuilder() to construct. + private ListFoldersResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListFoldersResponse() { + folders_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListFoldersResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_ListFoldersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_ListFoldersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.control.v2.ListFoldersResponse.class, + com.google.storage.control.v2.ListFoldersResponse.Builder.class); + } + + public static final int FOLDERS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List folders_; + /** + * + * + *
+   * The list of child folders
+   * 
+ * + * repeated .google.storage.control.v2.Folder folders = 1; + */ + @java.lang.Override + public java.util.List getFoldersList() { + return folders_; + } + /** + * + * + *
+   * The list of child folders
+   * 
+ * + * repeated .google.storage.control.v2.Folder folders = 1; + */ + @java.lang.Override + public java.util.List + getFoldersOrBuilderList() { + return folders_; + } + /** + * + * + *
+   * The list of child folders
+   * 
+ * + * repeated .google.storage.control.v2.Folder folders = 1; + */ + @java.lang.Override + public int getFoldersCount() { + return folders_.size(); + } + /** + * + * + *
+   * The list of child folders
+   * 
+ * + * repeated .google.storage.control.v2.Folder folders = 1; + */ + @java.lang.Override + public com.google.storage.control.v2.Folder getFolders(int index) { + return folders_.get(index); + } + /** + * + * + *
+   * The list of child folders
+   * 
+ * + * repeated .google.storage.control.v2.Folder folders = 1; + */ + @java.lang.Override + public com.google.storage.control.v2.FolderOrBuilder getFoldersOrBuilder(int index) { + return folders_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * The continuation token, used to page through large result sets. Provide
+   * this value in a subsequent request to return the next page of results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The continuation token, used to page through large result sets. Provide
+   * this value in a subsequent request to return the next page of results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 < folders_.size(); i++) { + output.writeMessage(1, folders_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < folders_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, folders_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().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.control.v2.ListFoldersResponse)) { + return super.equals(obj); + } + com.google.storage.control.v2.ListFoldersResponse other = + (com.google.storage.control.v2.ListFoldersResponse) obj; + + if (!getFoldersList().equals(other.getFoldersList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getFoldersCount() > 0) { + hash = (37 * hash) + FOLDERS_FIELD_NUMBER; + hash = (53 * hash) + getFoldersList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.control.v2.ListFoldersResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.control.v2.ListFoldersResponse 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.control.v2.ListFoldersResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.control.v2.ListFoldersResponse 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.control.v2.ListFoldersResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.control.v2.ListFoldersResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.control.v2.ListFoldersResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.control.v2.ListFoldersResponse 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.control.v2.ListFoldersResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.control.v2.ListFoldersResponse 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.control.v2.ListFoldersResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.control.v2.ListFoldersResponse 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.control.v2.ListFoldersResponse 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 ListFolders.
+   * 
+ * + * Protobuf type {@code google.storage.control.v2.ListFoldersResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.control.v2.ListFoldersResponse) + com.google.storage.control.v2.ListFoldersResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_ListFoldersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_ListFoldersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.control.v2.ListFoldersResponse.class, + com.google.storage.control.v2.ListFoldersResponse.Builder.class); + } + + // Construct using com.google.storage.control.v2.ListFoldersResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (foldersBuilder_ == null) { + folders_ = java.util.Collections.emptyList(); + } else { + folders_ = null; + foldersBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_ListFoldersResponse_descriptor; + } + + @java.lang.Override + public com.google.storage.control.v2.ListFoldersResponse getDefaultInstanceForType() { + return com.google.storage.control.v2.ListFoldersResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.control.v2.ListFoldersResponse build() { + com.google.storage.control.v2.ListFoldersResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.control.v2.ListFoldersResponse buildPartial() { + com.google.storage.control.v2.ListFoldersResponse result = + new com.google.storage.control.v2.ListFoldersResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.storage.control.v2.ListFoldersResponse result) { + if (foldersBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + folders_ = java.util.Collections.unmodifiableList(folders_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.folders_ = folders_; + } else { + result.folders_ = foldersBuilder_.build(); + } + } + + private void buildPartial0(com.google.storage.control.v2.ListFoldersResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @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.control.v2.ListFoldersResponse) { + return mergeFrom((com.google.storage.control.v2.ListFoldersResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.control.v2.ListFoldersResponse other) { + if (other == com.google.storage.control.v2.ListFoldersResponse.getDefaultInstance()) + return this; + if (foldersBuilder_ == null) { + if (!other.folders_.isEmpty()) { + if (folders_.isEmpty()) { + folders_ = other.folders_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureFoldersIsMutable(); + folders_.addAll(other.folders_); + } + onChanged(); + } + } else { + if (!other.folders_.isEmpty()) { + if (foldersBuilder_.isEmpty()) { + foldersBuilder_.dispose(); + foldersBuilder_ = null; + folders_ = other.folders_; + bitField0_ = (bitField0_ & ~0x00000001); + foldersBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getFoldersFieldBuilder() + : null; + } else { + foldersBuilder_.addAllMessages(other.folders_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.storage.control.v2.Folder m = + input.readMessage( + com.google.storage.control.v2.Folder.parser(), extensionRegistry); + if (foldersBuilder_ == null) { + ensureFoldersIsMutable(); + folders_.add(m); + } else { + foldersBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List folders_ = + java.util.Collections.emptyList(); + + private void ensureFoldersIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + folders_ = new java.util.ArrayList(folders_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.storage.control.v2.Folder, + com.google.storage.control.v2.Folder.Builder, + com.google.storage.control.v2.FolderOrBuilder> + foldersBuilder_; + + /** + * + * + *
+     * The list of child folders
+     * 
+ * + * repeated .google.storage.control.v2.Folder folders = 1; + */ + public java.util.List getFoldersList() { + if (foldersBuilder_ == null) { + return java.util.Collections.unmodifiableList(folders_); + } else { + return foldersBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of child folders
+     * 
+ * + * repeated .google.storage.control.v2.Folder folders = 1; + */ + public int getFoldersCount() { + if (foldersBuilder_ == null) { + return folders_.size(); + } else { + return foldersBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of child folders
+     * 
+ * + * repeated .google.storage.control.v2.Folder folders = 1; + */ + public com.google.storage.control.v2.Folder getFolders(int index) { + if (foldersBuilder_ == null) { + return folders_.get(index); + } else { + return foldersBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of child folders
+     * 
+ * + * repeated .google.storage.control.v2.Folder folders = 1; + */ + public Builder setFolders(int index, com.google.storage.control.v2.Folder value) { + if (foldersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFoldersIsMutable(); + folders_.set(index, value); + onChanged(); + } else { + foldersBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of child folders
+     * 
+ * + * repeated .google.storage.control.v2.Folder folders = 1; + */ + public Builder setFolders( + int index, com.google.storage.control.v2.Folder.Builder builderForValue) { + if (foldersBuilder_ == null) { + ensureFoldersIsMutable(); + folders_.set(index, builderForValue.build()); + onChanged(); + } else { + foldersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of child folders
+     * 
+ * + * repeated .google.storage.control.v2.Folder folders = 1; + */ + public Builder addFolders(com.google.storage.control.v2.Folder value) { + if (foldersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFoldersIsMutable(); + folders_.add(value); + onChanged(); + } else { + foldersBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of child folders
+     * 
+ * + * repeated .google.storage.control.v2.Folder folders = 1; + */ + public Builder addFolders(int index, com.google.storage.control.v2.Folder value) { + if (foldersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFoldersIsMutable(); + folders_.add(index, value); + onChanged(); + } else { + foldersBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of child folders
+     * 
+ * + * repeated .google.storage.control.v2.Folder folders = 1; + */ + public Builder addFolders(com.google.storage.control.v2.Folder.Builder builderForValue) { + if (foldersBuilder_ == null) { + ensureFoldersIsMutable(); + folders_.add(builderForValue.build()); + onChanged(); + } else { + foldersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of child folders
+     * 
+ * + * repeated .google.storage.control.v2.Folder folders = 1; + */ + public Builder addFolders( + int index, com.google.storage.control.v2.Folder.Builder builderForValue) { + if (foldersBuilder_ == null) { + ensureFoldersIsMutable(); + folders_.add(index, builderForValue.build()); + onChanged(); + } else { + foldersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of child folders
+     * 
+ * + * repeated .google.storage.control.v2.Folder folders = 1; + */ + public Builder addAllFolders( + java.lang.Iterable values) { + if (foldersBuilder_ == null) { + ensureFoldersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, folders_); + onChanged(); + } else { + foldersBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of child folders
+     * 
+ * + * repeated .google.storage.control.v2.Folder folders = 1; + */ + public Builder clearFolders() { + if (foldersBuilder_ == null) { + folders_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + foldersBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of child folders
+     * 
+ * + * repeated .google.storage.control.v2.Folder folders = 1; + */ + public Builder removeFolders(int index) { + if (foldersBuilder_ == null) { + ensureFoldersIsMutable(); + folders_.remove(index); + onChanged(); + } else { + foldersBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of child folders
+     * 
+ * + * repeated .google.storage.control.v2.Folder folders = 1; + */ + public com.google.storage.control.v2.Folder.Builder getFoldersBuilder(int index) { + return getFoldersFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of child folders
+     * 
+ * + * repeated .google.storage.control.v2.Folder folders = 1; + */ + public com.google.storage.control.v2.FolderOrBuilder getFoldersOrBuilder(int index) { + if (foldersBuilder_ == null) { + return folders_.get(index); + } else { + return foldersBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of child folders
+     * 
+ * + * repeated .google.storage.control.v2.Folder folders = 1; + */ + public java.util.List + getFoldersOrBuilderList() { + if (foldersBuilder_ != null) { + return foldersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(folders_); + } + } + /** + * + * + *
+     * The list of child folders
+     * 
+ * + * repeated .google.storage.control.v2.Folder folders = 1; + */ + public com.google.storage.control.v2.Folder.Builder addFoldersBuilder() { + return getFoldersFieldBuilder() + .addBuilder(com.google.storage.control.v2.Folder.getDefaultInstance()); + } + /** + * + * + *
+     * The list of child folders
+     * 
+ * + * repeated .google.storage.control.v2.Folder folders = 1; + */ + public com.google.storage.control.v2.Folder.Builder addFoldersBuilder(int index) { + return getFoldersFieldBuilder() + .addBuilder(index, com.google.storage.control.v2.Folder.getDefaultInstance()); + } + /** + * + * + *
+     * The list of child folders
+     * 
+ * + * repeated .google.storage.control.v2.Folder folders = 1; + */ + public java.util.List getFoldersBuilderList() { + return getFoldersFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.storage.control.v2.Folder, + com.google.storage.control.v2.Folder.Builder, + com.google.storage.control.v2.FolderOrBuilder> + getFoldersFieldBuilder() { + if (foldersBuilder_ == null) { + foldersBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.storage.control.v2.Folder, + com.google.storage.control.v2.Folder.Builder, + com.google.storage.control.v2.FolderOrBuilder>( + folders_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + folders_ = null; + } + return foldersBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * The continuation token, used to page through large result sets. Provide
+     * this value in a subsequent request to return the next page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The continuation token, used to page through large result sets. Provide
+     * this value in a subsequent request to return the next page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The continuation token, used to page through large result sets. Provide
+     * this value in a subsequent request to return the next page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The continuation token, used to page through large result sets. Provide
+     * this value in a subsequent request to return the next page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The continuation token, used to page through large result sets. Provide
+     * this value in a subsequent request to return the next page of results.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + 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.control.v2.ListFoldersResponse) + } + + // @@protoc_insertion_point(class_scope:google.storage.control.v2.ListFoldersResponse) + private static final com.google.storage.control.v2.ListFoldersResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.control.v2.ListFoldersResponse(); + } + + public static com.google.storage.control.v2.ListFoldersResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListFoldersResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.control.v2.ListFoldersResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/ListFoldersResponseOrBuilder.java b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/ListFoldersResponseOrBuilder.java new file mode 100644 index 0000000000..853be1f9d2 --- /dev/null +++ b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/ListFoldersResponseOrBuilder.java @@ -0,0 +1,103 @@ +/* + * Copyright 2023 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/control/v2/storage_control.proto + +package com.google.storage.control.v2; + +public interface ListFoldersResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.control.v2.ListFoldersResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of child folders
+   * 
+ * + * repeated .google.storage.control.v2.Folder folders = 1; + */ + java.util.List getFoldersList(); + /** + * + * + *
+   * The list of child folders
+   * 
+ * + * repeated .google.storage.control.v2.Folder folders = 1; + */ + com.google.storage.control.v2.Folder getFolders(int index); + /** + * + * + *
+   * The list of child folders
+   * 
+ * + * repeated .google.storage.control.v2.Folder folders = 1; + */ + int getFoldersCount(); + /** + * + * + *
+   * The list of child folders
+   * 
+ * + * repeated .google.storage.control.v2.Folder folders = 1; + */ + java.util.List getFoldersOrBuilderList(); + /** + * + * + *
+   * The list of child folders
+   * 
+ * + * repeated .google.storage.control.v2.Folder folders = 1; + */ + com.google.storage.control.v2.FolderOrBuilder getFoldersOrBuilder(int index); + + /** + * + * + *
+   * The continuation token, used to page through large result sets. Provide
+   * this value in a subsequent request to return the next page of results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * The continuation token, used to page through large result sets. Provide
+   * this value in a subsequent request to return the next page of results.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/PendingRenameInfo.java b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/PendingRenameInfo.java new file mode 100644 index 0000000000..9860df9477 --- /dev/null +++ b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/PendingRenameInfo.java @@ -0,0 +1,624 @@ +/* + * Copyright 2023 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/control/v2/storage_control.proto + +package com.google.storage.control.v2; + +/** + * + * + *
+ * Contains information about a pending rename operation.
+ * 
+ * + * Protobuf type {@code google.storage.control.v2.PendingRenameInfo} + */ +public final class PendingRenameInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.control.v2.PendingRenameInfo) + PendingRenameInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use PendingRenameInfo.newBuilder() to construct. + private PendingRenameInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PendingRenameInfo() { + operation_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PendingRenameInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_PendingRenameInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_PendingRenameInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.control.v2.PendingRenameInfo.class, + com.google.storage.control.v2.PendingRenameInfo.Builder.class); + } + + public static final int OPERATION_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object operation_ = ""; + /** + * + * + *
+   * Output only. The name of the rename operation.
+   * 
+ * + * string operation = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The operation. + */ + @java.lang.Override + public java.lang.String getOperation() { + java.lang.Object ref = operation_; + 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(); + operation_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The name of the rename operation.
+   * 
+ * + * string operation = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for operation. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOperationBytes() { + java.lang.Object ref = operation_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + operation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(operation_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, operation_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(operation_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, operation_); + } + size += getUnknownFields().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.control.v2.PendingRenameInfo)) { + return super.equals(obj); + } + com.google.storage.control.v2.PendingRenameInfo other = + (com.google.storage.control.v2.PendingRenameInfo) obj; + + if (!getOperation().equals(other.getOperation())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + OPERATION_FIELD_NUMBER; + hash = (53 * hash) + getOperation().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.control.v2.PendingRenameInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.control.v2.PendingRenameInfo 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.control.v2.PendingRenameInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.control.v2.PendingRenameInfo 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.control.v2.PendingRenameInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.control.v2.PendingRenameInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.control.v2.PendingRenameInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.control.v2.PendingRenameInfo 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.control.v2.PendingRenameInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.control.v2.PendingRenameInfo 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.control.v2.PendingRenameInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.control.v2.PendingRenameInfo 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.control.v2.PendingRenameInfo 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; + } + /** + * + * + *
+   * Contains information about a pending rename operation.
+   * 
+ * + * Protobuf type {@code google.storage.control.v2.PendingRenameInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.control.v2.PendingRenameInfo) + com.google.storage.control.v2.PendingRenameInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_PendingRenameInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_PendingRenameInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.control.v2.PendingRenameInfo.class, + com.google.storage.control.v2.PendingRenameInfo.Builder.class); + } + + // Construct using com.google.storage.control.v2.PendingRenameInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + operation_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_PendingRenameInfo_descriptor; + } + + @java.lang.Override + public com.google.storage.control.v2.PendingRenameInfo getDefaultInstanceForType() { + return com.google.storage.control.v2.PendingRenameInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.control.v2.PendingRenameInfo build() { + com.google.storage.control.v2.PendingRenameInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.control.v2.PendingRenameInfo buildPartial() { + com.google.storage.control.v2.PendingRenameInfo result = + new com.google.storage.control.v2.PendingRenameInfo(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.storage.control.v2.PendingRenameInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.operation_ = operation_; + } + } + + @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.control.v2.PendingRenameInfo) { + return mergeFrom((com.google.storage.control.v2.PendingRenameInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.control.v2.PendingRenameInfo other) { + if (other == com.google.storage.control.v2.PendingRenameInfo.getDefaultInstance()) + return this; + if (!other.getOperation().isEmpty()) { + operation_ = other.operation_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + operation_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object operation_ = ""; + /** + * + * + *
+     * Output only. The name of the rename operation.
+     * 
+ * + * string operation = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The operation. + */ + public java.lang.String getOperation() { + java.lang.Object ref = operation_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + operation_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The name of the rename operation.
+     * 
+ * + * string operation = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for operation. + */ + public com.google.protobuf.ByteString getOperationBytes() { + java.lang.Object ref = operation_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + operation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The name of the rename operation.
+     * 
+ * + * string operation = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The operation to set. + * @return This builder for chaining. + */ + public Builder setOperation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + operation_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of the rename operation.
+     * 
+ * + * string operation = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearOperation() { + operation_ = getDefaultInstance().getOperation(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of the rename operation.
+     * 
+ * + * string operation = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for operation to set. + * @return This builder for chaining. + */ + public Builder setOperationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + operation_ = value; + bitField0_ |= 0x00000001; + 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.control.v2.PendingRenameInfo) + } + + // @@protoc_insertion_point(class_scope:google.storage.control.v2.PendingRenameInfo) + private static final com.google.storage.control.v2.PendingRenameInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.control.v2.PendingRenameInfo(); + } + + public static com.google.storage.control.v2.PendingRenameInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PendingRenameInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.control.v2.PendingRenameInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/PendingRenameInfoOrBuilder.java b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/PendingRenameInfoOrBuilder.java new file mode 100644 index 0000000000..02336a48de --- /dev/null +++ b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/PendingRenameInfoOrBuilder.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 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/control/v2/storage_control.proto + +package com.google.storage.control.v2; + +public interface PendingRenameInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.control.v2.PendingRenameInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The name of the rename operation.
+   * 
+ * + * string operation = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The operation. + */ + java.lang.String getOperation(); + /** + * + * + *
+   * Output only. The name of the rename operation.
+   * 
+ * + * string operation = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for operation. + */ + com.google.protobuf.ByteString getOperationBytes(); +} diff --git a/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/RenameFolderMetadata.java b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/RenameFolderMetadata.java new file mode 100644 index 0000000000..2903c16bd5 --- /dev/null +++ b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/RenameFolderMetadata.java @@ -0,0 +1,1090 @@ +/* + * Copyright 2023 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/control/v2/storage_control.proto + +package com.google.storage.control.v2; + +/** + * + * + *
+ * Message returned in the metadata field of the Operation resource for
+ * RenameFolder operations.
+ * 
+ * + * Protobuf type {@code google.storage.control.v2.RenameFolderMetadata} + */ +public final class RenameFolderMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.control.v2.RenameFolderMetadata) + RenameFolderMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use RenameFolderMetadata.newBuilder() to construct. + private RenameFolderMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RenameFolderMetadata() { + sourceFolderId_ = ""; + destinationFolderId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RenameFolderMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_RenameFolderMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_RenameFolderMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.control.v2.RenameFolderMetadata.class, + com.google.storage.control.v2.RenameFolderMetadata.Builder.class); + } + + public static final int COMMON_METADATA_FIELD_NUMBER = 1; + private com.google.storage.control.v2.CommonLongRunningOperationMetadata commonMetadata_; + /** + * + * + *
+   * Generic metadata for the long running operation.
+   * 
+ * + * .google.storage.control.v2.CommonLongRunningOperationMetadata common_metadata = 1; + * + * @return Whether the commonMetadata field is set. + */ + @java.lang.Override + public boolean hasCommonMetadata() { + return commonMetadata_ != null; + } + /** + * + * + *
+   * Generic metadata for the long running operation.
+   * 
+ * + * .google.storage.control.v2.CommonLongRunningOperationMetadata common_metadata = 1; + * + * @return The commonMetadata. + */ + @java.lang.Override + public com.google.storage.control.v2.CommonLongRunningOperationMetadata getCommonMetadata() { + return commonMetadata_ == null + ? com.google.storage.control.v2.CommonLongRunningOperationMetadata.getDefaultInstance() + : commonMetadata_; + } + /** + * + * + *
+   * Generic metadata for the long running operation.
+   * 
+ * + * .google.storage.control.v2.CommonLongRunningOperationMetadata common_metadata = 1; + */ + @java.lang.Override + public com.google.storage.control.v2.CommonLongRunningOperationMetadataOrBuilder + getCommonMetadataOrBuilder() { + return commonMetadata_ == null + ? com.google.storage.control.v2.CommonLongRunningOperationMetadata.getDefaultInstance() + : commonMetadata_; + } + + public static final int SOURCE_FOLDER_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object sourceFolderId_ = ""; + /** + * + * + *
+   * The path of the source folder.
+   * 
+ * + * string source_folder_id = 2; + * + * @return The sourceFolderId. + */ + @java.lang.Override + public java.lang.String getSourceFolderId() { + java.lang.Object ref = sourceFolderId_; + 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(); + sourceFolderId_ = s; + return s; + } + } + /** + * + * + *
+   * The path of the source folder.
+   * 
+ * + * string source_folder_id = 2; + * + * @return The bytes for sourceFolderId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSourceFolderIdBytes() { + java.lang.Object ref = sourceFolderId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceFolderId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESTINATION_FOLDER_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object destinationFolderId_ = ""; + /** + * + * + *
+   * The path of the destination folder.
+   * 
+ * + * string destination_folder_id = 3; + * + * @return The destinationFolderId. + */ + @java.lang.Override + public java.lang.String getDestinationFolderId() { + java.lang.Object ref = destinationFolderId_; + 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(); + destinationFolderId_ = s; + return s; + } + } + /** + * + * + *
+   * The path of the destination folder.
+   * 
+ * + * string destination_folder_id = 3; + * + * @return The bytes for destinationFolderId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDestinationFolderIdBytes() { + java.lang.Object ref = destinationFolderId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destinationFolderId_ = 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 (commonMetadata_ != null) { + output.writeMessage(1, getCommonMetadata()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sourceFolderId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, sourceFolderId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(destinationFolderId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, destinationFolderId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (commonMetadata_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCommonMetadata()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sourceFolderId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, sourceFolderId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(destinationFolderId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, destinationFolderId_); + } + size += getUnknownFields().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.control.v2.RenameFolderMetadata)) { + return super.equals(obj); + } + com.google.storage.control.v2.RenameFolderMetadata other = + (com.google.storage.control.v2.RenameFolderMetadata) obj; + + if (hasCommonMetadata() != other.hasCommonMetadata()) return false; + if (hasCommonMetadata()) { + if (!getCommonMetadata().equals(other.getCommonMetadata())) return false; + } + if (!getSourceFolderId().equals(other.getSourceFolderId())) return false; + if (!getDestinationFolderId().equals(other.getDestinationFolderId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasCommonMetadata()) { + hash = (37 * hash) + COMMON_METADATA_FIELD_NUMBER; + hash = (53 * hash) + getCommonMetadata().hashCode(); + } + hash = (37 * hash) + SOURCE_FOLDER_ID_FIELD_NUMBER; + hash = (53 * hash) + getSourceFolderId().hashCode(); + hash = (37 * hash) + DESTINATION_FOLDER_ID_FIELD_NUMBER; + hash = (53 * hash) + getDestinationFolderId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.control.v2.RenameFolderMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.control.v2.RenameFolderMetadata 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.control.v2.RenameFolderMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.control.v2.RenameFolderMetadata 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.control.v2.RenameFolderMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.control.v2.RenameFolderMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.control.v2.RenameFolderMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.control.v2.RenameFolderMetadata 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.control.v2.RenameFolderMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.control.v2.RenameFolderMetadata 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.control.v2.RenameFolderMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.control.v2.RenameFolderMetadata 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.control.v2.RenameFolderMetadata 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 returned in the metadata field of the Operation resource for
+   * RenameFolder operations.
+   * 
+ * + * Protobuf type {@code google.storage.control.v2.RenameFolderMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.control.v2.RenameFolderMetadata) + com.google.storage.control.v2.RenameFolderMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_RenameFolderMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_RenameFolderMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.control.v2.RenameFolderMetadata.class, + com.google.storage.control.v2.RenameFolderMetadata.Builder.class); + } + + // Construct using com.google.storage.control.v2.RenameFolderMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + commonMetadata_ = null; + if (commonMetadataBuilder_ != null) { + commonMetadataBuilder_.dispose(); + commonMetadataBuilder_ = null; + } + sourceFolderId_ = ""; + destinationFolderId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_RenameFolderMetadata_descriptor; + } + + @java.lang.Override + public com.google.storage.control.v2.RenameFolderMetadata getDefaultInstanceForType() { + return com.google.storage.control.v2.RenameFolderMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.control.v2.RenameFolderMetadata build() { + com.google.storage.control.v2.RenameFolderMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.control.v2.RenameFolderMetadata buildPartial() { + com.google.storage.control.v2.RenameFolderMetadata result = + new com.google.storage.control.v2.RenameFolderMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.storage.control.v2.RenameFolderMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.commonMetadata_ = + commonMetadataBuilder_ == null ? commonMetadata_ : commonMetadataBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.sourceFolderId_ = sourceFolderId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.destinationFolderId_ = destinationFolderId_; + } + } + + @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.control.v2.RenameFolderMetadata) { + return mergeFrom((com.google.storage.control.v2.RenameFolderMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.control.v2.RenameFolderMetadata other) { + if (other == com.google.storage.control.v2.RenameFolderMetadata.getDefaultInstance()) + return this; + if (other.hasCommonMetadata()) { + mergeCommonMetadata(other.getCommonMetadata()); + } + if (!other.getSourceFolderId().isEmpty()) { + sourceFolderId_ = other.sourceFolderId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getDestinationFolderId().isEmpty()) { + destinationFolderId_ = other.destinationFolderId_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getCommonMetadataFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + sourceFolderId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + destinationFolderId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.storage.control.v2.CommonLongRunningOperationMetadata commonMetadata_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.control.v2.CommonLongRunningOperationMetadata, + com.google.storage.control.v2.CommonLongRunningOperationMetadata.Builder, + com.google.storage.control.v2.CommonLongRunningOperationMetadataOrBuilder> + commonMetadataBuilder_; + /** + * + * + *
+     * Generic metadata for the long running operation.
+     * 
+ * + * .google.storage.control.v2.CommonLongRunningOperationMetadata common_metadata = 1; + * + * + * @return Whether the commonMetadata field is set. + */ + public boolean hasCommonMetadata() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Generic metadata for the long running operation.
+     * 
+ * + * .google.storage.control.v2.CommonLongRunningOperationMetadata common_metadata = 1; + * + * + * @return The commonMetadata. + */ + public com.google.storage.control.v2.CommonLongRunningOperationMetadata getCommonMetadata() { + if (commonMetadataBuilder_ == null) { + return commonMetadata_ == null + ? com.google.storage.control.v2.CommonLongRunningOperationMetadata.getDefaultInstance() + : commonMetadata_; + } else { + return commonMetadataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Generic metadata for the long running operation.
+     * 
+ * + * .google.storage.control.v2.CommonLongRunningOperationMetadata common_metadata = 1; + * + */ + public Builder setCommonMetadata( + com.google.storage.control.v2.CommonLongRunningOperationMetadata value) { + if (commonMetadataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + commonMetadata_ = value; + } else { + commonMetadataBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Generic metadata for the long running operation.
+     * 
+ * + * .google.storage.control.v2.CommonLongRunningOperationMetadata common_metadata = 1; + * + */ + public Builder setCommonMetadata( + com.google.storage.control.v2.CommonLongRunningOperationMetadata.Builder builderForValue) { + if (commonMetadataBuilder_ == null) { + commonMetadata_ = builderForValue.build(); + } else { + commonMetadataBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Generic metadata for the long running operation.
+     * 
+ * + * .google.storage.control.v2.CommonLongRunningOperationMetadata common_metadata = 1; + * + */ + public Builder mergeCommonMetadata( + com.google.storage.control.v2.CommonLongRunningOperationMetadata value) { + if (commonMetadataBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && commonMetadata_ != null + && commonMetadata_ + != com.google.storage.control.v2.CommonLongRunningOperationMetadata + .getDefaultInstance()) { + getCommonMetadataBuilder().mergeFrom(value); + } else { + commonMetadata_ = value; + } + } else { + commonMetadataBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Generic metadata for the long running operation.
+     * 
+ * + * .google.storage.control.v2.CommonLongRunningOperationMetadata common_metadata = 1; + * + */ + public Builder clearCommonMetadata() { + bitField0_ = (bitField0_ & ~0x00000001); + commonMetadata_ = null; + if (commonMetadataBuilder_ != null) { + commonMetadataBuilder_.dispose(); + commonMetadataBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Generic metadata for the long running operation.
+     * 
+ * + * .google.storage.control.v2.CommonLongRunningOperationMetadata common_metadata = 1; + * + */ + public com.google.storage.control.v2.CommonLongRunningOperationMetadata.Builder + getCommonMetadataBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getCommonMetadataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Generic metadata for the long running operation.
+     * 
+ * + * .google.storage.control.v2.CommonLongRunningOperationMetadata common_metadata = 1; + * + */ + public com.google.storage.control.v2.CommonLongRunningOperationMetadataOrBuilder + getCommonMetadataOrBuilder() { + if (commonMetadataBuilder_ != null) { + return commonMetadataBuilder_.getMessageOrBuilder(); + } else { + return commonMetadata_ == null + ? com.google.storage.control.v2.CommonLongRunningOperationMetadata.getDefaultInstance() + : commonMetadata_; + } + } + /** + * + * + *
+     * Generic metadata for the long running operation.
+     * 
+ * + * .google.storage.control.v2.CommonLongRunningOperationMetadata common_metadata = 1; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.control.v2.CommonLongRunningOperationMetadata, + com.google.storage.control.v2.CommonLongRunningOperationMetadata.Builder, + com.google.storage.control.v2.CommonLongRunningOperationMetadataOrBuilder> + getCommonMetadataFieldBuilder() { + if (commonMetadataBuilder_ == null) { + commonMetadataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.control.v2.CommonLongRunningOperationMetadata, + com.google.storage.control.v2.CommonLongRunningOperationMetadata.Builder, + com.google.storage.control.v2.CommonLongRunningOperationMetadataOrBuilder>( + getCommonMetadata(), getParentForChildren(), isClean()); + commonMetadata_ = null; + } + return commonMetadataBuilder_; + } + + private java.lang.Object sourceFolderId_ = ""; + /** + * + * + *
+     * The path of the source folder.
+     * 
+ * + * string source_folder_id = 2; + * + * @return The sourceFolderId. + */ + public java.lang.String getSourceFolderId() { + java.lang.Object ref = sourceFolderId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sourceFolderId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The path of the source folder.
+     * 
+ * + * string source_folder_id = 2; + * + * @return The bytes for sourceFolderId. + */ + public com.google.protobuf.ByteString getSourceFolderIdBytes() { + java.lang.Object ref = sourceFolderId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceFolderId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The path of the source folder.
+     * 
+ * + * string source_folder_id = 2; + * + * @param value The sourceFolderId to set. + * @return This builder for chaining. + */ + public Builder setSourceFolderId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sourceFolderId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * The path of the source folder.
+     * 
+ * + * string source_folder_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearSourceFolderId() { + sourceFolderId_ = getDefaultInstance().getSourceFolderId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The path of the source folder.
+     * 
+ * + * string source_folder_id = 2; + * + * @param value The bytes for sourceFolderId to set. + * @return This builder for chaining. + */ + public Builder setSourceFolderIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sourceFolderId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object destinationFolderId_ = ""; + /** + * + * + *
+     * The path of the destination folder.
+     * 
+ * + * string destination_folder_id = 3; + * + * @return The destinationFolderId. + */ + public java.lang.String getDestinationFolderId() { + java.lang.Object ref = destinationFolderId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + destinationFolderId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The path of the destination folder.
+     * 
+ * + * string destination_folder_id = 3; + * + * @return The bytes for destinationFolderId. + */ + public com.google.protobuf.ByteString getDestinationFolderIdBytes() { + java.lang.Object ref = destinationFolderId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destinationFolderId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The path of the destination folder.
+     * 
+ * + * string destination_folder_id = 3; + * + * @param value The destinationFolderId to set. + * @return This builder for chaining. + */ + public Builder setDestinationFolderId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + destinationFolderId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * The path of the destination folder.
+     * 
+ * + * string destination_folder_id = 3; + * + * @return This builder for chaining. + */ + public Builder clearDestinationFolderId() { + destinationFolderId_ = getDefaultInstance().getDestinationFolderId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * The path of the destination folder.
+     * 
+ * + * string destination_folder_id = 3; + * + * @param value The bytes for destinationFolderId to set. + * @return This builder for chaining. + */ + public Builder setDestinationFolderIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + destinationFolderId_ = value; + bitField0_ |= 0x00000004; + 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.control.v2.RenameFolderMetadata) + } + + // @@protoc_insertion_point(class_scope:google.storage.control.v2.RenameFolderMetadata) + private static final com.google.storage.control.v2.RenameFolderMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.control.v2.RenameFolderMetadata(); + } + + public static com.google.storage.control.v2.RenameFolderMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RenameFolderMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.control.v2.RenameFolderMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/RenameFolderMetadataOrBuilder.java b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/RenameFolderMetadataOrBuilder.java new file mode 100644 index 0000000000..74488d03de --- /dev/null +++ b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/RenameFolderMetadataOrBuilder.java @@ -0,0 +1,111 @@ +/* + * Copyright 2023 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/control/v2/storage_control.proto + +package com.google.storage.control.v2; + +public interface RenameFolderMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.control.v2.RenameFolderMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Generic metadata for the long running operation.
+   * 
+ * + * .google.storage.control.v2.CommonLongRunningOperationMetadata common_metadata = 1; + * + * @return Whether the commonMetadata field is set. + */ + boolean hasCommonMetadata(); + /** + * + * + *
+   * Generic metadata for the long running operation.
+   * 
+ * + * .google.storage.control.v2.CommonLongRunningOperationMetadata common_metadata = 1; + * + * @return The commonMetadata. + */ + com.google.storage.control.v2.CommonLongRunningOperationMetadata getCommonMetadata(); + /** + * + * + *
+   * Generic metadata for the long running operation.
+   * 
+ * + * .google.storage.control.v2.CommonLongRunningOperationMetadata common_metadata = 1; + */ + com.google.storage.control.v2.CommonLongRunningOperationMetadataOrBuilder + getCommonMetadataOrBuilder(); + + /** + * + * + *
+   * The path of the source folder.
+   * 
+ * + * string source_folder_id = 2; + * + * @return The sourceFolderId. + */ + java.lang.String getSourceFolderId(); + /** + * + * + *
+   * The path of the source folder.
+   * 
+ * + * string source_folder_id = 2; + * + * @return The bytes for sourceFolderId. + */ + com.google.protobuf.ByteString getSourceFolderIdBytes(); + + /** + * + * + *
+   * The path of the destination folder.
+   * 
+ * + * string destination_folder_id = 3; + * + * @return The destinationFolderId. + */ + java.lang.String getDestinationFolderId(); + /** + * + * + *
+   * The path of the destination folder.
+   * 
+ * + * string destination_folder_id = 3; + * + * @return The bytes for destinationFolderId. + */ + com.google.protobuf.ByteString getDestinationFolderIdBytes(); +} diff --git a/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/RenameFolderRequest.java b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/RenameFolderRequest.java new file mode 100644 index 0000000000..d433e42ff2 --- /dev/null +++ b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/RenameFolderRequest.java @@ -0,0 +1,1310 @@ +/* + * Copyright 2023 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/control/v2/storage_control.proto + +package com.google.storage.control.v2; + +/** + * + * + *
+ * Request message for RenameFolder.
+ * 
+ * + * Protobuf type {@code google.storage.control.v2.RenameFolderRequest} + */ +public final class RenameFolderRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.control.v2.RenameFolderRequest) + RenameFolderRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use RenameFolderRequest.newBuilder() to construct. + private RenameFolderRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RenameFolderRequest() { + name_ = ""; + destinationFolderId_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RenameFolderRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_RenameFolderRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_RenameFolderRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.control.v2.RenameFolderRequest.class, + com.google.storage.control.v2.RenameFolderRequest.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Name of the source folder being renamed.
+   * Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
+   * 
+ * + * + * string name = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Name of the source folder being renamed.
+   * Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
+   * 
+ * + * + * string name = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESTINATION_FOLDER_ID_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object destinationFolderId_ = ""; + /** + * + * + *
+   * Required. The destination folder ID, e.g. `foo/bar/`.
+   * 
+ * + * string destination_folder_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The destinationFolderId. + */ + @java.lang.Override + public java.lang.String getDestinationFolderId() { + java.lang.Object ref = destinationFolderId_; + 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(); + destinationFolderId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The destination folder ID, e.g. `foo/bar/`.
+   * 
+ * + * string destination_folder_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for destinationFolderId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDestinationFolderIdBytes() { + java.lang.Object ref = destinationFolderId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destinationFolderId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IF_METAGENERATION_MATCH_FIELD_NUMBER = 4; + private long ifMetagenerationMatch_ = 0L; + /** + * + * + *
+   * Makes the operation only succeed conditional on whether the source
+   * folder's current metageneration matches the given value.
+   * 
+ * + * optional int64 if_metageneration_match = 4; + * + * @return Whether the ifMetagenerationMatch field is set. + */ + @java.lang.Override + public boolean hasIfMetagenerationMatch() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Makes the operation only succeed conditional on whether the source
+   * folder's current metageneration matches the given value.
+   * 
+ * + * optional int64 if_metageneration_match = 4; + * + * @return The ifMetagenerationMatch. + */ + @java.lang.Override + public long getIfMetagenerationMatch() { + return ifMetagenerationMatch_; + } + + public static final int IF_METAGENERATION_NOT_MATCH_FIELD_NUMBER = 5; + private long ifMetagenerationNotMatch_ = 0L; + /** + * + * + *
+   * Makes the operation only succeed conditional on whether the source
+   * folder's current metageneration does not match the given value.
+   * 
+ * + * optional int64 if_metageneration_not_match = 5; + * + * @return Whether the ifMetagenerationNotMatch field is set. + */ + @java.lang.Override + public boolean hasIfMetagenerationNotMatch() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Makes the operation only succeed conditional on whether the source
+   * folder's current metageneration does not match the given value.
+   * 
+ * + * optional int64 if_metageneration_not_match = 5; + * + * @return The ifMetagenerationNotMatch. + */ + @java.lang.Override + public long getIfMetagenerationNotMatch() { + return ifMetagenerationNotMatch_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. A unique identifier for this request. UUID is the recommended
+   * format, but other formats are still accepted. This request is only
+   * idempotent if a `request_id` is provided.
+   * 
+ * + * + * string request_id = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + 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(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. A unique identifier for this request. UUID is the recommended
+   * format, but other formats are still accepted. This request is only
+   * idempotent if a `request_id` is provided.
+   * 
+ * + * + * string request_id = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeInt64(4, ifMetagenerationMatch_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeInt64(5, ifMetagenerationNotMatch_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, requestId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(destinationFolderId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, destinationFolderId_); + } + getUnknownFields().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.computeInt64Size(4, ifMetagenerationMatch_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(5, ifMetagenerationNotMatch_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, requestId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(destinationFolderId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, destinationFolderId_); + } + size += getUnknownFields().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.control.v2.RenameFolderRequest)) { + return super.equals(obj); + } + com.google.storage.control.v2.RenameFolderRequest other = + (com.google.storage.control.v2.RenameFolderRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDestinationFolderId().equals(other.getDestinationFolderId())) 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 (!getRequestId().equals(other.getRequestId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + DESTINATION_FOLDER_ID_FIELD_NUMBER; + hash = (53 * hash) + getDestinationFolderId().hashCode(); + 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 = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.control.v2.RenameFolderRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.control.v2.RenameFolderRequest 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.control.v2.RenameFolderRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.control.v2.RenameFolderRequest 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.control.v2.RenameFolderRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.control.v2.RenameFolderRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.control.v2.RenameFolderRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.control.v2.RenameFolderRequest 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.control.v2.RenameFolderRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.control.v2.RenameFolderRequest 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.control.v2.RenameFolderRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.control.v2.RenameFolderRequest 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.control.v2.RenameFolderRequest 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 RenameFolder.
+   * 
+ * + * Protobuf type {@code google.storage.control.v2.RenameFolderRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.control.v2.RenameFolderRequest) + com.google.storage.control.v2.RenameFolderRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_RenameFolderRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_RenameFolderRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.control.v2.RenameFolderRequest.class, + com.google.storage.control.v2.RenameFolderRequest.Builder.class); + } + + // Construct using com.google.storage.control.v2.RenameFolderRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + destinationFolderId_ = ""; + ifMetagenerationMatch_ = 0L; + ifMetagenerationNotMatch_ = 0L; + requestId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_RenameFolderRequest_descriptor; + } + + @java.lang.Override + public com.google.storage.control.v2.RenameFolderRequest getDefaultInstanceForType() { + return com.google.storage.control.v2.RenameFolderRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.control.v2.RenameFolderRequest build() { + com.google.storage.control.v2.RenameFolderRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.control.v2.RenameFolderRequest buildPartial() { + com.google.storage.control.v2.RenameFolderRequest result = + new com.google.storage.control.v2.RenameFolderRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.storage.control.v2.RenameFolderRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.destinationFolderId_ = destinationFolderId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.ifMetagenerationMatch_ = ifMetagenerationMatch_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.ifMetagenerationNotMatch_ = ifMetagenerationNotMatch_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.requestId_ = requestId_; + } + result.bitField0_ |= to_bitField0_; + } + + @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.control.v2.RenameFolderRequest) { + return mergeFrom((com.google.storage.control.v2.RenameFolderRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.control.v2.RenameFolderRequest other) { + if (other == com.google.storage.control.v2.RenameFolderRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDestinationFolderId().isEmpty()) { + destinationFolderId_ = other.destinationFolderId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasIfMetagenerationMatch()) { + setIfMetagenerationMatch(other.getIfMetagenerationMatch()); + } + if (other.hasIfMetagenerationNotMatch()) { + setIfMetagenerationNotMatch(other.getIfMetagenerationNotMatch()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000010; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 32: + { + ifMetagenerationMatch_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 32 + case 40: + { + ifMetagenerationNotMatch_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 40 + case 50: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 50 + case 58: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 58 + case 66: + { + destinationFolderId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 66 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. Name of the source folder being renamed.
+     * Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
+     * 
+ * + * + * string name = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Name of the source folder being renamed.
+     * Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
+     * 
+ * + * + * string name = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Name of the source folder being renamed.
+     * Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
+     * 
+ * + * + * string name = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the source folder being renamed.
+     * Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
+     * 
+ * + * + * string name = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the source folder being renamed.
+     * Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
+     * 
+ * + * + * string name = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object destinationFolderId_ = ""; + /** + * + * + *
+     * Required. The destination folder ID, e.g. `foo/bar/`.
+     * 
+ * + * string destination_folder_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The destinationFolderId. + */ + public java.lang.String getDestinationFolderId() { + java.lang.Object ref = destinationFolderId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + destinationFolderId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The destination folder ID, e.g. `foo/bar/`.
+     * 
+ * + * string destination_folder_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for destinationFolderId. + */ + public com.google.protobuf.ByteString getDestinationFolderIdBytes() { + java.lang.Object ref = destinationFolderId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destinationFolderId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The destination folder ID, e.g. `foo/bar/`.
+     * 
+ * + * string destination_folder_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The destinationFolderId to set. + * @return This builder for chaining. + */ + public Builder setDestinationFolderId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + destinationFolderId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The destination folder ID, e.g. `foo/bar/`.
+     * 
+ * + * string destination_folder_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDestinationFolderId() { + destinationFolderId_ = getDefaultInstance().getDestinationFolderId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The destination folder ID, e.g. `foo/bar/`.
+     * 
+ * + * string destination_folder_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for destinationFolderId to set. + * @return This builder for chaining. + */ + public Builder setDestinationFolderIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + destinationFolderId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private long ifMetagenerationMatch_; + /** + * + * + *
+     * Makes the operation only succeed conditional on whether the source
+     * folder's current metageneration matches the given value.
+     * 
+ * + * optional int64 if_metageneration_match = 4; + * + * @return Whether the ifMetagenerationMatch field is set. + */ + @java.lang.Override + public boolean hasIfMetagenerationMatch() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Makes the operation only succeed conditional on whether the source
+     * folder's current metageneration matches the given value.
+     * 
+ * + * optional int64 if_metageneration_match = 4; + * + * @return The ifMetagenerationMatch. + */ + @java.lang.Override + public long getIfMetagenerationMatch() { + return ifMetagenerationMatch_; + } + /** + * + * + *
+     * Makes the operation only succeed conditional on whether the source
+     * folder's current metageneration matches the given value.
+     * 
+ * + * optional int64 if_metageneration_match = 4; + * + * @param value The ifMetagenerationMatch to set. + * @return This builder for chaining. + */ + public Builder setIfMetagenerationMatch(long value) { + + ifMetagenerationMatch_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Makes the operation only succeed conditional on whether the source
+     * folder's current metageneration matches the given value.
+     * 
+ * + * optional int64 if_metageneration_match = 4; + * + * @return This builder for chaining. + */ + public Builder clearIfMetagenerationMatch() { + bitField0_ = (bitField0_ & ~0x00000004); + ifMetagenerationMatch_ = 0L; + onChanged(); + return this; + } + + private long ifMetagenerationNotMatch_; + /** + * + * + *
+     * Makes the operation only succeed conditional on whether the source
+     * folder's current metageneration does not match the given value.
+     * 
+ * + * optional int64 if_metageneration_not_match = 5; + * + * @return Whether the ifMetagenerationNotMatch field is set. + */ + @java.lang.Override + public boolean hasIfMetagenerationNotMatch() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Makes the operation only succeed conditional on whether the source
+     * folder's current metageneration does not match the given value.
+     * 
+ * + * optional int64 if_metageneration_not_match = 5; + * + * @return The ifMetagenerationNotMatch. + */ + @java.lang.Override + public long getIfMetagenerationNotMatch() { + return ifMetagenerationNotMatch_; + } + /** + * + * + *
+     * Makes the operation only succeed conditional on whether the source
+     * folder's current metageneration does not match the given value.
+     * 
+ * + * optional int64 if_metageneration_not_match = 5; + * + * @param value The ifMetagenerationNotMatch to set. + * @return This builder for chaining. + */ + public Builder setIfMetagenerationNotMatch(long value) { + + ifMetagenerationNotMatch_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Makes the operation only succeed conditional on whether the source
+     * folder's current metageneration does not match the given value.
+     * 
+ * + * optional int64 if_metageneration_not_match = 5; + * + * @return This builder for chaining. + */ + public Builder clearIfMetagenerationNotMatch() { + bitField0_ = (bitField0_ & ~0x00000008); + ifMetagenerationNotMatch_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. A unique identifier for this request. UUID is the recommended
+     * format, but other formats are still accepted. This request is only
+     * idempotent if a `request_id` is provided.
+     * 
+ * + * + * string request_id = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. A unique identifier for this request. UUID is the recommended
+     * format, but other formats are still accepted. This request is only
+     * idempotent if a `request_id` is provided.
+     * 
+ * + * + * string request_id = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. A unique identifier for this request. UUID is the recommended
+     * format, but other formats are still accepted. This request is only
+     * idempotent if a `request_id` is provided.
+     * 
+ * + * + * string request_id = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + requestId_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A unique identifier for this request. UUID is the recommended
+     * format, but other formats are still accepted. This request is only
+     * idempotent if a `request_id` is provided.
+     * 
+ * + * + * string request_id = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A unique identifier for this request. UUID is the recommended
+     * format, but other formats are still accepted. This request is only
+     * idempotent if a `request_id` is provided.
+     * 
+ * + * + * string request_id = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + requestId_ = value; + bitField0_ |= 0x00000010; + 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.control.v2.RenameFolderRequest) + } + + // @@protoc_insertion_point(class_scope:google.storage.control.v2.RenameFolderRequest) + private static final com.google.storage.control.v2.RenameFolderRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.control.v2.RenameFolderRequest(); + } + + public static com.google.storage.control.v2.RenameFolderRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RenameFolderRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.control.v2.RenameFolderRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/RenameFolderRequestOrBuilder.java b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/RenameFolderRequestOrBuilder.java new file mode 100644 index 0000000000..2a0e9c4bdf --- /dev/null +++ b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/RenameFolderRequestOrBuilder.java @@ -0,0 +1,168 @@ +/* + * Copyright 2023 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/control/v2/storage_control.proto + +package com.google.storage.control.v2; + +public interface RenameFolderRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.control.v2.RenameFolderRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the source folder being renamed.
+   * Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
+   * 
+ * + * + * string name = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Name of the source folder being renamed.
+   * Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
+   * 
+ * + * + * string name = 7 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The destination folder ID, e.g. `foo/bar/`.
+   * 
+ * + * string destination_folder_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The destinationFolderId. + */ + java.lang.String getDestinationFolderId(); + /** + * + * + *
+   * Required. The destination folder ID, e.g. `foo/bar/`.
+   * 
+ * + * string destination_folder_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for destinationFolderId. + */ + com.google.protobuf.ByteString getDestinationFolderIdBytes(); + + /** + * + * + *
+   * Makes the operation only succeed conditional on whether the source
+   * folder's current metageneration matches the given value.
+   * 
+ * + * optional int64 if_metageneration_match = 4; + * + * @return Whether the ifMetagenerationMatch field is set. + */ + boolean hasIfMetagenerationMatch(); + /** + * + * + *
+   * Makes the operation only succeed conditional on whether the source
+   * folder's current metageneration matches the given value.
+   * 
+ * + * optional int64 if_metageneration_match = 4; + * + * @return The ifMetagenerationMatch. + */ + long getIfMetagenerationMatch(); + + /** + * + * + *
+   * Makes the operation only succeed conditional on whether the source
+   * folder's current metageneration does not match the given value.
+   * 
+ * + * optional int64 if_metageneration_not_match = 5; + * + * @return Whether the ifMetagenerationNotMatch field is set. + */ + boolean hasIfMetagenerationNotMatch(); + /** + * + * + *
+   * Makes the operation only succeed conditional on whether the source
+   * folder's current metageneration does not match the given value.
+   * 
+ * + * optional int64 if_metageneration_not_match = 5; + * + * @return The ifMetagenerationNotMatch. + */ + long getIfMetagenerationNotMatch(); + + /** + * + * + *
+   * Optional. A unique identifier for this request. UUID is the recommended
+   * format, but other formats are still accepted. This request is only
+   * idempotent if a `request_id` is provided.
+   * 
+ * + * + * string request_id = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. A unique identifier for this request. UUID is the recommended
+   * format, but other formats are still accepted. This request is only
+   * idempotent if a `request_id` is provided.
+   * 
+ * + * + * string request_id = 6 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/StorageControlProto.java b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/StorageControlProto.java new file mode 100644 index 0000000000..541ecd4c24 --- /dev/null +++ b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/StorageControlProto.java @@ -0,0 +1,392 @@ +/* + * Copyright 2023 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/control/v2/storage_control.proto + +package com.google.storage.control.v2; + +public final class StorageControlProto { + private StorageControlProto() {} + + 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_control_v2_PendingRenameInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_control_v2_PendingRenameInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_control_v2_Folder_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_control_v2_Folder_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_control_v2_GetFolderRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_control_v2_GetFolderRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_control_v2_CreateFolderRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_control_v2_CreateFolderRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_control_v2_DeleteFolderRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_control_v2_DeleteFolderRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_control_v2_ListFoldersRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_control_v2_ListFoldersRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_control_v2_ListFoldersResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_control_v2_ListFoldersResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_control_v2_RenameFolderRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_control_v2_RenameFolderRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_control_v2_CommonLongRunningOperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_control_v2_CommonLongRunningOperationMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_control_v2_RenameFolderMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_control_v2_RenameFolderMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_control_v2_StorageLayout_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_control_v2_StorageLayout_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_control_v2_StorageLayout_CustomPlacementConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_control_v2_StorageLayout_CustomPlacementConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_control_v2_StorageLayout_HierarchicalNamespace_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_control_v2_StorageLayout_HierarchicalNamespace_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_storage_control_v2_GetStorageLayoutRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_storage_control_v2_GetStorageLayoutRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n/google/storage/control/v2/storage_cont" + + "rol.proto\022\031google.storage.control.v2\032\027go" + + "ogle/api/client.proto\032\037google/api/field_" + + "behavior.proto\032\033google/api/field_info.pr" + + "oto\032\031google/api/resource.proto\032\030google/a" + + "pi/routing.proto\032#google/longrunning/ope" + + "rations.proto\032\033google/protobuf/empty.pro" + + "to\032\037google/protobuf/timestamp.proto\",\n\021P" + + "endingRenameInfo\022\027\n\toperation\030\001 \001(\tB\004\342A\001" + + "\003\"\347\002\n\006Folder\022\022\n\004name\030\001 \001(\tB\004\342A\001\010\022\034\n\016meta" + + "generation\030\003 \001(\003B\004\342A\001\003\0225\n\013create_time\030\004 " + + "\001(\0132\032.google.protobuf.TimestampB\004\342A\001\003\0225\n" + + "\013update_time\030\005 \001(\0132\032.google.protobuf.Tim" + + "estampB\004\342A\001\003\022O\n\023pending_rename_info\030\007 \001(" + + "\0132,.google.storage.control.v2.PendingRen" + + "ameInfoB\004\342A\001\003:l\352Ai\n\035storage.googleapis.c" + + "om/Folder\0227projects/{project}/buckets/{b" + + "ucket}/folders/{folder=**}*\007folders2\006fol" + + "der\"\366\001\n\020GetFolderRequest\0224\n\004name\030\006 \001(\tB&" + + "\342A\001\002\372A\037\n\035storage.googleapis.com/Folder\022$" + + "\n\027if_metageneration_match\030\003 \001(\003H\000\210\001\001\022(\n\033" + + "if_metageneration_not_match\030\004 \001(\003H\001\210\001\001\022 " + + "\n\nrequest_id\030\005 \001(\tB\014\342A\001\001\342\214\317\327\010\002\010\001B\032\n\030_if_" + + "metageneration_matchB\036\n\034_if_metagenerati" + + "on_not_match\"\332\001\n\023CreateFolderRequest\0226\n\006" + + "parent\030\001 \001(\tB&\342A\001\002\372A\037\022\035storage.googleapi" + + "s.com/Folder\0227\n\006folder\030\002 \001(\0132!.google.st" + + "orage.control.v2.FolderB\004\342A\001\002\022\027\n\tfolder_" + + "id\030\003 \001(\tB\004\342A\001\002\022\027\n\trecursive\030\004 \001(\010B\004\342A\001\001\022" + + " \n\nrequest_id\030\005 \001(\tB\014\342A\001\001\342\214\317\327\010\002\010\001\"\371\001\n\023De" + + "leteFolderRequest\0224\n\004name\030\006 \001(\tB&\342A\001\002\372A\037" + + "\n\035storage.googleapis.com/Folder\022$\n\027if_me" + + "tageneration_match\030\003 \001(\003H\000\210\001\001\022(\n\033if_meta" + + "generation_not_match\030\004 \001(\003H\001\210\001\001\022 \n\nreque" + + "st_id\030\005 \001(\tB\014\342A\001\001\342\214\317\327\010\002\010\001B\032\n\030_if_metagen" + + "eration_matchB\036\n\034_if_metageneration_not_" + + "match\"\224\002\n\022ListFoldersRequest\0226\n\006parent\030\001" + + " \001(\tB&\342A\001\002\372A\037\022\035storage.googleapis.com/Fo" + + "lder\022\027\n\tpage_size\030\002 \001(\005B\004\342A\001\001\022\030\n\npage_to" + + "ken\030\003 \001(\tB\004\342A\001\001\022\024\n\006prefix\030\004 \001(\tB\004\342A\001\001\022\027\n" + + "\tdelimiter\030\010 \001(\tB\004\342A\001\001\022!\n\023lexicographic_" + + "start\030\006 \001(\tB\004\342A\001\001\022\037\n\021lexicographic_end\030\007" + + " \001(\tB\004\342A\001\001\022 \n\nrequest_id\030\t \001(\tB\014\342A\001\001\342\214\317\327" + + "\010\002\010\001\"b\n\023ListFoldersResponse\0222\n\007folders\030\001" + + " \003(\0132!.google.storage.control.v2.Folder\022" + + "\027\n\017next_page_token\030\002 \001(\t\"\236\002\n\023RenameFolde" + + "rRequest\0224\n\004name\030\007 \001(\tB&\342A\001\002\372A\037\n\035storage" + + ".googleapis.com/Folder\022#\n\025destination_fo" + + "lder_id\030\010 \001(\tB\004\342A\001\002\022$\n\027if_metageneration" + + "_match\030\004 \001(\003H\000\210\001\001\022(\n\033if_metageneration_n" + + "ot_match\030\005 \001(\003H\001\210\001\001\022 \n\nrequest_id\030\006 \001(\tB" + + "\014\342A\001\001\342\214\317\327\010\002\010\001B\032\n\030_if_metageneration_matc" + + "hB\036\n\034_if_metageneration_not_match\"\240\002\n\"Co" + + "mmonLongRunningOperationMetadata\0225\n\013crea" + + "te_time\030\001 \001(\0132\032.google.protobuf.Timestam" + + "pB\004\342A\001\003\0222\n\010end_time\030\002 \001(\0132\032.google.proto" + + "buf.TimestampB\004\342A\001\003\0225\n\013update_time\030\003 \001(\013" + + "2\032.google.protobuf.TimestampB\004\342A\001\003\022\022\n\004ty" + + "pe\030\004 \001(\tB\004\342A\001\003\022$\n\026requested_cancellation" + + "\030\005 \001(\010B\004\342A\001\003\022\036\n\020progress_percent\030\006 \001(\005B\004" + + "\342A\001\003\"\247\001\n\024RenameFolderMetadata\022V\n\017common_" + + "metadata\030\001 \001(\0132=.google.storage.control." + + "v2.CommonLongRunningOperationMetadata\022\030\n" + + "\020source_folder_id\030\002 \001(\t\022\035\n\025destination_f" + + "older_id\030\003 \001(\t\"\336\003\n\rStorageLayout\022\022\n\004name" + + "\030\001 \001(\tB\004\342A\001\003\022\026\n\010location\030\002 \001(\tB\004\342A\001\003\022\033\n\r" + + "location_type\030\003 \001(\tB\004\342A\001\003\022e\n\027custom_plac" + + "ement_config\030\004 \001(\0132>.google.storage.cont" + + "rol.v2.StorageLayout.CustomPlacementConf" + + "igB\004\342A\001\003\022d\n\026hierarchical_namespace\030\005 \001(\013" + + "2>.google.storage.control.v2.StorageLayo" + + "ut.HierarchicalNamespaceB\004\342A\001\003\032/\n\025Custom" + + "PlacementConfig\022\026\n\016data_locations\030\001 \003(\t\032" + + "(\n\025HierarchicalNamespace\022\017\n\007enabled\030\001 \001(" + + "\010:\\\352AY\n$storage.googleapis.com/StorageLa" + + "yout\0221projects/{project}/buckets/{bucket" + + "}/storageLayout\"\210\001\n\027GetStorageLayoutRequ" + + "est\022;\n\004name\030\001 \001(\tB-\342A\001\002\372A&\n$storage.goog" + + "leapis.com/StorageLayout\022\016\n\006prefix\030\002 \001(\t" + + "\022 \n\nrequest_id\030\003 \001(\tB\014\342A\001\001\342\214\317\327\010\002\010\0012\223\n\n\016S" + + "torageControl\022\232\001\n\014CreateFolder\022..google." + + "storage.control.v2.CreateFolderRequest\032!" + + ".google.storage.control.v2.Folder\"7\332A\027pa" + + "rent,folder,folder_id\212\323\344\223\002\027\022\025\n\006parent\022\013{" + + "bucket=**}\022\217\001\n\014DeleteFolder\022..google.sto" + + "rage.control.v2.DeleteFolderRequest\032\026.go" + + "ogle.protobuf.Empty\"7\332A\004name\212\323\344\223\002*\022(\n\004na" + + "me\022 {bucket=projects/*/buckets/*}/**\022\224\001\n" + + "\tGetFolder\022+.google.storage.control.v2.G" + + "etFolderRequest\032!.google.storage.control" + + ".v2.Folder\"7\332A\004name\212\323\344\223\002*\022(\n\004name\022 {buck" + + "et=projects/*/buckets/*}/**\022\224\001\n\013ListFold" + + "ers\022-.google.storage.control.v2.ListFold" + + "ersRequest\032..google.storage.control.v2.L" + + "istFoldersResponse\"&\332A\006parent\212\323\344\223\002\027\022\025\n\006p" + + "arent\022\013{bucket=**}\022\315\001\n\014RenameFolder\022..go" + + "ogle.storage.control.v2.RenameFolderRequ" + + "est\032\035.google.longrunning.Operation\"n\312A\036\n" + + "\006Folder\022\024RenameFolderMetadata\332A\032name,des" + + "tination_folder_id\212\323\344\223\002*\022(\n\004name\022 {bucke" + + "t=projects/*/buckets/*}/**\022\251\001\n\020GetStorag" + + "eLayout\0222.google.storage.control.v2.GetS" + + "torageLayoutRequest\032(.google.storage.con" + + "trol.v2.StorageLayout\"7\332A\004name\212\323\344\223\002*\022(\n\004" + + "name\022 {bucket=projects/*/buckets/*}/**\032\247" + + "\002\312A\026storage.googleapis.com\322A\212\002https://ww" + + "w.googleapis.com/auth/cloud-platform,htt" + + "ps://www.googleapis.com/auth/cloud-platf" + + "orm.read-only,https://www.googleapis.com" + + "/auth/devstorage.full_control,https://ww" + + "w.googleapis.com/auth/devstorage.read_on" + + "ly,https://www.googleapis.com/auth/devst" + + "orage.read_writeB\312\001\n\035com.google.storage." + + "control.v2B\023StorageControlProtoP\001ZKcloud" + + ".google.com/go/storage/control/apiv2/sto" + + "ragecontrolpb;storagecontrolpb\352AD\n\035stora" + + "ge.googleapis.com/Bucket\022#projects/{proj" + + "ect}/buckets/{bucket}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.FieldInfoProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.api.RoutingProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_storage_control_v2_PendingRenameInfo_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_storage_control_v2_PendingRenameInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_control_v2_PendingRenameInfo_descriptor, + new java.lang.String[] { + "Operation", + }); + internal_static_google_storage_control_v2_Folder_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_storage_control_v2_Folder_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_control_v2_Folder_descriptor, + new java.lang.String[] { + "Name", "Metageneration", "CreateTime", "UpdateTime", "PendingRenameInfo", + }); + internal_static_google_storage_control_v2_GetFolderRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_storage_control_v2_GetFolderRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_control_v2_GetFolderRequest_descriptor, + new java.lang.String[] { + "Name", + "IfMetagenerationMatch", + "IfMetagenerationNotMatch", + "RequestId", + "IfMetagenerationMatch", + "IfMetagenerationNotMatch", + }); + internal_static_google_storage_control_v2_CreateFolderRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_storage_control_v2_CreateFolderRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_control_v2_CreateFolderRequest_descriptor, + new java.lang.String[] { + "Parent", "Folder", "FolderId", "Recursive", "RequestId", + }); + internal_static_google_storage_control_v2_DeleteFolderRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_storage_control_v2_DeleteFolderRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_control_v2_DeleteFolderRequest_descriptor, + new java.lang.String[] { + "Name", + "IfMetagenerationMatch", + "IfMetagenerationNotMatch", + "RequestId", + "IfMetagenerationMatch", + "IfMetagenerationNotMatch", + }); + internal_static_google_storage_control_v2_ListFoldersRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_storage_control_v2_ListFoldersRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_control_v2_ListFoldersRequest_descriptor, + new java.lang.String[] { + "Parent", + "PageSize", + "PageToken", + "Prefix", + "Delimiter", + "LexicographicStart", + "LexicographicEnd", + "RequestId", + }); + internal_static_google_storage_control_v2_ListFoldersResponse_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_storage_control_v2_ListFoldersResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_control_v2_ListFoldersResponse_descriptor, + new java.lang.String[] { + "Folders", "NextPageToken", + }); + internal_static_google_storage_control_v2_RenameFolderRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_storage_control_v2_RenameFolderRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_control_v2_RenameFolderRequest_descriptor, + new java.lang.String[] { + "Name", + "DestinationFolderId", + "IfMetagenerationMatch", + "IfMetagenerationNotMatch", + "RequestId", + "IfMetagenerationMatch", + "IfMetagenerationNotMatch", + }); + internal_static_google_storage_control_v2_CommonLongRunningOperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_storage_control_v2_CommonLongRunningOperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_control_v2_CommonLongRunningOperationMetadata_descriptor, + new java.lang.String[] { + "CreateTime", + "EndTime", + "UpdateTime", + "Type", + "RequestedCancellation", + "ProgressPercent", + }); + internal_static_google_storage_control_v2_RenameFolderMetadata_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_storage_control_v2_RenameFolderMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_control_v2_RenameFolderMetadata_descriptor, + new java.lang.String[] { + "CommonMetadata", "SourceFolderId", "DestinationFolderId", + }); + internal_static_google_storage_control_v2_StorageLayout_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_storage_control_v2_StorageLayout_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_control_v2_StorageLayout_descriptor, + new java.lang.String[] { + "Name", "Location", "LocationType", "CustomPlacementConfig", "HierarchicalNamespace", + }); + internal_static_google_storage_control_v2_StorageLayout_CustomPlacementConfig_descriptor = + internal_static_google_storage_control_v2_StorageLayout_descriptor.getNestedTypes().get(0); + internal_static_google_storage_control_v2_StorageLayout_CustomPlacementConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_control_v2_StorageLayout_CustomPlacementConfig_descriptor, + new java.lang.String[] { + "DataLocations", + }); + internal_static_google_storage_control_v2_StorageLayout_HierarchicalNamespace_descriptor = + internal_static_google_storage_control_v2_StorageLayout_descriptor.getNestedTypes().get(1); + internal_static_google_storage_control_v2_StorageLayout_HierarchicalNamespace_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_control_v2_StorageLayout_HierarchicalNamespace_descriptor, + new java.lang.String[] { + "Enabled", + }); + internal_static_google_storage_control_v2_GetStorageLayoutRequest_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_storage_control_v2_GetStorageLayoutRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_storage_control_v2_GetStorageLayoutRequest_descriptor, + new java.lang.String[] { + "Name", "Prefix", "RequestId", + }); + 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.FieldInfoProto.fieldInfo); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceDefinition); + registry.add(com.google.api.ResourceProto.resourceReference); + registry.add(com.google.api.RoutingProto.routing); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.FieldInfoProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.api.RoutingProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/StorageLayout.java b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/StorageLayout.java new file mode 100644 index 0000000000..0de1813c81 --- /dev/null +++ b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/StorageLayout.java @@ -0,0 +1,2962 @@ +/* + * Copyright 2023 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/control/v2/storage_control.proto + +package com.google.storage.control.v2; + +/** + * + * + *
+ * The storage layout configuration of a bucket.
+ * 
+ * + * Protobuf type {@code google.storage.control.v2.StorageLayout} + */ +public final class StorageLayout extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.control.v2.StorageLayout) + StorageLayoutOrBuilder { + private static final long serialVersionUID = 0L; + // Use StorageLayout.newBuilder() to construct. + private StorageLayout(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StorageLayout() { + name_ = ""; + location_ = ""; + locationType_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StorageLayout(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_StorageLayout_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_StorageLayout_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.control.v2.StorageLayout.class, + com.google.storage.control.v2.StorageLayout.Builder.class); + } + + public interface CustomPlacementConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.control.v2.StorageLayout.CustomPlacementConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * List of locations to use for data placement.
+     * 
+ * + * repeated string data_locations = 1; + * + * @return A list containing the dataLocations. + */ + java.util.List getDataLocationsList(); + /** + * + * + *
+     * List of locations to use for data placement.
+     * 
+ * + * repeated string data_locations = 1; + * + * @return The count of dataLocations. + */ + int getDataLocationsCount(); + /** + * + * + *
+     * List of locations to use for data placement.
+     * 
+ * + * repeated string data_locations = 1; + * + * @param index The index of the element to return. + * @return The dataLocations at the given index. + */ + java.lang.String getDataLocations(int index); + /** + * + * + *
+     * List of locations to use for data placement.
+     * 
+ * + * repeated string data_locations = 1; + * + * @param index The index of the value to return. + * @return The bytes of the dataLocations at the given index. + */ + com.google.protobuf.ByteString getDataLocationsBytes(int index); + } + /** + * + * + *
+   * Configuration for Custom Dual Regions.  It should specify precisely two
+   * eligible regions within the same Multiregion. More information on regions
+   * may be found [https://cloud.google.com/storage/docs/locations][here].
+   * 
+ * + * Protobuf type {@code google.storage.control.v2.StorageLayout.CustomPlacementConfig} + */ + public static final class CustomPlacementConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.control.v2.StorageLayout.CustomPlacementConfig) + CustomPlacementConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use CustomPlacementConfig.newBuilder() to construct. + private CustomPlacementConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CustomPlacementConfig() { + dataLocations_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CustomPlacementConfig(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_StorageLayout_CustomPlacementConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_StorageLayout_CustomPlacementConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.control.v2.StorageLayout.CustomPlacementConfig.class, + com.google.storage.control.v2.StorageLayout.CustomPlacementConfig.Builder.class); + } + + public static final int DATA_LOCATIONS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList dataLocations_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+     * List of locations to use for data placement.
+     * 
+ * + * repeated string data_locations = 1; + * + * @return A list containing the dataLocations. + */ + public com.google.protobuf.ProtocolStringList getDataLocationsList() { + return dataLocations_; + } + /** + * + * + *
+     * List of locations to use for data placement.
+     * 
+ * + * repeated string data_locations = 1; + * + * @return The count of dataLocations. + */ + public int getDataLocationsCount() { + return dataLocations_.size(); + } + /** + * + * + *
+     * List of locations to use for data placement.
+     * 
+ * + * repeated string data_locations = 1; + * + * @param index The index of the element to return. + * @return The dataLocations at the given index. + */ + public java.lang.String getDataLocations(int index) { + return dataLocations_.get(index); + } + /** + * + * + *
+     * List of locations to use for data placement.
+     * 
+ * + * repeated string data_locations = 1; + * + * @param index The index of the value to return. + * @return The bytes of the dataLocations at the given index. + */ + public com.google.protobuf.ByteString getDataLocationsBytes(int index) { + return dataLocations_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < dataLocations_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, dataLocations_.getRaw(i)); + } + getUnknownFields().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 < dataLocations_.size(); i++) { + dataSize += computeStringSizeNoTag(dataLocations_.getRaw(i)); + } + size += dataSize; + size += 1 * getDataLocationsList().size(); + } + size += getUnknownFields().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.control.v2.StorageLayout.CustomPlacementConfig)) { + return super.equals(obj); + } + com.google.storage.control.v2.StorageLayout.CustomPlacementConfig other = + (com.google.storage.control.v2.StorageLayout.CustomPlacementConfig) obj; + + if (!getDataLocationsList().equals(other.getDataLocationsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getDataLocationsCount() > 0) { + hash = (37 * hash) + DATA_LOCATIONS_FIELD_NUMBER; + hash = (53 * hash) + getDataLocationsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.control.v2.StorageLayout.CustomPlacementConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.control.v2.StorageLayout.CustomPlacementConfig 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.control.v2.StorageLayout.CustomPlacementConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.control.v2.StorageLayout.CustomPlacementConfig 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.control.v2.StorageLayout.CustomPlacementConfig parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.control.v2.StorageLayout.CustomPlacementConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.control.v2.StorageLayout.CustomPlacementConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.control.v2.StorageLayout.CustomPlacementConfig 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.control.v2.StorageLayout.CustomPlacementConfig + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.control.v2.StorageLayout.CustomPlacementConfig + 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.control.v2.StorageLayout.CustomPlacementConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.control.v2.StorageLayout.CustomPlacementConfig 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.control.v2.StorageLayout.CustomPlacementConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Configuration for Custom Dual Regions.  It should specify precisely two
+     * eligible regions within the same Multiregion. More information on regions
+     * may be found [https://cloud.google.com/storage/docs/locations][here].
+     * 
+ * + * Protobuf type {@code google.storage.control.v2.StorageLayout.CustomPlacementConfig} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.control.v2.StorageLayout.CustomPlacementConfig) + com.google.storage.control.v2.StorageLayout.CustomPlacementConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_StorageLayout_CustomPlacementConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_StorageLayout_CustomPlacementConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.control.v2.StorageLayout.CustomPlacementConfig.class, + com.google.storage.control.v2.StorageLayout.CustomPlacementConfig.Builder.class); + } + + // Construct using + // com.google.storage.control.v2.StorageLayout.CustomPlacementConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + dataLocations_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_StorageLayout_CustomPlacementConfig_descriptor; + } + + @java.lang.Override + public com.google.storage.control.v2.StorageLayout.CustomPlacementConfig + getDefaultInstanceForType() { + return com.google.storage.control.v2.StorageLayout.CustomPlacementConfig + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.control.v2.StorageLayout.CustomPlacementConfig build() { + com.google.storage.control.v2.StorageLayout.CustomPlacementConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.control.v2.StorageLayout.CustomPlacementConfig buildPartial() { + com.google.storage.control.v2.StorageLayout.CustomPlacementConfig result = + new com.google.storage.control.v2.StorageLayout.CustomPlacementConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.storage.control.v2.StorageLayout.CustomPlacementConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + dataLocations_.makeImmutable(); + result.dataLocations_ = dataLocations_; + } + } + + @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.control.v2.StorageLayout.CustomPlacementConfig) { + return mergeFrom( + (com.google.storage.control.v2.StorageLayout.CustomPlacementConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.storage.control.v2.StorageLayout.CustomPlacementConfig other) { + if (other + == com.google.storage.control.v2.StorageLayout.CustomPlacementConfig + .getDefaultInstance()) return this; + if (!other.dataLocations_.isEmpty()) { + if (dataLocations_.isEmpty()) { + dataLocations_ = other.dataLocations_; + bitField0_ |= 0x00000001; + } else { + ensureDataLocationsIsMutable(); + dataLocations_.addAll(other.dataLocations_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + 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(); + ensureDataLocationsIsMutable(); + dataLocations_.add(s); + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringArrayList dataLocations_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureDataLocationsIsMutable() { + if (!dataLocations_.isModifiable()) { + dataLocations_ = new com.google.protobuf.LazyStringArrayList(dataLocations_); + } + bitField0_ |= 0x00000001; + } + /** + * + * + *
+       * List of locations to use for data placement.
+       * 
+ * + * repeated string data_locations = 1; + * + * @return A list containing the dataLocations. + */ + public com.google.protobuf.ProtocolStringList getDataLocationsList() { + dataLocations_.makeImmutable(); + return dataLocations_; + } + /** + * + * + *
+       * List of locations to use for data placement.
+       * 
+ * + * repeated string data_locations = 1; + * + * @return The count of dataLocations. + */ + public int getDataLocationsCount() { + return dataLocations_.size(); + } + /** + * + * + *
+       * List of locations to use for data placement.
+       * 
+ * + * repeated string data_locations = 1; + * + * @param index The index of the element to return. + * @return The dataLocations at the given index. + */ + public java.lang.String getDataLocations(int index) { + return dataLocations_.get(index); + } + /** + * + * + *
+       * List of locations to use for data placement.
+       * 
+ * + * repeated string data_locations = 1; + * + * @param index The index of the value to return. + * @return The bytes of the dataLocations at the given index. + */ + public com.google.protobuf.ByteString getDataLocationsBytes(int index) { + return dataLocations_.getByteString(index); + } + /** + * + * + *
+       * List of locations to use for data placement.
+       * 
+ * + * repeated string data_locations = 1; + * + * @param index The index to set the value at. + * @param value The dataLocations to set. + * @return This builder for chaining. + */ + public Builder setDataLocations(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDataLocationsIsMutable(); + dataLocations_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * List of locations to use for data placement.
+       * 
+ * + * repeated string data_locations = 1; + * + * @param value The dataLocations to add. + * @return This builder for chaining. + */ + public Builder addDataLocations(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDataLocationsIsMutable(); + dataLocations_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * List of locations to use for data placement.
+       * 
+ * + * repeated string data_locations = 1; + * + * @param values The dataLocations to add. + * @return This builder for chaining. + */ + public Builder addAllDataLocations(java.lang.Iterable values) { + ensureDataLocationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, dataLocations_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * List of locations to use for data placement.
+       * 
+ * + * repeated string data_locations = 1; + * + * @return This builder for chaining. + */ + public Builder clearDataLocations() { + dataLocations_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + ; + onChanged(); + return this; + } + /** + * + * + *
+       * List of locations to use for data placement.
+       * 
+ * + * repeated string data_locations = 1; + * + * @param value The bytes of the dataLocations to add. + * @return This builder for chaining. + */ + public Builder addDataLocationsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureDataLocationsIsMutable(); + dataLocations_.add(value); + bitField0_ |= 0x00000001; + 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.control.v2.StorageLayout.CustomPlacementConfig) + } + + // @@protoc_insertion_point(class_scope:google.storage.control.v2.StorageLayout.CustomPlacementConfig) + private static final com.google.storage.control.v2.StorageLayout.CustomPlacementConfig + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.control.v2.StorageLayout.CustomPlacementConfig(); + } + + public static com.google.storage.control.v2.StorageLayout.CustomPlacementConfig + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CustomPlacementConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.control.v2.StorageLayout.CustomPlacementConfig + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface HierarchicalNamespaceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.control.v2.StorageLayout.HierarchicalNamespace) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Enables the hierarchical namespace feature.
+     * 
+ * + * bool enabled = 1; + * + * @return The enabled. + */ + boolean getEnabled(); + } + /** + * + * + *
+   * Configuration for a bucket's hierarchical namespace feature.
+   * 
+ * + * Protobuf type {@code google.storage.control.v2.StorageLayout.HierarchicalNamespace} + */ + public static final class HierarchicalNamespace extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.storage.control.v2.StorageLayout.HierarchicalNamespace) + HierarchicalNamespaceOrBuilder { + private static final long serialVersionUID = 0L; + // Use HierarchicalNamespace.newBuilder() to construct. + private HierarchicalNamespace(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private HierarchicalNamespace() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new HierarchicalNamespace(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_StorageLayout_HierarchicalNamespace_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_StorageLayout_HierarchicalNamespace_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.control.v2.StorageLayout.HierarchicalNamespace.class, + com.google.storage.control.v2.StorageLayout.HierarchicalNamespace.Builder.class); + } + + public static final int ENABLED_FIELD_NUMBER = 1; + private boolean enabled_ = false; + /** + * + * + *
+     * Enables the hierarchical namespace feature.
+     * 
+ * + * 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_); + } + getUnknownFields().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 += getUnknownFields().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.control.v2.StorageLayout.HierarchicalNamespace)) { + return super.equals(obj); + } + com.google.storage.control.v2.StorageLayout.HierarchicalNamespace other = + (com.google.storage.control.v2.StorageLayout.HierarchicalNamespace) obj; + + if (getEnabled() != other.getEnabled()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.control.v2.StorageLayout.HierarchicalNamespace parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.control.v2.StorageLayout.HierarchicalNamespace 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.control.v2.StorageLayout.HierarchicalNamespace parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.control.v2.StorageLayout.HierarchicalNamespace 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.control.v2.StorageLayout.HierarchicalNamespace parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.control.v2.StorageLayout.HierarchicalNamespace parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.control.v2.StorageLayout.HierarchicalNamespace parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.control.v2.StorageLayout.HierarchicalNamespace 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.control.v2.StorageLayout.HierarchicalNamespace + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.control.v2.StorageLayout.HierarchicalNamespace + 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.control.v2.StorageLayout.HierarchicalNamespace parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.control.v2.StorageLayout.HierarchicalNamespace 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.control.v2.StorageLayout.HierarchicalNamespace prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Configuration for a bucket's hierarchical namespace feature.
+     * 
+ * + * Protobuf type {@code google.storage.control.v2.StorageLayout.HierarchicalNamespace} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.control.v2.StorageLayout.HierarchicalNamespace) + com.google.storage.control.v2.StorageLayout.HierarchicalNamespaceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_StorageLayout_HierarchicalNamespace_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_StorageLayout_HierarchicalNamespace_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.control.v2.StorageLayout.HierarchicalNamespace.class, + com.google.storage.control.v2.StorageLayout.HierarchicalNamespace.Builder.class); + } + + // Construct using + // com.google.storage.control.v2.StorageLayout.HierarchicalNamespace.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + enabled_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_StorageLayout_HierarchicalNamespace_descriptor; + } + + @java.lang.Override + public com.google.storage.control.v2.StorageLayout.HierarchicalNamespace + getDefaultInstanceForType() { + return com.google.storage.control.v2.StorageLayout.HierarchicalNamespace + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.control.v2.StorageLayout.HierarchicalNamespace build() { + com.google.storage.control.v2.StorageLayout.HierarchicalNamespace result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.control.v2.StorageLayout.HierarchicalNamespace buildPartial() { + com.google.storage.control.v2.StorageLayout.HierarchicalNamespace result = + new com.google.storage.control.v2.StorageLayout.HierarchicalNamespace(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.storage.control.v2.StorageLayout.HierarchicalNamespace result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.enabled_ = enabled_; + } + } + + @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.control.v2.StorageLayout.HierarchicalNamespace) { + return mergeFrom( + (com.google.storage.control.v2.StorageLayout.HierarchicalNamespace) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.storage.control.v2.StorageLayout.HierarchicalNamespace other) { + if (other + == com.google.storage.control.v2.StorageLayout.HierarchicalNamespace + .getDefaultInstance()) return this; + if (other.getEnabled() != false) { + setEnabled(other.getEnabled()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + enabled_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private boolean enabled_; + /** + * + * + *
+       * Enables the hierarchical namespace feature.
+       * 
+ * + * bool enabled = 1; + * + * @return The enabled. + */ + @java.lang.Override + public boolean getEnabled() { + return enabled_; + } + /** + * + * + *
+       * Enables the hierarchical namespace feature.
+       * 
+ * + * bool enabled = 1; + * + * @param value The enabled to set. + * @return This builder for chaining. + */ + public Builder setEnabled(boolean value) { + + enabled_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Enables the hierarchical namespace feature.
+       * 
+ * + * bool enabled = 1; + * + * @return This builder for chaining. + */ + public Builder clearEnabled() { + bitField0_ = (bitField0_ & ~0x00000001); + 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.control.v2.StorageLayout.HierarchicalNamespace) + } + + // @@protoc_insertion_point(class_scope:google.storage.control.v2.StorageLayout.HierarchicalNamespace) + private static final com.google.storage.control.v2.StorageLayout.HierarchicalNamespace + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.control.v2.StorageLayout.HierarchicalNamespace(); + } + + public static com.google.storage.control.v2.StorageLayout.HierarchicalNamespace + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public HierarchicalNamespace parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.control.v2.StorageLayout.HierarchicalNamespace + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Output only. The name of the StorageLayout resource.
+   * Format: `projects/{project}/buckets/{bucket}/storageLayout`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+   * Output only. The name of the StorageLayout resource.
+   * Format: `projects/{project}/buckets/{bucket}/storageLayout`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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 LOCATION_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object location_ = ""; + /** + * + * + *
+   * Output only. The location of the bucket.
+   * 
+ * + * string location = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+   * Output only. The location of the bucket.
+   * 
+ * + * string location = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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 = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object locationType_ = ""; + /** + * + * + *
+   * Output only. The location type of the bucket (region, dual-region,
+   * multi-region, etc).
+   * 
+ * + * string location_type = 3 [(.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 = 3 [(.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 CUSTOM_PLACEMENT_CONFIG_FIELD_NUMBER = 4; + private com.google.storage.control.v2.StorageLayout.CustomPlacementConfig customPlacementConfig_; + /** + * + * + *
+   * Output only. The data placement configuration for custom dual region. If
+   * there is no configuration, this is not a custom dual region bucket.
+   * 
+ * + * + * .google.storage.control.v2.StorageLayout.CustomPlacementConfig custom_placement_config = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the customPlacementConfig field is set. + */ + @java.lang.Override + public boolean hasCustomPlacementConfig() { + return customPlacementConfig_ != null; + } + /** + * + * + *
+   * Output only. The data placement configuration for custom dual region. If
+   * there is no configuration, this is not a custom dual region bucket.
+   * 
+ * + * + * .google.storage.control.v2.StorageLayout.CustomPlacementConfig custom_placement_config = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The customPlacementConfig. + */ + @java.lang.Override + public com.google.storage.control.v2.StorageLayout.CustomPlacementConfig + getCustomPlacementConfig() { + return customPlacementConfig_ == null + ? com.google.storage.control.v2.StorageLayout.CustomPlacementConfig.getDefaultInstance() + : customPlacementConfig_; + } + /** + * + * + *
+   * Output only. The data placement configuration for custom dual region. If
+   * there is no configuration, this is not a custom dual region bucket.
+   * 
+ * + * + * .google.storage.control.v2.StorageLayout.CustomPlacementConfig custom_placement_config = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.storage.control.v2.StorageLayout.CustomPlacementConfigOrBuilder + getCustomPlacementConfigOrBuilder() { + return customPlacementConfig_ == null + ? com.google.storage.control.v2.StorageLayout.CustomPlacementConfig.getDefaultInstance() + : customPlacementConfig_; + } + + public static final int HIERARCHICAL_NAMESPACE_FIELD_NUMBER = 5; + private com.google.storage.control.v2.StorageLayout.HierarchicalNamespace hierarchicalNamespace_; + /** + * + * + *
+   * Output only. The bucket's hierarchical namespace configuration. If there is
+   * no configuration, the hierarchical namespace is disabled.
+   * 
+ * + * + * .google.storage.control.v2.StorageLayout.HierarchicalNamespace hierarchical_namespace = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the hierarchicalNamespace field is set. + */ + @java.lang.Override + public boolean hasHierarchicalNamespace() { + return hierarchicalNamespace_ != null; + } + /** + * + * + *
+   * Output only. The bucket's hierarchical namespace configuration. If there is
+   * no configuration, the hierarchical namespace is disabled.
+   * 
+ * + * + * .google.storage.control.v2.StorageLayout.HierarchicalNamespace hierarchical_namespace = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The hierarchicalNamespace. + */ + @java.lang.Override + public com.google.storage.control.v2.StorageLayout.HierarchicalNamespace + getHierarchicalNamespace() { + return hierarchicalNamespace_ == null + ? com.google.storage.control.v2.StorageLayout.HierarchicalNamespace.getDefaultInstance() + : hierarchicalNamespace_; + } + /** + * + * + *
+   * Output only. The bucket's hierarchical namespace configuration. If there is
+   * no configuration, the hierarchical namespace is disabled.
+   * 
+ * + * + * .google.storage.control.v2.StorageLayout.HierarchicalNamespace hierarchical_namespace = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.storage.control.v2.StorageLayout.HierarchicalNamespaceOrBuilder + getHierarchicalNamespaceOrBuilder() { + return hierarchicalNamespace_ == null + ? com.google.storage.control.v2.StorageLayout.HierarchicalNamespace.getDefaultInstance() + : hierarchicalNamespace_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(location_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, location_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(locationType_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, locationType_); + } + if (customPlacementConfig_ != null) { + output.writeMessage(4, getCustomPlacementConfig()); + } + if (hierarchicalNamespace_ != null) { + output.writeMessage(5, getHierarchicalNamespace()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(location_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, location_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(locationType_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, locationType_); + } + if (customPlacementConfig_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCustomPlacementConfig()); + } + if (hierarchicalNamespace_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(5, getHierarchicalNamespace()); + } + size += getUnknownFields().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.control.v2.StorageLayout)) { + return super.equals(obj); + } + com.google.storage.control.v2.StorageLayout other = + (com.google.storage.control.v2.StorageLayout) obj; + + if (!getName().equals(other.getName())) return false; + if (!getLocation().equals(other.getLocation())) return false; + if (!getLocationType().equals(other.getLocationType())) return false; + if (hasCustomPlacementConfig() != other.hasCustomPlacementConfig()) return false; + if (hasCustomPlacementConfig()) { + if (!getCustomPlacementConfig().equals(other.getCustomPlacementConfig())) return false; + } + if (hasHierarchicalNamespace() != other.hasHierarchicalNamespace()) return false; + if (hasHierarchicalNamespace()) { + if (!getHierarchicalNamespace().equals(other.getHierarchicalNamespace())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getLocation().hashCode(); + hash = (37 * hash) + LOCATION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getLocationType().hashCode(); + if (hasCustomPlacementConfig()) { + hash = (37 * hash) + CUSTOM_PLACEMENT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getCustomPlacementConfig().hashCode(); + } + if (hasHierarchicalNamespace()) { + hash = (37 * hash) + HIERARCHICAL_NAMESPACE_FIELD_NUMBER; + hash = (53 * hash) + getHierarchicalNamespace().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.storage.control.v2.StorageLayout parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.control.v2.StorageLayout 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.control.v2.StorageLayout parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.control.v2.StorageLayout 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.control.v2.StorageLayout parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.storage.control.v2.StorageLayout parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.storage.control.v2.StorageLayout parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.control.v2.StorageLayout 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.control.v2.StorageLayout parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.storage.control.v2.StorageLayout 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.control.v2.StorageLayout parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.storage.control.v2.StorageLayout 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.control.v2.StorageLayout 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 storage layout configuration of a bucket.
+   * 
+ * + * Protobuf type {@code google.storage.control.v2.StorageLayout} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.storage.control.v2.StorageLayout) + com.google.storage.control.v2.StorageLayoutOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_StorageLayout_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_StorageLayout_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.storage.control.v2.StorageLayout.class, + com.google.storage.control.v2.StorageLayout.Builder.class); + } + + // Construct using com.google.storage.control.v2.StorageLayout.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + location_ = ""; + locationType_ = ""; + customPlacementConfig_ = null; + if (customPlacementConfigBuilder_ != null) { + customPlacementConfigBuilder_.dispose(); + customPlacementConfigBuilder_ = null; + } + hierarchicalNamespace_ = null; + if (hierarchicalNamespaceBuilder_ != null) { + hierarchicalNamespaceBuilder_.dispose(); + hierarchicalNamespaceBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.storage.control.v2.StorageControlProto + .internal_static_google_storage_control_v2_StorageLayout_descriptor; + } + + @java.lang.Override + public com.google.storage.control.v2.StorageLayout getDefaultInstanceForType() { + return com.google.storage.control.v2.StorageLayout.getDefaultInstance(); + } + + @java.lang.Override + public com.google.storage.control.v2.StorageLayout build() { + com.google.storage.control.v2.StorageLayout result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.storage.control.v2.StorageLayout buildPartial() { + com.google.storage.control.v2.StorageLayout result = + new com.google.storage.control.v2.StorageLayout(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.storage.control.v2.StorageLayout result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.location_ = location_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.locationType_ = locationType_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.customPlacementConfig_ = + customPlacementConfigBuilder_ == null + ? customPlacementConfig_ + : customPlacementConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.hierarchicalNamespace_ = + hierarchicalNamespaceBuilder_ == null + ? hierarchicalNamespace_ + : hierarchicalNamespaceBuilder_.build(); + } + } + + @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.control.v2.StorageLayout) { + return mergeFrom((com.google.storage.control.v2.StorageLayout) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.storage.control.v2.StorageLayout other) { + if (other == com.google.storage.control.v2.StorageLayout.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getLocation().isEmpty()) { + location_ = other.location_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getLocationType().isEmpty()) { + locationType_ = other.locationType_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.hasCustomPlacementConfig()) { + mergeCustomPlacementConfig(other.getCustomPlacementConfig()); + } + if (other.hasHierarchicalNamespace()) { + mergeHierarchicalNamespace(other.getHierarchicalNamespace()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + location_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + locationType_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + input.readMessage( + getCustomPlacementConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage( + getHierarchicalNamespaceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. The name of the StorageLayout resource.
+     * Format: `projects/{project}/buckets/{bucket}/storageLayout`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The name of the StorageLayout resource.
+     * Format: `projects/{project}/buckets/{bucket}/storageLayout`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The name of the StorageLayout resource.
+     * Format: `projects/{project}/buckets/{bucket}/storageLayout`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of the StorageLayout resource.
+     * Format: `projects/{project}/buckets/{bucket}/storageLayout`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The name of the StorageLayout resource.
+     * Format: `projects/{project}/buckets/{bucket}/storageLayout`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object location_ = ""; + /** + * + * + *
+     * Output only. The location of the bucket.
+     * 
+ * + * string location = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The location of the bucket.
+     * 
+ * + * string location = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + } + } + /** + * + * + *
+     * Output only. The location of the bucket.
+     * 
+ * + * string location = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The location of the bucket.
+     * 
+ * + * string location = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearLocation() { + location_ = getDefaultInstance().getLocation(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The location of the bucket.
+     * 
+ * + * string location = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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; + bitField0_ |= 0x00000002; + 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 = 3 [(.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 = 3 [(.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 = 3 [(.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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The location type of the bucket (region, dual-region,
+     * multi-region, etc).
+     * 
+ * + * string location_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearLocationType() { + locationType_ = getDefaultInstance().getLocationType(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The location type of the bucket (region, dual-region,
+     * multi-region, etc).
+     * 
+ * + * string location_type = 3 [(.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; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private com.google.storage.control.v2.StorageLayout.CustomPlacementConfig + customPlacementConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.control.v2.StorageLayout.CustomPlacementConfig, + com.google.storage.control.v2.StorageLayout.CustomPlacementConfig.Builder, + com.google.storage.control.v2.StorageLayout.CustomPlacementConfigOrBuilder> + customPlacementConfigBuilder_; + /** + * + * + *
+     * Output only. The data placement configuration for custom dual region. If
+     * there is no configuration, this is not a custom dual region bucket.
+     * 
+ * + * + * .google.storage.control.v2.StorageLayout.CustomPlacementConfig custom_placement_config = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the customPlacementConfig field is set. + */ + public boolean hasCustomPlacementConfig() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * + * + *
+     * Output only. The data placement configuration for custom dual region. If
+     * there is no configuration, this is not a custom dual region bucket.
+     * 
+ * + * + * .google.storage.control.v2.StorageLayout.CustomPlacementConfig custom_placement_config = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The customPlacementConfig. + */ + public com.google.storage.control.v2.StorageLayout.CustomPlacementConfig + getCustomPlacementConfig() { + if (customPlacementConfigBuilder_ == null) { + return customPlacementConfig_ == null + ? com.google.storage.control.v2.StorageLayout.CustomPlacementConfig.getDefaultInstance() + : customPlacementConfig_; + } else { + return customPlacementConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The data placement configuration for custom dual region. If
+     * there is no configuration, this is not a custom dual region bucket.
+     * 
+ * + * + * .google.storage.control.v2.StorageLayout.CustomPlacementConfig custom_placement_config = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCustomPlacementConfig( + com.google.storage.control.v2.StorageLayout.CustomPlacementConfig value) { + if (customPlacementConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + customPlacementConfig_ = value; + } else { + customPlacementConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The data placement configuration for custom dual region. If
+     * there is no configuration, this is not a custom dual region bucket.
+     * 
+ * + * + * .google.storage.control.v2.StorageLayout.CustomPlacementConfig custom_placement_config = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCustomPlacementConfig( + com.google.storage.control.v2.StorageLayout.CustomPlacementConfig.Builder builderForValue) { + if (customPlacementConfigBuilder_ == null) { + customPlacementConfig_ = builderForValue.build(); + } else { + customPlacementConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The data placement configuration for custom dual region. If
+     * there is no configuration, this is not a custom dual region bucket.
+     * 
+ * + * + * .google.storage.control.v2.StorageLayout.CustomPlacementConfig custom_placement_config = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCustomPlacementConfig( + com.google.storage.control.v2.StorageLayout.CustomPlacementConfig value) { + if (customPlacementConfigBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && customPlacementConfig_ != null + && customPlacementConfig_ + != com.google.storage.control.v2.StorageLayout.CustomPlacementConfig + .getDefaultInstance()) { + getCustomPlacementConfigBuilder().mergeFrom(value); + } else { + customPlacementConfig_ = value; + } + } else { + customPlacementConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The data placement configuration for custom dual region. If
+     * there is no configuration, this is not a custom dual region bucket.
+     * 
+ * + * + * .google.storage.control.v2.StorageLayout.CustomPlacementConfig custom_placement_config = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCustomPlacementConfig() { + bitField0_ = (bitField0_ & ~0x00000008); + customPlacementConfig_ = null; + if (customPlacementConfigBuilder_ != null) { + customPlacementConfigBuilder_.dispose(); + customPlacementConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The data placement configuration for custom dual region. If
+     * there is no configuration, this is not a custom dual region bucket.
+     * 
+ * + * + * .google.storage.control.v2.StorageLayout.CustomPlacementConfig custom_placement_config = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.storage.control.v2.StorageLayout.CustomPlacementConfig.Builder + getCustomPlacementConfigBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getCustomPlacementConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The data placement configuration for custom dual region. If
+     * there is no configuration, this is not a custom dual region bucket.
+     * 
+ * + * + * .google.storage.control.v2.StorageLayout.CustomPlacementConfig custom_placement_config = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.storage.control.v2.StorageLayout.CustomPlacementConfigOrBuilder + getCustomPlacementConfigOrBuilder() { + if (customPlacementConfigBuilder_ != null) { + return customPlacementConfigBuilder_.getMessageOrBuilder(); + } else { + return customPlacementConfig_ == null + ? com.google.storage.control.v2.StorageLayout.CustomPlacementConfig.getDefaultInstance() + : customPlacementConfig_; + } + } + /** + * + * + *
+     * Output only. The data placement configuration for custom dual region. If
+     * there is no configuration, this is not a custom dual region bucket.
+     * 
+ * + * + * .google.storage.control.v2.StorageLayout.CustomPlacementConfig custom_placement_config = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.control.v2.StorageLayout.CustomPlacementConfig, + com.google.storage.control.v2.StorageLayout.CustomPlacementConfig.Builder, + com.google.storage.control.v2.StorageLayout.CustomPlacementConfigOrBuilder> + getCustomPlacementConfigFieldBuilder() { + if (customPlacementConfigBuilder_ == null) { + customPlacementConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.control.v2.StorageLayout.CustomPlacementConfig, + com.google.storage.control.v2.StorageLayout.CustomPlacementConfig.Builder, + com.google.storage.control.v2.StorageLayout.CustomPlacementConfigOrBuilder>( + getCustomPlacementConfig(), getParentForChildren(), isClean()); + customPlacementConfig_ = null; + } + return customPlacementConfigBuilder_; + } + + private com.google.storage.control.v2.StorageLayout.HierarchicalNamespace + hierarchicalNamespace_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.control.v2.StorageLayout.HierarchicalNamespace, + com.google.storage.control.v2.StorageLayout.HierarchicalNamespace.Builder, + com.google.storage.control.v2.StorageLayout.HierarchicalNamespaceOrBuilder> + hierarchicalNamespaceBuilder_; + /** + * + * + *
+     * Output only. The bucket's hierarchical namespace configuration. If there is
+     * no configuration, the hierarchical namespace is disabled.
+     * 
+ * + * + * .google.storage.control.v2.StorageLayout.HierarchicalNamespace hierarchical_namespace = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the hierarchicalNamespace field is set. + */ + public boolean hasHierarchicalNamespace() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Output only. The bucket's hierarchical namespace configuration. If there is
+     * no configuration, the hierarchical namespace is disabled.
+     * 
+ * + * + * .google.storage.control.v2.StorageLayout.HierarchicalNamespace hierarchical_namespace = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The hierarchicalNamespace. + */ + public com.google.storage.control.v2.StorageLayout.HierarchicalNamespace + getHierarchicalNamespace() { + if (hierarchicalNamespaceBuilder_ == null) { + return hierarchicalNamespace_ == null + ? com.google.storage.control.v2.StorageLayout.HierarchicalNamespace.getDefaultInstance() + : hierarchicalNamespace_; + } else { + return hierarchicalNamespaceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The bucket's hierarchical namespace configuration. If there is
+     * no configuration, the hierarchical namespace is disabled.
+     * 
+ * + * + * .google.storage.control.v2.StorageLayout.HierarchicalNamespace hierarchical_namespace = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setHierarchicalNamespace( + com.google.storage.control.v2.StorageLayout.HierarchicalNamespace value) { + if (hierarchicalNamespaceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + hierarchicalNamespace_ = value; + } else { + hierarchicalNamespaceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The bucket's hierarchical namespace configuration. If there is
+     * no configuration, the hierarchical namespace is disabled.
+     * 
+ * + * + * .google.storage.control.v2.StorageLayout.HierarchicalNamespace hierarchical_namespace = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setHierarchicalNamespace( + com.google.storage.control.v2.StorageLayout.HierarchicalNamespace.Builder builderForValue) { + if (hierarchicalNamespaceBuilder_ == null) { + hierarchicalNamespace_ = builderForValue.build(); + } else { + hierarchicalNamespaceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The bucket's hierarchical namespace configuration. If there is
+     * no configuration, the hierarchical namespace is disabled.
+     * 
+ * + * + * .google.storage.control.v2.StorageLayout.HierarchicalNamespace hierarchical_namespace = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeHierarchicalNamespace( + com.google.storage.control.v2.StorageLayout.HierarchicalNamespace value) { + if (hierarchicalNamespaceBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && hierarchicalNamespace_ != null + && hierarchicalNamespace_ + != com.google.storage.control.v2.StorageLayout.HierarchicalNamespace + .getDefaultInstance()) { + getHierarchicalNamespaceBuilder().mergeFrom(value); + } else { + hierarchicalNamespace_ = value; + } + } else { + hierarchicalNamespaceBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The bucket's hierarchical namespace configuration. If there is
+     * no configuration, the hierarchical namespace is disabled.
+     * 
+ * + * + * .google.storage.control.v2.StorageLayout.HierarchicalNamespace hierarchical_namespace = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearHierarchicalNamespace() { + bitField0_ = (bitField0_ & ~0x00000010); + hierarchicalNamespace_ = null; + if (hierarchicalNamespaceBuilder_ != null) { + hierarchicalNamespaceBuilder_.dispose(); + hierarchicalNamespaceBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The bucket's hierarchical namespace configuration. If there is
+     * no configuration, the hierarchical namespace is disabled.
+     * 
+ * + * + * .google.storage.control.v2.StorageLayout.HierarchicalNamespace hierarchical_namespace = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.storage.control.v2.StorageLayout.HierarchicalNamespace.Builder + getHierarchicalNamespaceBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getHierarchicalNamespaceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The bucket's hierarchical namespace configuration. If there is
+     * no configuration, the hierarchical namespace is disabled.
+     * 
+ * + * + * .google.storage.control.v2.StorageLayout.HierarchicalNamespace hierarchical_namespace = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.storage.control.v2.StorageLayout.HierarchicalNamespaceOrBuilder + getHierarchicalNamespaceOrBuilder() { + if (hierarchicalNamespaceBuilder_ != null) { + return hierarchicalNamespaceBuilder_.getMessageOrBuilder(); + } else { + return hierarchicalNamespace_ == null + ? com.google.storage.control.v2.StorageLayout.HierarchicalNamespace.getDefaultInstance() + : hierarchicalNamespace_; + } + } + /** + * + * + *
+     * Output only. The bucket's hierarchical namespace configuration. If there is
+     * no configuration, the hierarchical namespace is disabled.
+     * 
+ * + * + * .google.storage.control.v2.StorageLayout.HierarchicalNamespace hierarchical_namespace = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.control.v2.StorageLayout.HierarchicalNamespace, + com.google.storage.control.v2.StorageLayout.HierarchicalNamespace.Builder, + com.google.storage.control.v2.StorageLayout.HierarchicalNamespaceOrBuilder> + getHierarchicalNamespaceFieldBuilder() { + if (hierarchicalNamespaceBuilder_ == null) { + hierarchicalNamespaceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.storage.control.v2.StorageLayout.HierarchicalNamespace, + com.google.storage.control.v2.StorageLayout.HierarchicalNamespace.Builder, + com.google.storage.control.v2.StorageLayout.HierarchicalNamespaceOrBuilder>( + getHierarchicalNamespace(), getParentForChildren(), isClean()); + hierarchicalNamespace_ = null; + } + return hierarchicalNamespaceBuilder_; + } + + @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.control.v2.StorageLayout) + } + + // @@protoc_insertion_point(class_scope:google.storage.control.v2.StorageLayout) + private static final com.google.storage.control.v2.StorageLayout DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.storage.control.v2.StorageLayout(); + } + + public static com.google.storage.control.v2.StorageLayout getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StorageLayout parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.control.v2.StorageLayout getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/StorageLayoutName.java b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/StorageLayoutName.java new file mode 100644 index 0000000000..3e81f069a7 --- /dev/null +++ b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/StorageLayoutName.java @@ -0,0 +1,191 @@ +/* + * Copyright 2023 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.control.v2; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class StorageLayoutName implements ResourceName { + private static final PathTemplate PROJECT_BUCKET = + PathTemplate.createWithoutUrlEncoding("projects/{project}/buckets/{bucket}/storageLayout"); + private volatile Map fieldValuesMap; + private final String project; + private final String bucket; + + @Deprecated + protected StorageLayoutName() { + project = null; + bucket = null; + } + + private StorageLayoutName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + bucket = Preconditions.checkNotNull(builder.getBucket()); + } + + public String getProject() { + return project; + } + + public String getBucket() { + return bucket; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static StorageLayoutName of(String project, String bucket) { + return newBuilder().setProject(project).setBucket(bucket).build(); + } + + public static String format(String project, String bucket) { + return newBuilder().setProject(project).setBucket(bucket).build().toString(); + } + + public static StorageLayoutName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_BUCKET.validatedMatch( + formattedString, "StorageLayoutName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("bucket")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (StorageLayoutName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_BUCKET.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (bucket != null) { + fieldMapBuilder.put("bucket", bucket); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_BUCKET.instantiate("project", project, "bucket", bucket); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + StorageLayoutName that = ((StorageLayoutName) o); + return Objects.equals(this.project, that.project) && Objects.equals(this.bucket, that.bucket); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(bucket); + return h; + } + + /** Builder for projects/{project}/buckets/{bucket}/storageLayout. */ + public static class Builder { + private String project; + private String bucket; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getBucket() { + return bucket; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setBucket(String bucket) { + this.bucket = bucket; + return this; + } + + private Builder(StorageLayoutName storageLayoutName) { + this.project = storageLayoutName.project; + this.bucket = storageLayoutName.bucket; + } + + public StorageLayoutName build() { + return new StorageLayoutName(this); + } + } +} diff --git a/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/StorageLayoutOrBuilder.java b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/StorageLayoutOrBuilder.java new file mode 100644 index 0000000000..8ca9e3bfa4 --- /dev/null +++ b/proto-google-cloud-storage-control-v2/src/main/java/com/google/storage/control/v2/StorageLayoutOrBuilder.java @@ -0,0 +1,194 @@ +/* + * Copyright 2023 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/control/v2/storage_control.proto + +package com.google.storage.control.v2; + +public interface StorageLayoutOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.storage.control.v2.StorageLayout) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The name of the StorageLayout resource.
+   * Format: `projects/{project}/buckets/{bucket}/storageLayout`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. The name of the StorageLayout resource.
+   * Format: `projects/{project}/buckets/{bucket}/storageLayout`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. The location of the bucket.
+   * 
+ * + * string location = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The location. + */ + java.lang.String getLocation(); + /** + * + * + *
+   * Output only. The location of the bucket.
+   * 
+ * + * string location = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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 = 3 [(.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 = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for locationType. + */ + com.google.protobuf.ByteString getLocationTypeBytes(); + + /** + * + * + *
+   * Output only. The data placement configuration for custom dual region. If
+   * there is no configuration, this is not a custom dual region bucket.
+   * 
+ * + * + * .google.storage.control.v2.StorageLayout.CustomPlacementConfig custom_placement_config = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the customPlacementConfig field is set. + */ + boolean hasCustomPlacementConfig(); + /** + * + * + *
+   * Output only. The data placement configuration for custom dual region. If
+   * there is no configuration, this is not a custom dual region bucket.
+   * 
+ * + * + * .google.storage.control.v2.StorageLayout.CustomPlacementConfig custom_placement_config = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The customPlacementConfig. + */ + com.google.storage.control.v2.StorageLayout.CustomPlacementConfig getCustomPlacementConfig(); + /** + * + * + *
+   * Output only. The data placement configuration for custom dual region. If
+   * there is no configuration, this is not a custom dual region bucket.
+   * 
+ * + * + * .google.storage.control.v2.StorageLayout.CustomPlacementConfig custom_placement_config = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.storage.control.v2.StorageLayout.CustomPlacementConfigOrBuilder + getCustomPlacementConfigOrBuilder(); + + /** + * + * + *
+   * Output only. The bucket's hierarchical namespace configuration. If there is
+   * no configuration, the hierarchical namespace is disabled.
+   * 
+ * + * + * .google.storage.control.v2.StorageLayout.HierarchicalNamespace hierarchical_namespace = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the hierarchicalNamespace field is set. + */ + boolean hasHierarchicalNamespace(); + /** + * + * + *
+   * Output only. The bucket's hierarchical namespace configuration. If there is
+   * no configuration, the hierarchical namespace is disabled.
+   * 
+ * + * + * .google.storage.control.v2.StorageLayout.HierarchicalNamespace hierarchical_namespace = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The hierarchicalNamespace. + */ + com.google.storage.control.v2.StorageLayout.HierarchicalNamespace getHierarchicalNamespace(); + /** + * + * + *
+   * Output only. The bucket's hierarchical namespace configuration. If there is
+   * no configuration, the hierarchical namespace is disabled.
+   * 
+ * + * + * .google.storage.control.v2.StorageLayout.HierarchicalNamespace hierarchical_namespace = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.storage.control.v2.StorageLayout.HierarchicalNamespaceOrBuilder + getHierarchicalNamespaceOrBuilder(); +} diff --git a/proto-google-cloud-storage-control-v2/src/main/proto/google/storage/control/v2/storage_control.proto b/proto-google-cloud-storage-control-v2/src/main/proto/google/storage/control/v2/storage_control.proto new file mode 100644 index 0000000000..65a01f3905 --- /dev/null +++ b/proto-google-cloud-storage-control-v2/src/main/proto/google/storage/control/v2/storage_control.proto @@ -0,0 +1,427 @@ +// Copyright 2023 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.control.v2; + +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/api/routing.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/storage/control/apiv2/storagecontrolpb;storagecontrolpb"; +option java_multiple_files = true; +option java_outer_classname = "StorageControlProto"; +option java_package = "com.google.storage.control.v2"; +option (google.api.resource_definition) = { + type: "storage.googleapis.com/Bucket" + pattern: "projects/{project}/buckets/{bucket}" +}; + +// StorageControl service includes selected control plane operations. +service StorageControl { + 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"; + + // Creates a new folder. + rpc CreateFolder(CreateFolderRequest) returns (Folder) { + option (google.api.routing) = { + routing_parameters { field: "parent" path_template: "{bucket=**}" } + }; + option (google.api.method_signature) = "parent,folder,folder_id"; + } + + // Permanently deletes an empty folder. + rpc DeleteFolder(DeleteFolderRequest) returns (google.protobuf.Empty) { + option (google.api.routing) = { + routing_parameters { + field: "name" + path_template: "{bucket=projects/*/buckets/*}/**" + } + }; + option (google.api.method_signature) = "name"; + } + + // Returns metadata for the specified folder. + rpc GetFolder(GetFolderRequest) returns (Folder) { + option (google.api.routing) = { + routing_parameters { + field: "name" + path_template: "{bucket=projects/*/buckets/*}/**" + } + }; + option (google.api.method_signature) = "name"; + } + + // Retrieves a list of folders for a given bucket. + rpc ListFolders(ListFoldersRequest) returns (ListFoldersResponse) { + option (google.api.routing) = { + routing_parameters { field: "parent" path_template: "{bucket=**}" } + }; + option (google.api.method_signature) = "parent"; + } + + // Renames a source folder to a destination folder. During a rename, the + // source and destination folders are locked until the long running operation + // completes. + rpc RenameFolder(RenameFolderRequest) returns (google.longrunning.Operation) { + option (google.api.routing) = { + routing_parameters { + field: "name" + path_template: "{bucket=projects/*/buckets/*}/**" + } + }; + option (google.api.method_signature) = "name,destination_folder_id"; + option (google.longrunning.operation_info) = { + response_type: "Folder" + metadata_type: "RenameFolderMetadata" + }; + } + + // Returns the storage layout configuration for a given bucket. + rpc GetStorageLayout(GetStorageLayoutRequest) returns (StorageLayout) { + option (google.api.routing) = { + routing_parameters { + field: "name" + path_template: "{bucket=projects/*/buckets/*}/**" + } + }; + option (google.api.method_signature) = "name"; + } +} + +// Contains information about a pending rename operation. +message PendingRenameInfo { + // Output only. The name of the rename operation. + string operation = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A folder. +message Folder { + option (google.api.resource) = { + type: "storage.googleapis.com/Folder" + pattern: "projects/{project}/buckets/{bucket}/folders/{folder=**}" + plural: "folders" + singular: "folder" + }; + + // Identifier. The name of this folder. + // Format: `projects/{project}/buckets/{bucket}/folders/{folder}` + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. The version of the metadata for this folder. Used for + // preconditions and for detecting changes in metadata. + int64 metageneration = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The creation time of the folder. + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The modification time of the folder. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Only present if the folder is part of an ongoing RenameFolder + // operation. Contains information which can be used to query the operation + // status. The presence of this field also indicates all write operations are + // blocked for this folder, including folder, managed folder, and object + // operations. + PendingRenameInfo pending_rename_info = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for GetFolder. +message GetFolderRequest { + // Required. Name of the folder. + // Format: `projects/{project}/buckets/{bucket}/folders/{folder}` + string name = 6 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "storage.googleapis.com/Folder" } + ]; + + // Makes the operation only succeed conditional on whether the folder's + // current metageneration matches the given value. + optional int64 if_metageneration_match = 3; + + // Makes the operation only succeed conditional on whether the folder's + // current metageneration does not match the given value. + optional int64 if_metageneration_not_match = 4; + + // Optional. A unique identifier for this request. UUID is the recommended + // format, but other formats are still accepted. + string request_id = 5 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for CreateFolder. +message CreateFolderRequest { + // Required. Name of the bucket in which the folder will reside. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "storage.googleapis.com/Folder" + } + ]; + + // Required. Properties of the new folder being created. + // The bucket and name of the folder are specified in the parent and folder_id + // fields, respectively. Populating those fields in `folder` will result in an + // error. + Folder folder = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The absolute path of the folder, using a single `/` as delimiter. + string folder_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. If true, parent folder doesn't have to be present and all missing + // ancestor folders will be created atomically. + bool recursive = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A unique identifier for this request. UUID is the recommended + // format, but other formats are still accepted. This request is only + // idempotent if a `request_id` is provided. + string request_id = 5 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for DeleteFolder. +message DeleteFolderRequest { + // Required. Name of the folder. + // Format: `projects/{project}/buckets/{bucket}/folders/{folder}` + string name = 6 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "storage.googleapis.com/Folder" } + ]; + + // Makes the operation only succeed conditional on whether the folder's + // current metageneration matches the given value. + optional int64 if_metageneration_match = 3; + + // Makes the operation only succeed conditional on whether the folder's + // current metageneration does not match the given value. + optional int64 if_metageneration_not_match = 4; + + // Optional. A unique identifier for this request. UUID is the recommended + // format, but other formats are still accepted. This request is only + // idempotent if a `request_id` is provided. + string request_id = 5 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for ListFolders. +message ListFoldersRequest { + // Required. Name of the bucket in which to look for folders. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "storage.googleapis.com/Folder" + } + ]; + + // Optional. Maximum number of folders to return in a single response. The + // service will use this parameter or 1,000 items, whichever is smaller. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A previously-returned page token representing part of the larger + // set of results to view. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter results to folders whose names begin with this prefix. + // If set, the value must either be an empty string or end with a '/'. + string prefix = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, returns results in a directory-like mode. The results + // will only include folders that either exactly match the above prefix, or + // are one level below the prefix. The only supported value is '/'. + string delimiter = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter results to folders whose names are lexicographically equal + // to or after lexicographic_start. If lexicographic_end is also set, the + // folders listed have names between lexicographic_start (inclusive) and + // lexicographic_end (exclusive). + string lexicographic_start = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter results to folders whose names are lexicographically + // before lexicographic_end. If lexicographic_start is also set, the folders + // listed have names between lexicographic_start (inclusive) and + // lexicographic_end (exclusive). + string lexicographic_end = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A unique identifier for this request. UUID is the recommended + // format, but other formats are still accepted. + string request_id = 9 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Response message for ListFolders. +message ListFoldersResponse { + // The list of child folders + repeated Folder folders = 1; + + // The continuation token, used to page through large result sets. Provide + // this value in a subsequent request to return the next page of results. + string next_page_token = 2; +} + +// Request message for RenameFolder. +message RenameFolderRequest { + // Required. Name of the source folder being renamed. + // Format: `projects/{project}/buckets/{bucket}/folders/{folder}` + string name = 7 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "storage.googleapis.com/Folder" } + ]; + + // Required. The destination folder ID, e.g. `foo/bar/`. + string destination_folder_id = 8 [(google.api.field_behavior) = REQUIRED]; + + // Makes the operation only succeed conditional on whether the source + // folder's current metageneration matches the given value. + optional int64 if_metageneration_match = 4; + + // Makes the operation only succeed conditional on whether the source + // folder's current metageneration does not match the given value. + optional int64 if_metageneration_not_match = 5; + + // Optional. A unique identifier for this request. UUID is the recommended + // format, but other formats are still accepted. This request is only + // idempotent if a `request_id` is provided. + string request_id = 6 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// The message contains metadata that is common to all Storage Control +// long-running operations, present in its `google.longrunning.Operation` +// messages, and accessible via `metadata.common_metadata`. +message CommonLongRunningOperationMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation was last modified. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The type of operation invoked. + string type = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation. + bool requested_cancellation = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The estimated progress of the operation in percentage [0, + // 100]. The value -1 means the progress is unknown. + int32 progress_percent = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Message returned in the metadata field of the Operation resource for +// RenameFolder operations. +message RenameFolderMetadata { + // Generic metadata for the long running operation. + CommonLongRunningOperationMetadata common_metadata = 1; + + // The path of the source folder. + string source_folder_id = 2; + + // The path of the destination folder. + string destination_folder_id = 3; +} + +// The storage layout configuration of a bucket. +message StorageLayout { + option (google.api.resource) = { + type: "storage.googleapis.com/StorageLayout" + pattern: "projects/{project}/buckets/{bucket}/storageLayout" + }; + + // Configuration for Custom Dual Regions. It should specify precisely two + // eligible regions within the same Multiregion. More information on regions + // may be found [https://cloud.google.com/storage/docs/locations][here]. + message CustomPlacementConfig { + // List of locations to use for data placement. + repeated string data_locations = 1; + } + + // Configuration for a bucket's hierarchical namespace feature. + message HierarchicalNamespace { + // Enables the hierarchical namespace feature. + bool enabled = 1; + } + + // Output only. The name of the StorageLayout resource. + // Format: `projects/{project}/buckets/{bucket}/storageLayout` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The location of the bucket. + string location = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The location type of the bucket (region, dual-region, + // multi-region, etc). + string location_type = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The data placement configuration for custom dual region. If + // there is no configuration, this is not a custom dual region bucket. + CustomPlacementConfig custom_placement_config = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The bucket's hierarchical namespace configuration. If there is + // no configuration, the hierarchical namespace is disabled. + HierarchicalNamespace hierarchical_namespace = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for GetStorageLayout. +message GetStorageLayoutRequest { + // Required. The name of the StorageLayout resource. + // Format: `projects/{project}/buckets/{bucket}/storageLayout` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "storage.googleapis.com/StorageLayout" + } + ]; + + // An optional prefix used for permission check. It is useful when the caller + // only has limited permissions under a specific prefix. + string prefix = 2; + + // Optional. A unique identifier for this request. UUID is the recommended + // format, but other formats are still accepted. + string request_id = 3 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} diff --git a/versions.txt b/versions.txt index b1480f0eb2..fd80dc3d10 100644 --- a/versions.txt +++ b/versions.txt @@ -5,3 +5,6 @@ google-cloud-storage:2.30.1:2.30.1 gapic-google-cloud-storage-v2:2.30.1-alpha:2.30.1-alpha grpc-google-cloud-storage-v2:2.30.1-alpha:2.30.1-alpha proto-google-cloud-storage-v2:2.30.1-alpha:2.30.1-alpha +google-cloud-storage-control:2.30.1-alpha:2.30.1-alpha +proto-google-cloud-storage-control-v2:2.30.1-alpha:2.30.1-alpha +grpc-google-cloud-storage-control-v2:2.30.1-alpha:2.30.1-alpha